279 points · by sandGorgon · 9y ago · 130 comments
...here it seem like any other modern language, until you see that Julia has something that many other languages lack: true macros (true metaprogramming.) A big feature. And multiple dispatch on all functions! (a very nice feature that puts it above many other languages in use.)
You can even program Julia in s-expressions if you feel like it. (Some argue that Julia should be considered a Lisp dialect.)
Compared to the other languages with Python-like, C-like or Algol-like syntax, Julia stands out from them as a more powerful alternative. (If you need more power and flexibility than Julia with good processing speed, i think only Common Lisp will clearly provide it.)
A very recommendable language, especially now with this initiative for giving more "enterprise-like" support, and worth looking in depth, if you are also considering moving to Go and Rust.
Julia is focused on taking the best of R, Python/Numpy, and Matlab. It is a _great_ language. But as far as I can see it's really focused on a different problem space.
Additonally, the very good support for threading and multiprocessing means it has a good future with services, async IO, and with event-loop web servers (a la node.js and friends).
Finally, the focus on fast speed for numerical computation is particularly suited to games (as is the support for threading).
Scientific Computing is a realistic goal just like Golang is a realistic language with Enterprise adoption. It may not be the most elegant language like Lisp but it is practical. (People don't want the perfect solution but one that works most of the time) (P.S I am vaguely quoting this from some anecdote about a discussion on Lisp and C)
This all seems extremely unlikely (compared to e.g. widespread success in scientific computing, which is still far from assured). Good luck though.
Word on the street is that Julia is supposed to get a 1.0 announcement at JuliaCon, which started today.
Your description of it makes it very intriguing and makes me want to revisit it.
For scientific users used to R or Python, the performance should knock their socks off. (But users doing their work in C, C++ or Fortran will probably see little or no improvement).
Common Lisp is terrible for numerical computing, and the type system is really quite weak IMO.
But good enough for doing numerical computing for the NASA and for Raytheon.
The NASA used it for complete command of the Deep Space 1 spacecraft. "The Remote Agent" wasn't just entirely written in Common Lisp, it also won the NASA's Software of the Year Award...
https://ti.arc.nasa.gov/tech/asr/planning-and-scheduling/rem...
"It's one small step in the history of space flight.
But it was one giant leap for computer-kind, with a state of
the art artificial intelligence system being given primary
command of a spacecraft. Known as Remote Agent,
the software operated NASA's Deep Space 1 spacecraft
and its futuristic ion engine "
... and i don't think they did it without heavy numerical computation.Want another application? Analyzing HDTV video images of the Discovery launch in real-time. Again, NASA.
Another one? Mind you, i'm only citing examples where numerical computation is heavily involved...
How about simulation of missile defense systems at Raytheon?
http://www.lispworks.com/success-stories/raytheon-siglab.htm...
"SigLab simulates an incoming warhead intercepted
by the Exo-atmospheric Kill Vehicle (...)
The system is capable of solving any computable system
of difference equations. "
Another one? "the new version of the complete Piano aircraft analysis tool,
used by several major aircraft and engine manufacturers worldwide."
http://piano.aero/As for the "type system being weak", the comment puzzles me, considering that Common Lisp has one of the best (if not the best) OOP system, CLOS. There is an automatic correspondence between objects and types in CLOS so I can argue it has one of the best type systems out there.
It is. I know of the examples you mention (and some of them like planning may not really involve much numerical work) but the fact is that unless you're doing things by scratch (like starting from GEMM), numerical libraries are often badly documented, slow or otherwise incomplete (or a mixture thereof). You can disagree with me, but Tamas Papp who maintained a bunch CL libraries seems to have moved over to Julia entirely.
> As for the "type system being weak",
I meant weak in the sense that it's not very expressive, so as to allow better static type inference. I'm not saying CL should be static for "correctness" reasons, but for removing the user from having to have declarations all over the place.
Let's reify. If I were to create a bunch of matrix classes (matrix-float, matrix-double, ignoring the lack of sugar), CL provides no way to declare a generic method 'mref' to be intelligent enough to know what the output will be, given the input type. Even getting the type in the compiler-macro is implementation dependent. In C++ this is extremely easy with templates, and in Haskell you do it via a type declaration (AFAIK).
Yes, you can get around it via lots of macro magic, but this is so fundamental that you might as well create a new language (like Qi/Shen).
> There is an automatic correspondence between objects and types
is almost never what is meant by a "strong type system" -- it more commonly means that types are checked at compile time, rather than run time. I don't doubt that any given lisp hacker could slap together a type inference system on top of CLOS, but as far as I can tell it's not built in.
So, on the strong-to-weak type system spectrum, I would say:
* Idris (lawful good, first-class dependent types)
* Haskell (very strong, some support for dependent types)
* Java (strong, some generics)
* Julia (hybrid, code is analyzed for type inference during JIT, invariant types)
* Common Lisp (weak by default, afaict)
* Python (very weak)
* Javascript (weakest)
* PHP5, Perl (chaotic evil)
Digging a bit deeper, it appears they use it to deliver specifications and example code to vendors?
"[T]ransferring the specifications to industry using this legacy system required three different types of documentation: first, the specifications were written both in variable-based pseudocode and in English descriptive pseudocode. But this approach left gaps in interpretation, leading to possible confusion or disagreement. So programmers also created state charts to fill these gaps and eliminate the potential for misinterpretation."
Slides here: http://juliacon.org/2015/images/juliacon2015_moss_v3.pdf
That being said, I applaud getting good funding for a project that's actually more than beyond MVP, it has happy users/customers and it serves a purpose. That's not all that common these days. Good luck, guys.
It is mature (30+ years in use, rock solid ANSI standard), many compilers available for many plataforms, highly portable code, multiple dispatch (CLOS is arguably the most powerful object oriented system available), you can also very easily call C libraries with CFFI and there is portable support for threading...
...and well written CL code will approach Fortran and C in speed, at least with SBCL which is a free, popular compiler.
You can also compile to the JVM and to the LLVM, and if you need pro support for it, there is LispWorks and Franz Inc. Ah, and with ABCL you can also easily call java libraries, if you need to.
The use case you imply is different, it is more like a scientist working alone at a workstation for interactive calculations, in which case perhaps Python with Numpy and Scipy is just perfect.
In any case, for the previous use case (complex, big system), i'd use CL for the calculations themselves, for the visualizations I could do interactive web graphics using the extremely nice Bokeh library for Python. I'd use Bokeh under Python (using Flask as a web framework) for the presentation layer, and the Lisp system for the actual calculations.
BTW, CL does have many libraries for plotting: http://cliki.net/plotting
> Are the built-in linear algebra, optimization...etc libraries good, or must I toil with FFI?
You can use the GNU Scientific Library also within Lisp, to do everything you mention and more:
https://www.gnu.org/software/gsl/
https://common-lisp.net/project/gsll/
> Yes it can reach near C/Fortran speeds, but how much time will I spend optimizing it?
I guess you are aware that for maximizing speed in C you need to be very careful on how you write your code. In this sense there is no easy way out in any language. The good part is that Lisp, unlike C, is garbage collected, so working on a piece of code can be easier since there is no need to deal with pointers, allocation, and deallocation. It also supports arbitrary number precision and fractions and complex numbers out of the box, no need to do anything in particular to optimize their performance nor rely on external libs to operate on them. It is particularly good (speedwise) with big integers and arbitrary precision numbers.
As for Common Lisp itself, besides that observation -which applies to all languages-, you need to add type declarations. This improves the performance a lot. You are going to add type declarations on a statically typed language (C, C++, Julia, Java, etc) anyways, so i fail to see how this could take more time than in other languages.
It's easier to argue to use Julia now since the New York fed uses it for their full scale model of the US economy
Do you think Python and Go are more suited to that domain than R or Julia?
R syntax is very unlike most programming languages so jumping to other languages can feel strange.
Python with Numpy, SciPy and Pandas, is the current widespread alternative to R and a good starting point. Recommended!!
† https://github.com/kostya/benchmarks, http://blog.seraum.com/crystal-lang-vs-nodejs-vs-golang-vs-j...
I do wonder though: have Julia been able to raise this much money thanks to awesome traction or the reputation of the team?
We are self-funded and have been profitable from day one. [2]
[1] https://www.crunchbase.com/organization/julia-computing#/ent...
[2] https://venturebeat.com/2015/05/18/why-the-creators-of-the-j...
- JuliaPro is the go-to product for anyone who wants to use Julia – professionals, engineers, software developers and data scientists. Beginners and experts can build better software quicker and dramatically improve performance.
- JuliaRun is for scalable deployment of Julia in production for real time analytics and large-scale parallel simulations in the public cloud or a private cluster.
- JuliaBox lets data scientists, quants and strats run Julia in Jupyter notebooks right in the browser. JuliaBox is the number one choice for universities teaching Julia since students can get started with Julia in seconds with no installation required.
- JuliaFin is a suite of Julia packages that simplify the workflow for quantitative finance, reducing the gap between the quant and the trader. JuliaFin provides the fastest path from market data to market transactions by leveraging the full power of Julia for implementing new trading strategies where time is of the essence.
EDIT: Oh, and consulting/training:
JuliaPro is basically VisualStudio Express vs. Pro (e.g. there's a free version and then an expensive version with better integrations, better enterprise level tools, etc).
JuliaRun is basically a cloud service (e.g. charge for hosting) designed for julia code.
JuliaBox seems to be a cloud IDE / google docs / notebook style product. Probably with a similar model to github eventually (e.g. pay for teams / commercial use, etc).
JuliaFin seems to be a way to charge banks a lot more money for the same stuff.
- JuliaRun is for easily scalable deployment of code, either for cloud or local servers.
- JuliaBox is as you say, available here https://juliabox.com/
- JuliaFin is completely separate, and currently consists of Bloomberg integration and the Miletus contract specification and pricing package.
(I work for Julia Computing)
So, not more money for the same stuff, but more money for a lot more other stuff. Some of these components are proprietary, but many are open source.
Or, as we used to call it, just "software". They're selling software.
I don't understand. Julia is not stable at all yet. Who would want to teach it now? What would be the point?
I'm sure the main draw will be companies that don't want to be stuck with a GPL license in their product.
From the website:
The core of the Julia implementation is licensed under the MIT license. Various libraries used by the Julia environment include their own licenses such as the GPL, LGPL, and BSD (therefore the environment, which consists of the language, user interfaces, and libraries, is under the GPL).
$1500 per year
You can't support 100 people strong developer collective on proceeds from licensing of such product at all, given how small that commercial "data science" market is.
Julia is the fastest modern high performance open source computing language for data, analytics, algorithmic trading, machine learning and artificial intelligence.
I think Julia should be very nice in server-side development.
Seed round 2016 average is around $1m per Crunchbase:
https://techcrunch.com/2016/09/07/crunchbase-sees-rise-in-av...
Cooley has seed round pre-moneys at $4-6m. (Thus, a $5m check is pretty much out of question at that stage.)
https://www.cooleygo.com/trends/
So, this is much more like a Series A? I wonder if they were advised to call it seed funding to leave open the possibility of a "big" Series A, due to the level of interest. It does seem like SV VCs are making somewhat large bets on F/OSS-based companies, so maybe that is wise.
I also realize a lot of this is semantics.
It's not uncommon for an institutional seed round to be $2-3MM on a valuation of $6-15MM in Boston right now. The size of rounds is partially a function of how frothy the OSS tools market has gotten. I'm looking at another hybrid enterprise/OSS deal that has a valuation north of $15MM.
A rounds nowadays look for $!MM ARR so you can say the letters shifted as well :)
My overall assessment is that yes, it's definitely worth getting your feet wet with. It has all the advantages of R or Python (for numerics, a point I will return to), but with much, much better performance. I feel like the syntax is also cleaner than either, although it has more of an advantage over R than Python in that area (I like Python's syntax more than R's).
I had an experience of some prototype R code running for about a day without finishing. The same code in Julia finished in about 5 minutes. It was kind of the final straw that convinced me to gradually move.
Since that time, though, there's one issue that's kind of nagged me, and has only grown over time, which is that Julia is kind of a niche language, like R. It's a big niche, and it might not matter, but over time I've come to appreciate the fact that Python is more general purpose. I am also watching as things like Kotlin, Scala, and Nim gain in popularity and in resources. I suspect that Julia will expand over time, but those others have a head start in some ways (even if they are behind in other ways).
Like some others, I also had some experience of head-scratching changes that occurred with new API-breaking releases. They were subtle changes that were difficult to catch because they weren't deprecations or things that caused errors, but changes in how valid syntax is interpreted. I don't see that as a long-term problem, but it gave me pause.
I guess the TLDR is: if you're interested, I recommend you dip your toes in it, if that works for you, but with some caution. I see it more as a replacement for R long-term than Python, and I see serious competitors rising in popularity.
If it's still around in 10 years then it might be worth looking at (but still probably not).
This is true, sort of. It was also true when people said the same about Perl (some people still say this about Perl!). Then Rails happened to Ruby, just as the web was going through another phase of explosive growth. Likewise, Node or Rust + GitHub effect.
The point is not to compare the growth trajectories or projected peaks, but to emphasize the levering effect of an enjoyable language combined with modern collaborative development and infrastructure. A language doesn't need "everyone" to build a viable ecosystem, just a critical mass.
> If it's still around in 10 years then it might be worth looking at (but still probably not).
Knock on wood and all, but from past observation, I think Julia is at or very close to this critical mass already. I would compare Julia now to the SciPy ecosystem around 2009-2010. That's just when IPython was getting popular, early versions of Pandas were released, and people were starting to trust Cython. (I was a heavy Python user then, and frequently suggested it to Matlab users who had exactly your question even in to 2012-2013). There's already a surprising breadth of packages, they just need time to mature. Sometimes too many, actually -- I recently found three for a relatively obscure geophysics format I used to work with. That lever is big enough that people often don't mind rolling their own.
If it's not HPC, I don't see a benefit over Python.
Maybe Mathworks will acquire them and call it MATLAB 2020!
https://docs.julialang.org/en/stable/manual/calling-c-and-fo...
Even there you got support for C, C++, Java amung others as well as the whole IBM family (RPG/ILE, CL, REXX, ...) With somewhat decent bindings in RPG.
https://julialang.org/benchmarks/
https://www.ibm.com/developerworks/community/blogs/jfp/entry...
- 1-based indexing instead of 0-based
- end keyword vs significant whitespace blocks (and no colon to start a block)
- function instead of def (or defined inline f(x) = ...)
- x -> ... instead of lambda x : ...
- start:stop/start:step:stop instead range(start,stop)/range(start,stop,step)
- strings are joined with * instead of +
The actual internals, and features such as types and multiple dispatch can make it a very different to use, but hopefully that should be enough to get you started.
https://www.youtube.com/watch?v=gQ1y5NUD_RI&index=3&list=PLP...
http://juliacon.org/2016/workshops.html#invitation
Personally, I enjoyed reading the manual when I learned it. But I realise that it isn't for everyone.
I'd rather deal with Cython apache license than deal with this GPL stuff for commercial use.
But what makes this really asinine is that Julia isn't even GPL: https://github.com/JuliaLang/julia/blob/master/LICENSE.md
Moreover, since I've been seeing this kind of hostility towards the GPL more and more often: it should be somewhat obvious to everyone that the current ecosystem of widely available, highest-quality OSS stacks is a rather surprising development. There are certainly parallel universes where parallel computing requires you to buy the compiler from IBM, and URIs end not in .html, but in .doc.
The GPL and its advocates aren't the only ones who created this, but I'm pretty sure they were at least necessary. That includes not just the software they created, but also the force of the moral argument for software freedom they made.
Here's a performance testimonial with links to real code and benchmarks against Fortran (not Python), from Steven G. Johnson, one of the authors of FFTW:
https://discourse.julialang.org/t/julia-vs-fortran-complaint...
I implemented an erfinv function Julia (https://github.com/JuliaLang/julia/pull/29874), and it was about 3x faster than Matlab or SciPy's erfinv function, both of which are taken from standard Fortran libraries. [...] I have found similar gains (compared to Fortran code called in SciPy) for other special functions, e.g. polygamma functions (https://github.com/JuliaLang/julia/pull/71255) and exponential integrals (https://github.com/JuliaMath/SpecialFunctions.jl/issues/19).
The reason Julia can beat the Fortran code is that metaprogramming makes it easy to apply performance optimizations that are awkward in Fortran. We have metaprogramming macros (@evalpoly) that can easily inline polynomial evaluations, whereas the Fortran code makes function calls that loop over look-up tables of polynomial coefficients. Even greater speedups are possible for evaluating polynomials of complex arguments, where there is a fancy recurrence from Knuth that is almost impossible to use effectively without code generation. In principle, the Fortran authors could have done the same inlining and gotten similar performance, but the code would have been much more painful to write by hand. (They could even have written a program to generate Fortran code, but that is even more painful.)
> I'd rather deal with Cython apache license than deal with this GPL stuff for commercial use.
The Julia core is MIT licensed. The language distribution is currently GPL licensed due to linked dependencies, but there has been a no-GPL build flag available for several releases. GPL (and other) dependencies are continually being removed, and there are only one or two (GPL) libraries left in the currently nightly build.