type Expr head::Symbol args::Array{Any,1} typ end
Thank you.
> The biggest advantage of Julia over Mathematica is that Julia tries
> to make its semantics obvious enough that you can reason about performance.
I believe this to be the matter of particular implementation, not related to the core language. Mathematica is closed, so users mainly can't reason about performance merely because they can't investigate the source code. So, from the following point…
> The biggest advantage of Julia over Mathematica is that Julia tries to make its semantics obvious enough that you can reason about performance.
…could you elaborate on how is this related to semantics? Do you suppose Disassemble symbol is impossible in a language like Wolfram's due to its semantics? Or were you not really referring to the core language here?
> The most important thing the two languages have in common is that (almost?) all of the syntax maps to expressions
This is one of the most interesting parts. How does type declaration in Julia map to an expression? What can users do with type declarations, as standalone objects? “RTFM” would be OK answer but I'd really prefer a discussion. :-) Does “quote type […] end end” work? Is there a way to investigate and edit syntax tree directly? manual/metaprogramming does not seem to address these questions.
mma> data = RandomReal[1.,1*^7]; min = .2; max = .3;mma> Total@Unitize@Clip[data,{min,max},{0,0}]
I claim that it takes *a lot* of experience to know that that is the code that is going to be fast, compared to the other 15 approaches people bring up there, because the mapping between Mathematica's core constructs and the machine's core constructs is far more complicated and indirect than for Julia.
In contrast, it doesn't take deep familiarity with Julia's standard library to come up with about the fastest way to write this operation.
julia> function count_range(arr, min, max)
count = 0
for elt in arr
if min < elt < max count += 1 end
end
count
end
It takes more than one line to write, but it's *obvious*. My Mathematica license is expired these days, so I can't run the benchmark, but I bet it also smokes the fast solution in Mathematica.
On the flipside, and this isn't a language feature as much as a very well-implemented functionality, is Manipulate[]. It is wonderfully simple to set up and deploy interactive data exploration using Mathematica - dragging a few sliders around can be a great way to explore parametric sensitivities in some problems. If you've never seen this in action before, have a look around demonstrations.wolfram.com for some examples. Julia has some catching up to do here, but I'm confident it will happen in time.
One feature I would like to see from IJulia may be is that the input of greek and mathematical symbol in way that looks natural, e.g. using subscript, in division, integration etc as way to input. This will definitely be a significant improvement IMHO.
second feature is to be able to plot a function in a way one can do in Mathematica. Plotting packages for Julia does this in very limited way (unless I am missing something)
I have indeed met Gadfly. I had Gadfly in mind when I wrote that. It is indeed very pretty. It is only for 2-D plotting, does not do contour or density plot ( two types I tend to use the most). I am sure it will only get improved.
It's mentioned here http://julialang.org/blog/2012/02/why-we-created-julia/ that Mathematica was one of the programs that inspired Julia. How does Julia compare to Mathematica's language?
To make the question more specific,
- it's about languages, not implementations, so Mathematica's FrontEnd capabilities are irrelevant (and it's also not about “which one is faster”)
- it's not about free vs non-free
- it's not about communities and support
- it's not about anything related to OOP (feel free to write about, sure, but I will probably be very passive in discussions concerning OOP)
- it's about the languages' most high-level features, like meta-programming, macros, interactions with other languages and the way it treats types
For example, Wolfram language (which is now the name of Mma's core language), implements meta-programming capabilities via term-rewriting and Hold. It provides some foreign-language interfaces via MathLink (which could be WolframLink already) and also has SymbolicC. It is untyped and proud of it; types can be implemented easily but they are of little practical need in the absence of compiler.
- it's also about the languages' most distinctive features: are there things Julia has that WL does not have? (Which means adding them to WL would require reimplementing Julia in WL, much in spirit of Greenspun's tenth rule.)
I remember reading the Julia manifesto a few years ago, where the stated goal was to create a single computing language that would replace Fortran, scipy, Mathematica, Matlab, etc. simultaneously. I thought at the time that it sounded nuts.
Can we all agree now that it was, in fact, nuts?