12 ms·
Julia, the One Programming Language to Rule Them All
- foldor 13y agoSounds like a fluff piece. It first tells us that this language is the "One Programming Language to Rule Them All", but then it adds: > "That said, it isn’t for everyone. Bezanson says it’s not exactly ideal for building desktop applications or operating systems, and though you can use it for web programming, it’s better suited to technical computing.". So what is it? Is this the supposed "One true language", or is it just another language with a narrow scientific focus?
- idunning 13y agoI'd agree about it being a fluff piece, although I think the binary options you present aren't fair. I'm not a core developer on Julia, just a user and package creator. It is geared towards technical/scientific computing, and excels in that task - it has replaced the combination of Python and C++ I used previously. I think what Jeff Bezanson is saying is that there is nothing intrinsically unsuited about Julia for doing web programming or desktop applications. It benefits from a fresh start in this respect, and also by using best-of-breed libraries from OpenBLAS to libuv. This is in contrast to other languages for technical computing like MATLAB or R which I wouldn't consider to be practical choices for making, for example, a math-as-a-service application (although R is getting into this territory with things like shiny).
- evmar 13y agoAfter all the Julia hype on HN I thought I'd try it out. I was surprised to discover how slow it actually is to use. Here's a quick demo of booting up the Julia repl with two libraries loaded and then immediately exiting: $ time julia -e 'using Distributions; using Gadfly; exit()' real 0m22.778s With behavior like that it's not going to replace R as my go-to tool for graphically exploring data. I'm sure they'll improve this eventually. Much like with Rust, my hopes are high. But also much like with Rust, I wish the hype came after the promises were met. PS: this article claims that Julia 1.0 was released in 2012, but as best as I can tell the most recent code you can get calls itself 0.3. The above was with Version 0.3.0-prerelease+1174 (2014-01-23 16:58 UTC).
- gelstudios 13y agoJulia's JIT makes startup a little slow.
- thinkpad20 13y agoI'm not really familiar with the intricacies of JIT, but wouldn't it be possible to pre-compile just the startup portion of the code, thereby dramatically increasing startup time? This part of the code would seem to almost always run in exactly the same way each time (with respect to each individual package being loaded, the startups of each being also pre-compiled), so there doesn't seem to be any value gained from JIT-compiling this process there.
- wtallis 13y agoYes, Lisp systems have been doing exactly this for decades.
- ihnorton 13y agoYes, this is done now for the standard library, which has reduced time-to-REPL from ~3s to ~.5s. The same idea will eventually be extended to packages.
- thinkpad20 13y agoSweet, sounds good. I look forward to seeing this. Or maybe contributing to it :)
- vanderZwan 13y agoIt's a Wired article, please don't confuse it with the Julia community itself[1] - in my experience the latter is very enthusiastic, very ambitious, but also very willing to admit the current limitations and that it's in a very early open beta stage. [1] Upon rereading, I don't think you are, but just making sure.
- 13y ago
- riggins 13y agoWasn't one of Bjarne Stroustrup's reasons for building c++ to make the network simulations he was working on more tractable?
- pmr_ 13y ago> "What we need, Karpinski realized after struggling to build his network simulation tool, is a single language that does everything well." and later: > "Bezanson says it’s not exactly ideal for building desktop applications or operating systems, and though you can use it for web programming, it’s better suited to technical computing." So, Julia is not what we need? ;) Besides this contradiction I'm not entirely convinced that we need one language to rule them all. I'm not even sure I want multi-paradigm languages (C++ anyone?). Aren't the problems explained in the introduction of this article not caused by the tools instead of the programming languages? I don't see how using multiple languages complicates patching (unless the article is talking about monkey patching which I doubt), but I would understand how going through 4 different debuggers could drive you crazy. Disclaimer: I'm not familiar with Julia and I will not judge it based on a Wired article.
- john_b 13y ago> What we need, Karpinski realized after struggling to build his network simulation tool, is a single language that does everything well. That wasn't quoted in the article, so I'm assuming it was the author's words, not Karpinski's. The Julia devs seem to be more interested in solving the (prototype) -> (translate to low level language) -> (optimize for production) inefficiency rather than making one language to solve every conceivable problem.
- moron4hire 13y agoMe reading the Julia documentation: "Interesting... hmm, don't quite understand that, but moving on... oh that's neat... wait, arrays are 1-indexed, not 0-indexed? ABORT!" EDIT: and I consider this to be all the proof I ever need: http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EW...
- _delirium 13y ago1-indexed arrays are pretty common in languages targeted at scientific/mathematical usage. Also the case in R, Fortran, Matlab, and Mathematica, among others.
- moron4hire 13y ago"This is the way we've always done it" is not a convincing argument.
- steveklabnik 13y ago... for or against 1 or 0 indexed arrays? ;)
- gfodor 13y agoExcept that's not the argument.
- AimHere 13y agoThe argument is more along the lines of 'the users for these systems use 1-based subscripts in their technical literature so we'll make conversion from formula-in-physics-paper to running code easier by having the corresponding data structure match the user's expectation.' 0-based arrays are easier for computer folks who occasionally have to implement the code that translates 'a[i]' into a memory access. 1-based is easier for physicists and mathematicians who were subscripting variables before there were computer implementations to worry about and had a pile of literature already written using that idiom. It's just a clash of conventions.
- 13y ago
- gfodor 13y agoThe main dynamic this article basically fails to describe clearly is that the status quo for scientific computing is that you do your nice, high level modeling in MATLAB or R, and then when you get good results, you port it over to C/C++/Java for production. It's usually a write-only process since the code you end up with in Java for example completely obfuscates the clean algorithm you designed in MATLAB. Julia's core value proposition (if I understand it correctly) is that you can build your models and algorithms in a MATLAB-like environment (with macros!) and then, lo and behold, you can actually just tune and deploy this code right where it is, without having to do a port.
- mturmon 13y agoThis is a good point. The article puts up a straw man ("one language to rule them all") when it would be just as effective to lay out the actual situation in scientific computing -- it's uncomfortably heterogeneous at the moment. Having one language that spans more of the space from the bare metal (C-like fine-grained numerical manipulation) to the top level (say, training a complex model on a large dataset in a REPL) would be very helpful.
- stmartin 13y agoYes, that language is called utopia.
- Derbasti 13y agoAlso, having Macros and a built-in C-FFI. Now give me some plotting and good Qt bindings, and I'm all set!
- thinkpad20 13y agoThere are a few plotting libraries for Julia; I'm not sure how robust they are though. http://julialang.org/downloads/ http://julialang.org/downloads/
- bch 13y agoI see that the julia page says that Julia can call out to C functions[0], but can C functions call into Julia? ie: make a program "myprog" like: cc -o myprog myprog.c -ljulia and be able to call julia_domath()? edit: reference to julia documentation [0] http://docs.julialang.org/en/latest/manual/calling-c-and-fortran-code/ http://docs.julialang.org/en/latest/manual/calling-c-and-for...
- bradenb 13y agoWorking for a small company that does a lot of parallel combustion CFD modeling and simulation, I'd love to see our engineers try out Julia and see how it much easier it could be on them. But, from my experience trying to establish rules for using version control, I also realize that they're unlikely to ever rewrite (or even modularlize) their codebase to take advantage of any other language.
- aldanor 13y ago1) "Ruby and Python are good general purpose languages, beloved by web developers because they make coding faster and easier. But they don’t run as quickly as languages like C and Java." --- sorry to spoil the party but NumPy is quite a bit faster than Julia in real-world applications. Something as trivial as summing elements of an array runs much slower in Julia (unless they fixed it, last I checked was about 4 months ago). I'm not even gonna get started on pypy / llvmpy / numba / cython. R, albeit being a horrendous language, can be hardly beaten by anything at the moment due to its epic plotting tools like ggplot2 and the sheer amount of statistical packages created by scientists from all over the world; it's like github for many of the stats guys. Except unlike github, most of the packages are not open-source and hence can't be directly ported to python/julia/whatever.. 2) Lack of existing infrastructure for scientists and general purpose stuff like various SQL adapters and bindings. Take any data-oriented/scientific field, there's gonna be a python library or a c++ library with python bindings for it. Data munging? pandas. Plotting? matplotlib. Machine learning? scikit-learn. MC Monte-Carlo? PyMC or PySTAN. Optimization? scipy. That's just to name a few... those are all huge libraries with many thousands commits in their repos and many thousands human hours behind them -- it will be pretty hard for anyone to catch up fast. /* it's worth mentioning here though that many libraries in scientific Python stack were developed by aggravated R / Matlab users who loved the tools but hated the language => matplotlib/pyplot was initially a direct port of Matlab's plotting tools, pandas was initially a direct port of R's data.frame, etc / 3) 1-based indexing. Seriously, wtf? / insert an arbitrary Dijkstra joke here */ Not trying to bash Julia deliberately but I'd say by publishing a fluff piece like this Wired in fact discredits the Julia community who are nice and enthusiastic folks.
- simonster 13y ago1) is probably still true at the moment as long as you really need that large array, but the performance gap is likely to disappear once we have better garbage collection and SIMD support, which are both open pull requests. On the other hand, if your algorithm can be expressed in a loop that touches less memory, in my experience, devectorized code in Julia beats vectorized code in NumPy or MATLAB, and absolutely destroys devectorized code in those languages. This is vitally important in my work, since the data sets I work with are so large that expressing the algorithm in terms of vector operations would require more memory than my computer actually has (and it has 64 GB of memory). Numba and especially cython are bolted on hacks to deal with the poor performance of the interpreter. They are not conducive to the kind of modularity you can get with Julia or plain Python, and they have their own set of rules for achieving high performance. Their main upside is that, as you say below, people already have a lot of Python code, but if you were starting from scratch you would probably not design them into the language. NumPyPy still doesn't implement all of NumPy, although I think it's been under development for roughly as long as Julia. 2) would be a problem for any new language, but it is partially mitigated by the PyCall package, which makes it easy to call almost any Python code from Julia. There are even Julia wrappers on top of pandas and matplotlib that allow you to use them while following standard Julia programming conventions. I've played around with calling PySTAN from Julia, and it's not substantially harder than calling PySTAN from Python.
- StefanKarpinski 13y agoI'm dismayed that this article portrays Julia so much as my creation and downplays the roles of Jeff and Viral – if anyone deserves the lion's share of the credit for the language, it's Jeff. I'm guessing this happened because I had a publication-quality photo available for use and told a relatable narrative in the interview we did, whereas Jeff stuck somewhat more to technical matters. Oh, and Julia 1.0 hasn't been released yet. We're currently working on 0.3, which should be out in about a month.
- pygy_ 13y agoYou are bold and confident (on the internet, at least), qualities often associated with leadership, which can give the impression that you are the one in charge.
- StefanKarpinski 13y ago> You are bold and confident That is what it said in the fortune cookie I got the other day.
- stmartin 13y agoMine said: "That was not chicken"
- pygy_ 13y agoA broken clock gives the right time twice a day :-)
- yaddayadda 13y agoSo how often does a broken cookie give the right fortune?
- saraid216 13y agoAnytime you feel like it.
- joesmo 13y agoThe article contradicts itself resulting in nothing more than a silly, uninformed rant. If: "Together they fashioned a general purpose programming language that was also suited to advanced mathematics and statistics and could run at speeds rivaling C, the granddaddy of the programming world." Then: "That said, it isn’t for everyone. Bezanson says it’s not exactly ideal for building desktop applications or operating systems, and though you can use it for web programming, it’s better suited to technical computing." does not follow based on the definition of "general purpose."
- ryangripp 13y agohttp://xkcd.com/927/ http://xkcd.com/927/
- vezzy-fnord 13y agoMore clickbait and erroneous reporting from Wired. Typically, I stay away from most of their articles, besides the Threat Level column, which actually hosts engaging pieces of journalism.
- leobelle 13y agoIs it easy to create non-blocking TLS socket connections with Julia? How about making an HTTPS request? If Julia has async operations, are they inline, promises, events or callbacks?
- KenoFischer 13y agoYes, actually, this is quite easy. Basically the I/O model uses cooperative coroutines. For TLS, you'll want to look at https://github.com/loladiro/GnuTLS.jl https://github.com/loladiro/GnuTLS.jl. Then, after setting up the stream with the underlying socket, protocol information, etc. (see the README for how to specify this), you can just use it as any other IO stream... # Set up stream `sock` here @async begin println(sock,"Hello World") line = readline(sock) println(sock,"You typed ",line) end Basically the encryption happens on the fly and the stream can be used just like any other socket. For example, in the http client code here: https://github.com/loladiro/Requests.jl/blob/master/src/Requests.jl#L197-L204 https://github.com/loladiro/Requests.jl/blob/master/src/Requ..., the only difference between HTTP and HTTPS is how the socket is set up, the actual reading and writing is the same. Hope that helps!
- cabinpark 13y agoI keep seeing Julia promoted as the grand new language but honestly, I am incredibly sceptical. Working in the scientific programming community, I am keenly aware at how slow things move. In only the last few years have I seen a push towards even using Python as a viable scientific tool. The problem is that science moves slow and, for the most part, scientists aren't interested in the programming aspect too much, but getting the results. They have one system that works and they stick with it. One problem, that I don't see mentioned, is that verification of correctness. There is a reason people use decades old packages and code: they know that the tool is reliable and correct. My supervisor's code is based off his supervisor's code, which has been around since the 80s. At least 50+ papers have been published based off this specific code so we know that it is correct. The amount of time it would take to re-write and test the code written in a new language would be a very large times-sync that no one wants to do because they could spend that time doing research. I think this is part of the reason why things change slowly in the scientific computing community as whole. There have been tens of thousands of papers published that use Fortran/C/C++/Matlab and this new kid Julia comes along and how many scientific papers have been published using Julia code? I would imagine barely even a fraction. To scientists, this is reason to be sceptical. I'm not saying I agree with this but it is how scientific computing does think. Also, on a personal note, the marketing needs to change. Since of the creators is reading this, if you want get the scientists, drop the grandiose claims of "one language to rule them all", although that's probably not your fault. To me, I immediately smell bullshit a mile away when I hear that. Too many times in the history of scientific programming languages have people made similar types of claims only to see it crash and burn. This is why many the older folks won't bother. Reading Julia's homepage, I would be unconvinced about why I should choose Julia over Matlab. Heck, why not use Python? Python is open source and has been around a lot longer and people have certainly of that. Also your speed tests, well fix them. For example Matlab vs Julia. Calculating the Fibonacci numbers? Honestly who cares. Plus why are you even computing them recursively, that's a silly way to do it. I understand it demonstrates recursion, but it's a pretty useless thing in my opinion. I only ever see the Fibonacci numbers come up in programming contest problems. I can honestly say I've never seen them used in real applications that scientists do. And if they were you would never implement them this way. Also the implementation of quicksort, why did you write your own? Use the built-in one for a more fair comparison. No one writes their own sorting algorithm but uses the built-in languages ones. Do that here. It is disingenuous to Matlab to not use the built-in functions. The real tests that I would care about would be the random matrix multiplication. That's something that is way more common than calculating Fibonacci numbers. And here Julia is a little faster than Matlab but not too much. I'd be sceptical of why I should switch. Similarly a single number tells me nothing. Just because it says Julia is faster, well that's one test. How well does Julia scale? Is it true that Julia is faster than Matlab for multiplying NxN random matrices? How well does this scale? A single test tells me nothing. I'm obviously bias towards matrix tests since my research used a lot of matrix operations, but if you read papers about various codes they almost always include scale tests. This is what my colleagues would care about more than anything since they have massive datasets so scalability is critical. Remember you are trying to sell this to scientists who are, obviously, scientists, so having good quality data to show them is critical. I discussed Julia with my colleagues and this was one of the things we immediately mentioned. The tests shown didn't convince us at all that it was even worth considering. Plus, I'll be honest, I feel the homepage is marketed more towards computer scientists than numerical scientists. The first feature is "Multiple dispatch: providing ability to define function behavior across many combinations of argument types". The hell is that? Why do I care? Remember who your audience is! To give you an example, I will tell you about my office mate. He is a PhD student working on turbulence and uses Matlab for all his data processing afterwards. His code comes from simulations written in Fortran that run on the local supercomputing cluster. They are stored in the NetCDF format. After the simulations are done, he opens up Matlab, reads in the NetCDF file and runs a bunch of data-processing functions to compute various quantities from the raw data. He then plots these things. On the Julia homepage I don't even know if Julia can even do graphics. Can it? If it can, the homepage doesn't mention any plotting libraries. So, I repeat, what exactly does multiple dispatch mean and why is it so important? If you want him to be using Julia, then you need to explain to him why he should be using it over Matlab. Look at the numpy homepage. It is short and to the point. Plus it has a nice link to "NumPy for Matlab users" which is something I would want to know immediately. Julia, as far as I can tell, you have to go to docs, Julia manual, Noteworthy differences from other languages (which is at the bottom of the screen!!). I could probably come up with more criticisms and suggestions but I don't want to write a book. I should say, I completely and fully support what Julia is trying to achieve. I find that Python is just too awkward to be a good Matlab replacement. To me, Python is a very general tool that also has the ability to do similar things to Matlab. However since Matlab is designed to do numerical computing, and Python isn't, I find Python to be awkward for some things. But, at least it can run on the computing clusters. Matlab is stupid with licensing and trying to get it to run on the supercomputing clusters is near impossible. Definitely in the future I am going to try Julia as a data-processing step since it is free and open-source and not subject to any of that licensing crap. Plus the parallel aspect interests me although I have no idea how good it is since I don't see any graphs showing what sorts of advantages I might get. Plus the documentation page is rather dense text-wise and not that appealing to read right now. But, I think the tl;dr is that remember who you are marketing to. Remember that scientific computing moves slow. I know colleagues who have just discovered version control and think it's amazing.
- sriram_sun 13y agoFTA: "Julia is also designed parallelism." Did the author even proofread the article?
- Fixnum 13y agoJulia seems nice, but the fact that the developers don't care about TCO is annoying and vaguely reminiscent of Python. If this were added, not only would many algorithms become more natural to express, but it'd go to the top of my list as a recommended first language (instead of Scheme or Lua).
- ctdonath 13y agoWay back in the heyday of Byte magazine, I recall ads for the pending release of The Last One, a programming language to end all programming languages. Once released, it disappeared. (Anyone remember it?)
- dzink 13y agoI got to play with Julia at the UChicago workshop. Good stuff, especially if you want to move away from MATLAB.
- taylodl 13y agoThe one programming language to rule them all that isn't for everyone. I had to laugh at the irony of the juxtaposition of the title and the final sentiment! I like languages so I'll definitely be checking out Julia.
- malisper 13y agoI'm guessing the best predictor of whether Julia will be the "one language to rule them all", is the difficulty of writing macros in it. If they somehow figured out a way to make writing lisp-like macros in a language with infix notation easy, Julia will easily become the next big thing. Otherwise I would have to say that the trade offs between syntax and macros would make lisp a better choice (see pg's argument for lisp macros[1]). For someone who has used both Julia and lisp macros, how do they compare? [1] http://www.paulgraham.com/avg.html http://www.paulgraham.com/avg.html