Julia 0.2 released
github.com
github.com
its big idea is multiple dispatch, like clos (oo-lisp) multimethods. where you would define an "underscores" method in python (ie to extend the language for a new class), in julia you define appropriate functions for that type - the cute thing being that the new type doesn't have to be the first parameter.
so, for example, the equivalent of
class Foo:
def __repr__(self):
...
would be function show(io, f::Foo)
...
end
and the end result is something that has more of a FP flavor than python. it's very appealing.if you're looking for a "dynamic scripting" language that takes some of the good bits from static typing, and has decent performance, it's worth a try.
https://en.wikipedia.org/wiki/Julia_(programming_language)#L...
It also compares with Dylan and Fortress, which are the other major non-research multiple dispatch languages. The unique combination of features that Julia has is
1. a fully dynamic type system (code with type annotations is still dynamically typed)
2. functions are all generic by default, including all the built-ins and operators
3. support for parametric types that you can dispatch on.
This combination of features working smoothly together turns out to be very powerful, especially when designed so that you don't have to talk about types except when you want to.
What about R with S4 classes?
Due to not being a deep language feature, S4 lacks some crucial abilities. It doesn't support any sort of type hierarchy besides the special "ANY" class. Without the ability to define a type hierarchy and program to abstract types, most of the power of multiple dispatch evaporates. Even though it is technically an implementation detail, I've found that performance is a critical feature for multiple dispatch to really come into its own. R's S4 dispatch has been described as "slower than S3" [1] – and S3 dispatch is not exactly fast. Unless really basic things like + and array indexing can be generic and usably fast, you're not really cooking with gas.
[1] http://www.r-project.org/conferences/useR-2004/Keynotes/Leis...
> We will be supporting a 0.2 line of releases that maintains compatibility with 0.2 with minimally invasive bug fixes, so this is a good time to switch to 0.2 for production systems.
This release was a fairly long time coming from the previous 0.1 stable release. If you've been considering trying Julia out but were worried that it was moving too fast (it's been moving pretty fast), this is a good time to try it out. Not only will the 0.2 release line be supported with minimally invasive bugfixes, but also the 0.3 release is going to largely consist of performance improvements.
[1] https://groups.google.com/forum/#!topic/julia-users/-lh_g9eH...
We have pure-Julia implementations of standard unconstrained methods [1] as well as a domain-specific modeling language [2] for (integer) linear programming with links to open-source and commercial solvers. Julia's performance and advanced language features such as metaprogramming really make it a great language for optimization [3].
[1] https://github.com/JuliaOpt/Optim.jl
https://docs.google.com/presentation/d/1FlHt245YxPXFwOHmxLYW...
The code to call R is a bit ugly, but it looks straightforward to learn.
Edit: And perhaps some special treatment by the compiler for optimization. I find multi-d arrays counter-intuitive and clumsy on some situations. Also, currently I'm forced to write ugly code like array[x,y][i].
Of course, sometimes you do want an array of arrays, such as when each array needs to have a different length or element type – which you can of course do. Which is why I'm a bit confused about how having support for multidimensional arrays is a problem. If you find them confusing, why not just ignore the feature and use arrays of arrays all the time?
I'm also not clear on what "special treatment by the compiler" means.
The standard lib and 3rd party libs use multi-d arrays, so I can't avoid them. But I guess it takes some time to get used to.
> I'm also not clear on what "special treatment by the compiler" means.
I meant something like saving an array of arrays into a continuous memory block and somehow enforcing that the sub-arrays must have equal length. But now I realize that this is probably impossible...
If you have this code:
int a[10][10];
then: &a[x][y] == ((char *)a + x * sizeof(a[0]) + y * sizeof(a[0][0]))
where sizeof(a[0]) is == sizeof(int) * 10.quick edit: added a (char *) cast so the arithmetic doesn't multiply by sizeof(int) again
That said, I look forward to a future where Julia will take over many use cases that are served by Matlab right now.
http://julialang.org/downloads/
With the IPython Notebook and Julia, you can use Gadfly to produce plots right in the notebook without any further installation.
There is also a great interface to Python, giving you access to the wide range of its libraries.
InfoWold: Why the name, Julia?
Karpinski: That's everybody's favorite question. There's no good reason, really. It just seemed like a pretty name.
http://www.infoworld.com/d/application-development/new-julia...