f(x) = x * x
function(x) x * x end
function f(x) x * x end
f = x -> x * x
If Julia just used curly brackets instead, we wouldn't need all of these different ways to declare functions.
It really have been nicer if I could just do:
{ x -> x * x }
or for named function:
def f(x) { x * x }
Options one and three are both good to have because sometimes you want one-line function definitions (mostly when you want your code to look like math) and sometimes you want big standard 'code looking' multi-line function definitions. If you don't want to choose in the future, just choose one now and stuck with it. Both can be used for everything if you're willing to put up with some awkward syntax.
f(x) = begin x * x end
If this is your main complaint about julia, I'd say we're doing pretty good.
Curly brackets are useful notation and it'd be a waste to use them up for something like this.
Julia's great, but the Pascal-like 'begin and 'end' delimiters strike me as incredibly ugly. There are many alternatives that I can see (such as the one I mentioned above) that would obviate this situation.
I consider myself a 'mathy' person (I work as a quant), but even so, Julia is a very odd language. All of these compromises or whatever just to please the math people who have a hard time programming. Some of these things the more I think about them are great (array indices starting at one make a lot of sense, actually) and the ability to just write '2x' instead of '2*x' is growing on me.
I guess I don't know what my point is. Maybe it's that Julia seems a little alienating for CS types, and that might hamper adoption.
All in all, Julia's pretty great, despite the minor quibbles I mentioned. I sure as hell wish I could use it for quant work instead of being stuck with the vastly inferior Python.