by thinxer · 10y ago · 0 comments
Go is designed for system programming, which is the opposite of scripting. In scientific computing, interactivity is an important feature. Softwares like MATLAB and IPython(now Jupyter) become popular because of this. Go doesn't have a nice REPL like IPython, and it never will. Besides, Go doesn't allow operator overload, which leads to verbose programs. Compare `c = a @ b` with `c := Must(Mul(a, b))`, the former Python statement is much cleaner than the Go one.
Usually, researchers use MATLAB, R, and Python for prototyping and training. The final model will be put into production by using something like TensorFlow Serving or by hand written C++ for performance. Even if the final product uses Go for serving, the Go program mostly runs the model via cgo or RPC.
Write in C/C++, and wrap the library in Python and Go is a much saner option. TensorFlow and MXNet are both good examples.
> scientific computing
for quite some time, and I've the value of a REPL steadily in decline: what's far more useful is a tested code snippet or function & a debugger, occasionally.
Also, if a scientific stack were available in Go, I'd jump on it, because deploying Go is so much simpler than Python. Python's deployment story for scientific software often starts with either )a) create the perfect storm of dependency versions or (b) use Anaconda. Even MATLAB is way better in this regard.
Also, thanks for informing me about MXNet. I've never seen that before. Kinda cool.
If nothing else, to prove a point that there are solid alternatives to C and C++, in memory safe languages.
After all the OP mentioned that only C and C++ were valid alternatives, hence why it is so important to implement such tools in other safer languages.
If people don't do it, as usual there will be a myth that only those languages are able to produce such type of applications.
Similar to the myth that C was the first systems programming language, when many of us were using something else before UNIX got widespread in the industry.
What I'm suggesting here is that there is nothing really remarkable about it, from either a research or implementation perspective, given the achievements of the Java community in recent years.
> Go doesn't have a nice REPL like IPython, and it never will.
https://github.com/motemen/gore
There are a few others too.
Go is not set up to have a REPL; even if someone develops one someday it's always going to be limited compared to a language that was designed to do it. REPLs are actually pretty hard; even some languages designed with them from day one (or at least very early) like Haskell still come with an interesting list of caveats about the REPL.
it automatically creates a CPython-2 extension module out of a Go-1.5 package.
I plan to update it for Go>=1.6 and also directly generate a "cffi" python module so CPython-{2,3} and PyPy can be directly supported out of the box.
Sorry, I have nothing of substance to say, but this deserves more than an upvote.