I think what this question boils down to is this: All else being equal 
(performance, price, support), which language is ultimately nicer to 
program in?

Mathematica is a fantastic - if not the best around - DSL for symbolic 
maths. It's term-rewriting paradigm is pretty much perfectly suited what it 
does, so if you're using it for quick equation plots or to cheat on your 
calculus homework, don't hold your breath waiting for a replacement. It 
also ends up having what looks a lot like Julia's multiple dispatch on 
steroids; you can match not just on type, but also on internal structure, 
or even the unevaluated expression or the function being called itself. 
This is enormously powerful; you can implement a fully-functioning 
dictionary <https://gist.github.com/one-more-minute/8618047> type in seven 
lines of Mathematica, and it might not be fast but it's beautifully 
declarative. So, if you're looking for Julia to have some killer feature 
that makes it more powerful than Mathematica, you probably won't find one.

*But*. But. As cool as some of Mathematica's features are, *fundamentally it's 
a language designed to let non-programmers write one-liners*. And 
unfortunately, what are great design decisions in that context fall flat 
outside of it. For example, its syntax - writing S-Expressions as function 
calls is mostly great, until you have to write control flow statements and 
variable bindings as if they were function calls, which gets old fast. The 
syntax needs to either be simpler (a la Clojure) or more helpful (a la 
Julia) IMHO. Also, holding arguments, blurring the line between code and 
expressions; all great for short-term usability, but all that magic under 
the surface ends up being a lot of conceptual overhead for anything 
complex. Symbolic programming with no syntactical overhead is a great 
feature one percent of the time, but it gets in the way the other 
ninety-nine.

Some points for Julia: firstly, interop. You can import a C library and 
call it really easily; same for Python and soon Java. Also, Julia's code is 
generally easier to reason about than Mathematica's, especially for writing 
macros; there's no magic going on where you don't expect it. What's great 
about Julia is that despite this, it's still really powerful (thanks to 
multiple dispatch etc.). Also, it's more straightforward to generate and 
evaluate code in Julia, which is often useful. For these reasons, Julia 
would be my language of choice even if Mathematica was just as 
fast/free/whatever.

Last point: the language's approach to types has little to do with the 
presence/absence of a compiler. Yes, the Julia implementation is compiled, 
but this isn't about implementations, right? Both Julia and Mathematica are 
dynamically, strongly typed (not untyped - everything in Mathematica has a 
type, accessible via Head[]). Anyway, there's nothing stopping you from 
using lists and maps to represent your data, just as you would in 
Mathematica, and avoiding using types altogether. Persistent.jl and Lazy.jl 
give strong support for functional programming, so you're not going to be 
missing out. And you can get rid of code repetition / boilerplate by 
generating and evaluating code as above.

Oh, and there's no typo in that definition - Expr.typ will be dynamically 
typed, or equivalently have type Any.

Hope this helps.

Reply via email to