A Matlab Programmer's Take On Julia(2pif.info)
2pif.info
A Matlab Programmer's Take On Julia
http://2pif.info/op/julia.html
7 comments
The authors seem very receptive to feedback -- which is encouraging. Maybe I missed if they addressed this, but I wish they'd consider the IDE to be an important part of the language ecosystem. A web REPL is good... but I suspect that (despite Steve Yegge's prediction that the browser is the next IDE) that programmers will expect a serious language/environment to be called interactively through emacs as can R, matlab, and python/ipython (I heard vim can also do this with R?). Or, possibly through an IDE like Rstudio with optional local/server access.
I expect the Web REPL will ultimately evolve into something like RStudio (which itself is web-based, even in local mode).
There is already an emacs mode for Julia: https://github.com/JuliaLang/julia/blob/master/contrib/julia...
There is already an emacs mode for Julia: https://github.com/JuliaLang/julia/blob/master/contrib/julia...
Emacs mode already? They're doin it right. :)
I was not aware RStudio was web-based. News to me...
I was not aware RStudio was web-based. News to me...
Yep, RStudio is GWT driven (https://developers.google.com/web-toolkit/) and uses some very particular configuration tricks to keep you from accessing it with a browser in local mode.
I'm the post's author. I submitted it to HN a couple of weeks ago, but it didn't get much attention; I'm happy to see more comments this time around.
Regarding IDEs: I guess it's a matter of taste. I don't like IDEs, but I wouldn't mind using one as long as it allowed me to code in my editor of choice.
Plotting: I decided to scratch my own itch, and created Gaston, a gnuplot interface. It already offers quite a bit of functionality. It's available at https://bitbucket.org/mbaz/gaston/
nargin vs length: this is something I overlooked when I wrote the article.
I will post a new article with the perspective and knowledge that working on Gaston has given me. I already know what the conclusion will be: julia stands a very good chance of becoming the new standard language for technical computing.
Regarding IDEs: I guess it's a matter of taste. I don't like IDEs, but I wouldn't mind using one as long as it allowed me to code in my editor of choice.
Plotting: I decided to scratch my own itch, and created Gaston, a gnuplot interface. It already offers quite a bit of functionality. It's available at https://bitbucket.org/mbaz/gaston/
nargin vs length: this is something I overlooked when I wrote the article.
I will post a new article with the perspective and knowledge that working on Gaston has given me. I already know what the conclusion will be: julia stands a very good chance of becoming the new standard language for technical computing.
Interesting points, the matrix edge cases seem a bit weird. I program in Matlab all the time, but I basically can't imagine leaving it for Julia no matter how good the language is.
The main reason being that the single most valuable part of Matlab, for me, is its amazing IDE. I've seen a lot of people caught up in debates about languages, obsessing about this feature or that one but it is much more rare to see people argue about the IDE, as if it was merely an afterthought. I find this article guilty of the same crime. The author also dismisses Matlab because a statement with no semicolon prints its result (something I take advantage of often) and other small issues , but there is no mention of everything else you lose when going to Octave. Really?
Maybe I'm spoiled, but I now can't live without seeing all my variables and their size, types and values listed, my ability to quickly execute blocks of code at random, jump around all files, super fast and flexible visualizations, great debugger, profiler, docs at fingertips, etc etc etc all integrated into a single package that just works out of the box. It's development on steroids and I've never seen anything that lets me code faster. I feel sorry for people who code in vim.
The main reason being that the single most valuable part of Matlab, for me, is its amazing IDE. I've seen a lot of people caught up in debates about languages, obsessing about this feature or that one but it is much more rare to see people argue about the IDE, as if it was merely an afterthought. I find this article guilty of the same crime. The author also dismisses Matlab because a statement with no semicolon prints its result (something I take advantage of often) and other small issues , but there is no mention of everything else you lose when going to Octave. Really?
Maybe I'm spoiled, but I now can't live without seeing all my variables and their size, types and values listed, my ability to quickly execute blocks of code at random, jump around all files, super fast and flexible visualizations, great debugger, profiler, docs at fingertips, etc etc etc all integrated into a single package that just works out of the box. It's development on steroids and I've never seen anything that lets me code faster. I feel sorry for people who code in vim.
I would leave MATLAB's IDE in a heartbeat for something that ran in the browser. In my experience, MATLAB's IDE is a terrible piece of crap. It's slow. It's particularly slow when accessed via X11 forwarding, even from the same network. It's memory-hungry. It crashes randomly on OS X (and semi-randomly on Linux). The plots aren't anti-aliased. If you open too many plots, it runs out of Java heap space and crashes. The only thing it has going for it is the tight integration with mlint, but even that's kinda stupid because they could have just written a better optimizing compiler.
Why the browser? In my experience, editing text in a browser is pretty horrible. It doesn't matter for banging out HN comments or emails, but for code, I don't think I could put up with it. It's bad enough having to use the text editors in Eclipse and IntelliJ; regressing all the way to browser text boxes would be a tragedy.
Is it for the sake of having persistent server sessions that don't go away when you close your client? That could easily be done, and has been done, without resorting to using a web browser. I admit that Emacs with Slime is not a paragon of simplicity and reliability, but I suspect it would be easier to recreate the convenience and polish of a web UI in an independent client (possibly based on a hacked version of Chrome or Firefox, if you really, really like your browser) than it would be to turn a text box into a decent code editor.
Is it for the sake of having persistent server sessions that don't go away when you close your client? That could easily be done, and has been done, without resorting to using a web browser. I admit that Emacs with Slime is not a paragon of simplicity and reliability, but I suspect it would be easier to recreate the convenience and polish of a web UI in an independent client (possibly based on a hacked version of Chrome or Firefox, if you really, really like your browser) than it would be to turn a text box into a decent code editor.
My main reason for the browser is that it makes seamless to execute code on a remote machine. Text-based interfaces are not very useful because you can't see plots without saving them and copying them. X11 forwarding is slow. My current solution is NX, but it's not optimal, since I hate NX 4 and NX 3.5 doesn't run on Lion.
Cloud9 IDE is already a decent browser-based code editor. It's already better than the MATLAB editor in just about every way but integration with the interpreter. Using a browser-based IDE will solve both the cross-platform UI issue and the remote access issue.
Cloud9 IDE is already a decent browser-based code editor. It's already better than the MATLAB editor in just about every way but integration with the interpreter. Using a browser-based IDE will solve both the cross-platform UI issue and the remote access issue.
For a language as young as Julia, I'm really surprised that the author focused as much as he did on the Web REPL and development environment. These things can be added later, and I think at this point in the language lifecycle, the team behind it really needs to be focused on getting the fundamentals right (which they seem to be). For a good example of IDE as afterthought, look at RStudio (http://www.rstudio.org) - note that this came around after a decade of other, bad, GUIs for R.
I actually see the matrix edge cases as pretty interesting - while they don't reflect the way I'd try to code things, they probably reflect the way someone codes things, and I imagine that their behavior is either due to a nasty implementation detail or oversight by the Julia core team. Either way, it's good to hash this stuff out now.
I actually see the matrix edge cases as pretty interesting - while they don't reflect the way I'd try to code things, they probably reflect the way someone codes things, and I imagine that their behavior is either due to a nasty implementation detail or oversight by the Julia core team. Either way, it's good to hash this stuff out now.
> Furthermore, in Julia the varargs tuple x will have to be
> processed without the convenience of Matlab's nargin
> function.
I genuinely don't get that. nargin is equivalent to length(x) in this scenario, and Julia's overall handling of default/variable arguments seems significantly more convenient than MATLAB's if nargin < 5
foo = 21;
end
preambles.In Julia, I could do
This is easy to fix with a bit of additional syntax. Using a placeholder to indicate values you don't care about, that would be:
(s,z,zz) = spectrum(x);
but I end up with variables z and zz that clutter the workspace and take up memory.This is easy to fix with a bit of additional syntax. Using a placeholder to indicate values you don't care about, that would be:
(s,_,_) = spectrum(x);
I don't know if it's simple on the implementation side, but it's easy to read and understand.No plotting, except in the web REPL, and only very simple (if pretty) 2D plots supported.
This is something I'd miss. I use R sometimes only because it's plotting features are so fantastic.
This is something I'd miss. I use R sometimes only because it's plotting features are so fantastic.
it's just for now. as soon as the language gathers steam you can expect for the modern amenities to show up, including 2D plots on the desktop.
Julia has a stub-free FFI; you don't have to write anything to interface with C. trivial to add your favorite 2D graphics library.
P.S. Don't people know how to interface with Gnuplot?
Julia has a stub-free FFI; you don't have to write anything to interface with C. trivial to add your favorite 2D graphics library.
P.S. Don't people know how to interface with Gnuplot?
https://groups.google.com/forum/?fromgroups#!searchin/julia-...