5 ms·
Julia, I Love You
- ajdecon 14y agoEdit: Title asks for downsides (but it seems like tue kind of title that might be changed) Disclaimer: I really like Julia, and loving it for some numerical stuff right now. That said... Potential downsides: - Very new, standard libs are still in flux - Matlab-like syntax, which I have mixed feelings on - Clustered parallelism uses ssh for transport, which I find slow (vs MPI) - 1-based array indices (for Matlab and Fortran familiarity)
- codezero 14y agoNot to be pedantic, but Fortran 1-based array indices are from Fortran 66 and earlier. Fortran 77 and on include the ability to index from any arbitrary integer, including negative ones. You can declare a 21 element array indexed from -10 like so: real x(-10:10) So hopefully anyone familiar with Fortran isn't hung up on 1-based indices.
- humbledrone 14y ago> "N̶o̶t̶ to be pedantic, [...]"
- codezero 14y agoYep, can't edit it now though :(
- asg 14y ago1 based array indices are indeed a very opinionated decision. But I must say it isn't a very difficult thing to switch one's mental models around. Its very easy to get used to.
- nwienert 14y agoI'm actually especially interested in taking the [web server](https://github.com/chzyer/JuliaWebServer https://github.com/chzyer/JuliaWebServer) and building out a lean-and-mean MVC framework. Though it's designed as a scientific language, their goals of having C-like speed and yet Ruby-like beauty make it the perfect target for such a project. Anyone else interested in trying it out with me?
- bglusman 14y agoI'm interested, but no idea how much help I'll be :-) Feel free to ping me and would love to try and help, as I've been wanting some context to learn and play with Julia since finding out about it, and being able to do web work in it would be great. Be nice to learn something about web frameworks design and whatnot at the same time!
- eric_bullington 14y agoWhat do you have in mind? A microframework, like Flask or Sinatra? I like that idea. I'd have to real dive into the internal of something like Werkzeug before trying to help out. But the Julia language itself looks fairly straightforward. I just finished up building a microblogging framework using Flask, and I'd love to do the same with a lean MVC framework in Julia, particularly if you achieve anything close to C-like performance. Is Julia said to be fairly stable at this point?
- nwienert 14y agoExactly what I was thinking.. something small and light, but elegant (very much like Julia itself!). I have little experience in this area and have only built the most lightweight frameworks for myself, but if we start a git repo I'll be the first to dive in and start poking around. I think it would be a really cool project.
- eric_bullington 14y agoPlease let me know if you put up a git repo. I can't promise that I'll be able to make any significant contributions at this point in time (working on big project for the next few weeks), but I'd love to try to help when I do get some free time. By the way, have you seen brubeck: http://brubeck.io/ http://brubeck.io/ It would be interesting to build this framework on top of Mongrel 2. Not saying we should necessarily try. But it could be fast, fast, fast.
- minikomi 14y agoHave you considered building it on top of go? Or is it more of a "Julia seems cool I wonder if it's good for this" type idea? Just wondering, because I'm thinking of doing the same thing once I get familiar with the golang environment.
- montecarl 14y agoI wonder if they have any plans to support MPI? On most of the super computers I use that is the only option for parallelism across compute nodes.
- ajdecon 14y agoCurrently Julia handles parallelism on its own: you use the parallel primitives or higher-level functions provided by the language, not an mpi, and run over multiple processes using either "julia -p <N>" (on a single machine) or "Julia -hostfile <host list>" (on a cluster). The Julia interpreter does the networking itself in the background: currently I'm pretty sure this tunnels over ssh. I rather like Julia's parallel syntax, but I'd really prefer that the inter-host communication by done via MPI on the back end for performance. Something to hack at if I ever get time...
- jergosh 14y agoAs for replacing R, the whole problem is that no-one is really a fan of the syntax but there is an staggering number of packages ready to use. Bioconductor (tools for analysis of biological data: http://www.bioconductor.org/ http://www.bioconductor.org/) alone is over 500 packages whose functionality is most likely not implemented for any other language/platform.
- thu 14y agoFrom the post: For a more powerful example (lifted straight from the Julia docs), we can compare Julia and R code for computing the 25th Fibonacci number recursively. How is it a powerful example? How is it meaningful when comparing programming languages (and implementations)? Maybe it is just a 4/1 joke? Or is it really meaningful for people who otherwise use R?
- dfc 14y ago500 > 75 In the context of speed, 500 times slower is more dramatic than 75 times slower.
- mhartl 14y ago500 > 75 I don't think anyone has trouble with the arithmetical inequality. The issue is that the recursive Fibonacci number algorithm is notoriously unrealistic (it's exponential in its argument, growing as φ^n). Because of this, the claim that the example is more "powerful" is a little dubious.
- Jun8 14y agoPossibly sexist question: Does giving a female name to a programming language increase the rate of its adoption? AFAIK, this is the only such language (perl was nearly named gloria, though!). Does anyone know the etymology of the name (julialang.org seems to be down, so I couldn't check there)? There are Julia sets but that's for the lastname of the mathematician Gaston Julia.
- eric_bullington 14y agoYou're forgetting Ada, a very interesting language, but one that has suffered from a constantly low rate of adoption.
- tomjen3 14y agoI doubt it matters, really. Ada is still laughed at rather than adopted widely (too bad, since it is not that bad as a language).
- _delirium 14y agoI don't see a strong pattern. There are others named after female first names that aren't particularly popular (most, really), though the set of popular languages is small enough that it's not clear there's enough data to draw any conclusions. Apart from Ada, which is probably the most popular language in the category, there are two named Alice (http://www.alice.org/ http://www.alice.org/, http://www.ps.uni-saarland.de/alice/ http://www.ps.uni-saarland.de/alice/), and others named Claire (http://www.claire-language.com/ http://www.claire-language.com/), Mary (http://en.wikipedia.org/wiki/Mary_(programming_language) http://en.wikipedia.org/wiki/Mary_(programming_language)), and Miranda (http://miranda.org.uk/ http://miranda.org.uk/). If you allow ancient Greek names, there's also Io (http://iolanguage.com/ http://iolanguage.com/) and Ioke (http://ioke.org/ http://ioke.org/).
- Tycho 14y agoRuby.
- damncabbage 14y agoThat was named after Perl. Having said that, it'd be interesting to know how many people think "gem", "girl's name" or "derivative of Perl" when they first hear it.
- dfc 14y agoI love it when new projects come out of the gate with a `/debian/` directory. Great way to reduce barriers to adoption. I'm actually surprised that it is not in experimental yet...
- 6ren 14y ago> "We want a language that’s homoiconic, with true macros like Lisp, but with obvious, familiar mathematical notation like Matlab." I've thought having it both ways was an insurmountable barrier, and one had to sacrifice the ease-of-use of familiarity to the power of homoiconicity. I guess a resolution is to cheat, and have both sets of constructs (redundantly). What's Julia's solution?
- ken 14y agoDisclaimer: I don't know anything about Julia, except from reading a couple simple programs just now, and seeing that it uses syntax that looks somewhat like Algol. I don't think there's any inherent contradiction between the two, depending on what you mean by "the power of homoiconicity" (1). Homoiconicity doesn't mean you need to use lists: you could make a language like C but with native structures to hold all of the syntax. It's just that "cons cell and symbol" happen to be a really simple set of tools from which you can build everything you need. I suspect that languages that try to have both do it by sacrificing simplicity. They have syntax that looks like C, and then make it homoiconic by building essentially a DOM for all of that syntax. Perhaps the idea is that writing and reading "x = y + z" is deemed sufficiently common that they're OK with making metaprogramming more complex if they get to keep Algol syntax. (1) By "depends on what you mean", I meant: is simplicity requisite for power? I would say "yes", but I can imagine there's someone who would say "no" and consider Algol-plus-DOM (is that what Julia is?) to be as powerful as simpler languages.
- 6ren 14y agoA DOM would give the benefits of homoiconicity, though the quote is We want a language that’s homoiconic. As an example, recent versions of Java include the compiler in Java, and therefore the classes for the AST (though undocumented). That's a DOM; you can use it to implement macros. (There's also ANTLR and BCEL to do AST twiddling - just consider them part of the standard classes of a Java variant). But I think to be homo- (same) iconic (symbols), the language has to be those symbols. By this strict definition, it has to be a lisp. Maybe there's a looser definition possible, between a DOM and Lisp. I think a parallel lisp-syntax would do it (i.e. you can write everything using a lispy syntax; but there's also a friendlier syntax. hmmmm, you could do this for any language, provided a AST representation (i.e. lispy) syntactically unambiguous with the rest. That subset of the language would then be homoiconic. e.g. add a first-class AST syntax to Java. Is that the kind of DOM you were thinking of?
- mhenders 14y agoI'm admittedly a huge fan, but it's hard to find any downsides, even for such a young language. A couple of things you might notice if working in the REPL: - There's no quick way to del/clear the current environment. Namespaces are planned but not yet implemented. - If a function is redefined, there is no automatic recompilation of dependent functions. It's easy though to list or recall existing functions. Give it a go. It's a lot of fun. Some of the core team have been invited to present at Lang.NEXT.
- otoburb 14y agoDepending on the extent of your plotting needs, Julia's grpahics/plotting capabilities will probably not be quite the same as something like gnuplot or ggplot2. Further information: https://github.com/JuliaLang/julia/wiki/Graphics https://github.com/JuliaLang/julia/wiki/Graphics https://github.com/JuliaLang/julia/issues/589 https://github.com/JuliaLang/julia/issues/589 https://github.com/JuliaLang/julia/issues/314 https://github.com/JuliaLang/julia/issues/314
- a_bonobo 14y agoI wanted to know how Julia compares to Python as a normal file-parser so I made this gist: https://gist.github.com/2280733 https://gist.github.com/2280733 It seems that in this case, Julia is extremely slow compared to Python, probably because the LVVM stuff has to fire up first... Any thoughts? Edit: Submitted it on GitHub and it seems to be a genuine bug: https://github.com/JuliaLang/julia/issues/661 https://github.com/JuliaLang/julia/issues/661
- aaronjg 14y agoI find the example benchmark to be rather ridiculous. Recursion is slow in R because R is an interpreted language, and does not implement tail-call optimization. If I wanted to implement the Fibonacci numbers in R I would do it like this: x<-numeric(25); x[1:2] <- 1; for(i in 3:25) x[i] <- x[i-1] + x[i-2]; x[25] Which takes about 1/10,000 the time of the recursive version (about .4 milliseconds on my machine). So the conclusion I draw from the article is not that Julia is faster than R, but that you should know what your languages strengths are, and write code accordingly. I'd love to see some examples of real statistical work were Julia's syntax is as easy as R, but the performance is superior.
- ricardobeat 14y ago> Recursion is slow in R because R is an interpreted language, and does not implement tail-call optimization. Javascript is interpreted and doesn't have it either, yet it's 145x faster.
- asg 14y agoAgreed, one should know the strengths of your language, and avoid the pitfalls. Every language has its share of both. But the effort, I suppose, is to increase the surface area of the strengths. So one of the claims of Julia is that you write code in the most natural manner, and depend on the compiler to make it fast. So, for example, the claim is that adding the optional type parameters do not necessarily make your code faster... type inference is good enough in most cases (there are obvious counterexamples, eg with global variables, but its true in the majority of cases). Also, unlike for eg. Matlab or R, vectorising your code does not necessarily produce performance gains, arrays are good enough. One of the side effects is that the standard library is implemented in the language itself, and thus extending built-in types is a breeze. Therefore, I think its a very interesting effort in itself. Whether it is good enough to displace any other language is a completely separate issue. As said below, the base of useful libraries in languages such as R is phenomenal. But that should not, I think, preclude admiring a very interesting new language, for the possibilities that it hints at, if only as a highly engaging mental activity. Personally, and subjectively, I think the combination of the above, and multiple dispatch, causes the language to have a highly pleasing sense of elegance.
- buckwild 14y agoA lot of times, I really don't think there is a need for a whole new language. I use R and python for scientific computing all of the time. There are packages which have been well validated and a community of folks who support the software. Making a new language may be interesting, but if it doesn't really bring anything new to the table, it's just asking for a micro-niche user base (just think of the million and one web frameworks out there). Julia looks interesting, but I don't see anything that makes me jump up and say, "I want to use that!" Everything I have seen so far can already be done with R, Python, or a combination of the two. If there are a few minor drawbacks to any process in R or Python, I would rather live with it than learn yet another language. Speed is not an issue -- if it is then I am likely coding incorrectly. If I have coded correctly, then it is worth taking the time to create a C library (and since everything else is in perspective, this is just "monkey coding" and never takes as long as we think). I wish all of the folks who are bright enough to create their own language would voice their wants and needs to the existing coding communities to see if their needs can't be met rather than making something brand new. This kind of community interaction is crucial for a language to mature. Wouldn't you rather have a few very mature languages rather than a million young ones (each of which has its own pros and cons)?
- alephnil 14y agoLanguages like matlab, R and Python (via numpy), let you do efficient computations as long as you can let them happen in the core, that is written in C and Fortran. This is very often possible, but in some cases you find that it is not, and then it will either be very slow or you need to write a C module for it. None of these languages is designed to make it easy to make a compiler/runtime that is from the ground up efficient. They are instead a rather inefficient interpreter with a really good library. This is where Julia differ. It is designed exactly to be efficient from the ground up.ground up.