Hacker News new | comments | show | ask | jobs | submit login
First impressions using Julia (acooke.org)
85 points by andrewcooke 1371 days ago | hide | past | web | 26 comments | favorite

I was curious about the elseif complaint so I looked into how different languages do it. This is nowhere near a comprehensive list but elif seems to be the least popular.

  elif: sh, python
  elseif: PHP, Modula-2, Dylan, Eiffel, Oz, Matlab, Julia
  elsif: Perl, Ruby, Ada, Modula-3, Tcl, 
  else if: Awk, B, C, C#, C++, Java, JavaScript, Pike, YCP, OCaml, Delphi, Pascal

Nimrod (http://nimrod-code.org/) also uses elif

huh. thanks. i had no idea elseif was so common. so after seeing that i am pretty sure they have taken it from matlab.

“elif” also appears in the C preprocessor.

It's surprising it's less popular than elsif. I'd think you'd either go full on with shortening it (kind of surprised there's no "ef" now that I think about it), or just spell it right.

Go uses `else if` as well, but since it requires braces `{ }` for statements in the "then" or else clauses, it doesn't have the dangling else problem.

+ elseif: Lua

I have been using Julia extensively for about a year as a data analysis tool / R and Matlab replacement. I can say it is very good, especially well suited for exploring and processing large amounts of data. Often when you're trying to understand a set of data, you don't know what kinds of filters and transformations you're going to want to try. If those transformations end up not being easily vectorizable, then they will be dog slow to run in R or Matlab, and probably inconvenient and more difficult to create in C. For these situations, Julia is perfect.

Wow, I may have to try this Julia thing out. For some reason I had associated it with Lisp or the JVM.

The documentation for the graph module (data structure, not charting) suggests that Julia is not a toy language at all. The interface was inspired by the Boost Graph Library! http://julialang.org/Graphs.jl/interface.html

My impression of Julia is it's what happens when Lisp people decide Python got some things right, and vice versa.

Still hate the 1-based indexing, but oh well.

After doing little Lua I found that it was possible to mostly get used to.

That comes from targetting Matlab users...

I have just started learning Julia this past week. I do scientific research (molecular dynamics) and this language is exactly the sort of thing I've been looking for.

So far I have been using C++ for high-performance, time-critical code and Coffeescript for quick prototyping or for code where performance isn't a bottleneck (out of all the languages I know, I never got around to learning Python for some reason...).

Programming languages are a little bit of a hobby of mine, so I've messed around in Haskell, Lisp, and Clojure. I really like the design of Clojure, particularly all of the concurrency features, but I don't think it has the speed or the libraries for scientific work.

Julia is the first "scientific" language I've seen that actually seems well-designed instead of ad-hoc (i.e., someone with graduate work in CS was actually involved in its creation). The fact that the authors know what a legit type system is already becomes an upgrade to anything Fortran or C++ could offer. I never thought the OO paradigm (subtype polymorphism) in Java or C++ worked well at all for scientific work. Maybe some people found it useful, but I always thought it was forced.

Aspects of Julia I really like:

* Libraries - The ones that are in Julia so far are fast (and use well-known numerical libraries like FFTW and BLAS) and easy to use. They're geared toward scientific work, so this is perfect for my research.

* Syntax - I like the brevity. I don't necessarily like that blocks must be terminated with "end" but that's just a personal thing.

* Speed - Wow. I'm still amazed this is as fast as it is since it feels so much like an interpreted language. All that work with the LLVM is paying off. I almost wonder if in the long run this could be faster than C since you can provide information about the program to itself while its running for on-the-fly optimizations.

* Homoiconicity - I can't say that I've actually had a legit use for this yet, but I'm glad that it's there for some reason. I wouldn't say the language is 100% homoiconic (to the extent of Lisp), but it's pretty close.

My main concerns with Julia at the moment are:

* Will it continue development? I'd hate to write a whole suite of software in a new language that no one else will use because the language goes obsolete.

* What's with this weird confusion with tuples and arrays? It seems like there's some situations where these things have overlapping purposes.

* Documentation can be slightly confusing. Sometimes it's hard to tell exactly what a function does or what its arguments are supposed to be (without going into the REPL and using "methods"). Example function calls would go a very long way toward helping here.

Will it continue development? I'd hate to write a whole suite of software in a new language that no one else will use because the language goes obsolete.

My sense is that this is a labor of love as well as necessity, and the folks behind Julia are in it for the long-haul. This is also not their first rodeo: several core folks were involved with StarP from Interactive Super Computing.

The highly-active community is probably (at very least) 60-strong and growing quickly (based on 10+ core commits, or active package contributions). Many more people who have made contributions or pinged the list keep coming back intermittently, and I think it is safe to assume that semi-active/patiently-awaiting-something users number in the low hundreds (based on thousands of downloads).

What's with this weird confusion with tuples and arrays? It seems like there's some situations where these things have overlapping purposes.

Tuples have been sort of ugly stepchildren, but there is a pending pull request to be merged after 0.2 release which will give tuples a massive upgrade (performance boosts and use as SIMD vectors, among other things).

It's nice that the final code looks clean and very readable. I would suggest you to give Nimrod (http://nimrod-code.org/) a try too.

Has anyone tried a large-ish application? What's the startup time like?

I'm a little concerned because it seems to be doing a fully optimizing recompile on every invocation.

I think Julia is the largest application of itself at the moment - the majority of functionality is written in the language itself. The time-to-repl is 2-4s depending on your os and setup. Taking package loading time in to account, it can be an issue, but there is a plan (and code) to address this soon.

Is the 2-4s for non-REPL ordinary scripts too?

Yes. There is a patch which provides static compilation support for the system image and should eliminate the startup time. However, the changes from 0.1 have been enormous already, so this will not be merged until 0.2 is tagged.


it's a JIT, so it's progressive compilation in some sense. BUT i certainly noticed that it seemed slower than python when starting a program. not java slow, but not instant.

I've been spoiled by the IPython Notebook. Once Julia has an equivalent/full support of the IPyNB and a Pandas equivalent, I'm all in on Julia.

Not sure if you know about IJulia [0]--they've been working a lot with the IPython folks. I haven't tried it, but it looks promising.

[0] https://github.com/JuliaLang/IJulia.jl

As mentioned by the others posts, Julia-IPython ("IJulia") support is available. While this is very new, the fundamentals are solid enough that several people are planning to use it for courses this fall.

With regard to Pandas, there is a very nice and rapidly-maturing data frames package: https://github.com/JuliaStats/DataFrames.jl

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact