
Ask HN: Turning a research paper into a startup, but it's written in Matlab - kbumsik
My friend is about to launch a startup based on his bioinformatics Ph.d thesis. The idea is basically to run his model as a web service.<p>The problem is it&#x27;s written in Matlab. I don&#x27;t know much about startup business and I have zero experience in deploying Matlab code to the web so my major concern is the license cost and developers available to hire.<p>I can come up with three ways after a quick look at Matlab&#x27;s portfolio:<p>1. Run Matlab Production Server on AWS as a microservice. But the licensing cost of Matlab Production Server is &quot;contact us&quot;. Scary.<p>2. Use Matlab Compiler to convert it to another language. I worry about runtime dependencies of the compiled output and there might be a hidden pitfall when deploying it.<p>3. Rewrite it in Python&#x2F;numpy. We are fine with rewriting it and it might be easier to get developers, but we might run into a reproducibility problem.<p>Does anyone have a similar path? What is the best practice to deploy a matlab research on the web?<p>Thank you in advance.
======
precsim
As someone whos has written a very large and complex toolbox in Matlab [1],
and now rewriting in Python I would not recommend locking yourself in to
Matlab/Mathworks. However, if you don't use any GUI functionality you might
get away with it, and you might be able to use Octave which can run must
Matlab code unmodified (also see Octave online for deployment).

[1]: [https://www.featool.com](https://www.featool.com)

~~~
kbumsik
Thank you very much for your advice. Is there any specific reason to rewrite
to Python?

~~~
precsim
Sure. As you guys seem to plan to do, I also started with some Matlab based
work from my PhD years and felt that would be the quickest and easiest way
forward. I also made the bet that the Octave app GUI functionality (uixx
functions) would become good enough to use for commercial apps, which as great
as base Octave is, it in my opinion hasn't. So as I make a fully client side
app I am now dependent on users also purchasing or already having Matlab too.

As for Python, it is also a bet and compromise with the following specific
criteria:

\- Fast and easy to develop in (as I as a bootstrapped solo-dev have to do
everything by myself)

\- Reasonably simple to translate to from Matlab code

\- Good and easy to use client side GUI functionality

\- Easy for other users to use (as I want as many users a possible to use the
functionality and potentially be able to write extensions themselves)

\- 3D Visualization libraries (VTK, ParaView)

with this in mind my choices were:

1) Python

2) Julia

3) (Object) Pascal

4) Web stack (Javascript + webassembly)

I almost initially chose (Lazarus free) Pascal due to its IDE, fast
compilation, and easy deployment but eventually I found the fixed pixel based
GUI placement not ideal (although there are probably workarounds for that).
Although using a web stack would be ideal from a user and sales perspective
(with no installation), my impression of web programming is "messy" and I'm
afraid that for CAE simulation apps this approach would freeze the computers
completely (Electron!). Although I initially thought Julia would be ideal as
the syntax was very close to Matlab, it seems to become more and more complex
as it matures and my impression is that there still isn't a good way to
deliver (pre-)compiled client side apps which is my requirement. So all in all
I felt that Python probably the best compromise. It is still a bet, but with
the "Matlab engine" you can call Matlab in the background so port bit by bit.
In your case though with a (web) server-client app you might fare better with
Matlab/Octave.

Tech-stack aside, I've found the hardest part is the non-techy bits,
especially sales, marketing etc. which I still haven't figured out.

Best of luck!

------
NonEUCitizen
MATLAB has "export to C" capability:

[https://www.mathworks.com/help/dsp/ug/generate-c-code-
from-m...](https://www.mathworks.com/help/dsp/ug/generate-c-code-from-matlab-
code-1.html)

Build your website however you wish, then call the C code (e.g. C# P/Invoke
interop if you use .NET, Python CFFI, FastCGI, etc.)

------
speedplane
> Run Matlab Production Server on AWS as a microservice. But the licensing
> cost of Matlab Production Server is "contact us". Scary.

Starting a business is scary. Contact them, figure out the cost, and figure
out if it's worth it to rewrite it in a freely licensed language.

------
quaquaqua1
Contact them and see if it really is as bad as you think :)

You can also go self-hosted while you are in customer acquisition mode?

If the cost of a software license is scary, then I can assure you labor costs
are much worse. You can rewrite now or rewrite later, but hiring devs is a
ways away :)

