5 ms·
Julia looks a bit like Lua.
by klrr 14y ago
Julia looks a bit like Lua.
- StefanKarpinski 14y agoThere are superficial similarities. The main things that make Julia different than other dynamic languages are: 1. The expressive, sophisticated type system 2. Using multiple dispatch as its core paradigm 3. Extreme interoperability with C libraries 4. C-like performance Of course, LuaJIT gets great performance too, so that's actually rather similar to Lua. Lua also isn't nearly as naturally suited to scientific programming.
- BruceM 14y agoThose 4 bullet points all sound a lot like Dylan (http://opendylan.org/ http://opendylan.org/). I'd have said Common Lisp as well, but some might argue point #1 with respect to that. It is nice to see others (re-)discovering the joy of full on multiple dispatch though!
- pjmlp 14y agoReading the new Dylan documentation makes me wonder how if would have turned out if Apple invested more strongly in the language. An expressive dynamic language with repl and native code compilers. quite nice. The one thing so far that I don't like is <> around identifiers.
- sixbrx 14y agoI've been using Julia for my thesis research lately, and I find multiple dispatch to be a great match for writing mathematical algorithms, especially because of the ad-hoc specialization that it allows based on all parameter types. OO approaches always seemed weird for this sort of thing, where you'd have to decide which type "owns" the ability of how to work with the other types. What I wish for: - faster lambdas and which capture numbers as values not as addresses. I left Python over the latter, it caught me up all the time. At least Julia developers don't consider it a feature and plan to fix it. - to be able to specify function domain and range types, for documentation and sanity checking - maybe some improvements in comprehensions would be nice, so I could have an Array of Arrays of something e.g.. Currently the [x for...] comprehensions tend to collapse things together while the {x for ...} comprehensions tend to lose the types of what's inside. Overall a great language already and a positive experience.
- muuh-gnu 14y ago> I find multiple dispatch to be a great match for writing mathematical algorithms, especially because of the ad-hoc specialization that it allows based on all parameter types. OO approaches always seemed weird This _is_ an OO approach, just not the common Java-type OO approach. Common Lisp's Object System (CLOS) has had multiple dispatch for decades. * http://en.wikipedia.org/wiki/Multiple_dispatch http://en.wikipedia.org/wiki/Multiple_dispatch
- sixbrx 14y agoOK I should have used "mainstream OO". But I've always thought CLOS's approach was so far above mainstream OO that it deserves a different name.
- ViralBShah 14y agoMultiple dispatch turns out to be truly awesome for mathematical code. In my opinion, the focus and careful selection of features for technical computing, while being a general purpose programming language is what differentiates julia from other dynamic languages.
- BruceM 14y agoThis is what I'm curious about ... what is an example of one of these carefully selected features for technical computing at the language level that is distinct from the other (dynamic) languages? Clearly, a lot of work has gone into the library side of things, but I'm curious what is special about the language level for technical computing.
- StefanKarpinski 14y agoThe type system is actually one of the key features for this. Systems like NumPy are essentially a way of grafting a type system onto Python arrays. Julia's design allows Array to be be a completely generic parametric type, but when specialized as Array{Float64} or Array{Int64} it is memory-compatible with C, Fortran and NumPy. As a result, Arrays can be shared between Julia, C, Fortran and NumPy without any data copying. Another feature that's very useful for technical computing is the ability to easily create user-defined numeric types with storage and performance that's just as good as Julia's built in types (which are actually also just defined in Julia). They can also easily be made to interact completely transparently with other numeric types. A very simple example can be found here: https://github.com/JuliaLang/julia/blob/master/examples/modint.jl https://github.com/JuliaLang/julia/blob/master/examples/modi... These 13 lines of code define a modular integer type that has the same storage and speed as regular integers, but with modular behavior, and interoperates with normal integers (i.e. `1 + ModInt{11}(1234)` works). Because of generic programming, you get matrices of ModInts for free, again with performance like plain old integers but different behavior. The same applies to defining new representations of things like matrices or dicts.
- ViralBShah 14y ago