Live data from Hacker News

Static, Ahead of Time Compiled Julia

juliacomputing.com

11–20 of 87 posts

Re: Static, Ahead of Time Compiled Julia

#11
post #9
post #6

Julia seems like an almost perfect MATLAB replacement. (for my personal preference, I would like a slightly more static/rigid language, but I understand why that's not the right choice for Julia's target users.) There is just one problem... I really, really wish they had dropped the 1-based indexing and <= upper bound on index ranges. It is so annoying.

"I really, really wish they had dropped the 1-based indexing and really? There are quite a few things I don't like about julia, but using 1-indexing and "end" makes implementing algorithms much clearer IMHO. The main pain points for me in julia are the module/pkg system and that the runtime is not just batteries but more like 10 generators included i.e. it could be way more minimal. But I get that the goal is to have…

This is kind of bike-shedding (since that's such a small part of the language), but I also think there are arguments for using 0-indexing with open upper bounds.

Guido explains his choice best:

https://plus.google.com/115212051037621986145/posts/YTUxbXYZ...

Re: Static, Ahead of Time Compiled Julia

#12
post #7
post #3

I personally find the syntax of the language and quality of the current implementation (speed!) excellent. However, it doesn't experience the marketing languages like Rust or Golang receive. What I personally also find worrisome is the perception (at least for me) that Julia is confined to scientific computing whereas I find it should really be a general purpose language.

I am all for replacing Python with Julia.

Me too, maybe this will pressure more adoption of PyPy.

Re: Static, Ahead of Time Compiled Julia

#13
post #8

I think this [0] is worth reading before starting a project in julia (it's quite shocking). Does anyone know if anything has changed in julia's development process over the last year? [0] http://danluu.com/julialang/

Though it would have been fair to point out that this rant was written about his experiences the last time he used Julia, in Oct. 2014, nearly 18 months ago.

Re: Static, Ahead of Time Compiled Julia

#15
post #6

Julia seems like an almost perfect MATLAB replacement. (for my personal preference, I would like a slightly more static/rigid language, but I understand why that's not the right choice for Julia's target users.) There is just one problem... I really, really wish they had dropped the 1-based indexing and <= upper bound on index ranges. It is so annoying.

[deleted]

Re: Static, Ahead of Time Compiled Julia

#16
post #9

Earlier quoted context omitted.

"I really, really wish they had dropped the 1-based indexing and really? There are quite a few things I don't like about julia, but using 1-indexing and "end" makes implementing algorithms much clearer IMHO. The main pain points for me in julia are the module/pkg system and that the runtime is not just batteries but more like 10 generators included i.e. it could be way more minimal. But I get that the goal is to have…

This is kind of bike-shedding (since that's such a small part of the language), but I also think there are arguments for using 0-indexing with open upper bounds. Guido explains his choice best: https://plus.google.com/115212051037621986145/posts/YTUxbXYZ...

Well, Julia is a language designed for mathematics, where indices starting at 1 is common (vectors, matrices). You can argue that polynomials have exponents starting at zero, but then you quickly get to Laurent polynomials, and what you really should be arguing is that the lower bound should be configurable, rather than being set at one specific value (which, of course, is still possible with custom types).

Second, I don't find Guido's argument convincing. Yes, half-open ranges can be mathematically more elegant (and that's actually Dijkstra's argument), but that doesn't mean that the code necessarily becomes more readable. For example, to construct an array without the element at index i, you'd do the following with Python-style indexing:

  a[0:i] + a[i+1:n]
and the following with closed intervals and indexing starting at 1:

  a[1:i-1] + a[i+1:n]
While there is an element of subjectivity to it, I at least find the latter option more readable (possibly because of habituation to mathematical notation).

While the notation for the specific example of i:i+k-1 might be less elegant with closed ranges, closed ranges are something that you find in every math textbook, because sums, products, unions, intersections from a to b (and other operators in that style) operate on closed ranges normally. Closed ranges are the norm in conventional mathematical notation and it makes sense to pick the option that minimizes the overhead when transcribing between mathematical texts and code.

Re: Static, Ahead of Time Compiled Julia

#17
post #8

I think this [0] is worth reading before starting a project in julia (it's quite shocking). Does anyone know if anything has changed in julia's development process over the last year? [0] http://danluu.com/julialang/

The language works well for what is effectively still a beta. Sure I'd like more documentation and tests, but I'm happy to get features first. The alternative for me is trying to do some non trivial cluster computing in C or in python, either of which would suck.

Re: Static, Ahead of Time Compiled Julia

#18
post #9

Earlier quoted context omitted.

"I really, really wish they had dropped the 1-based indexing and really? There are quite a few things I don't like about julia, but using 1-indexing and "end" makes implementing algorithms much clearer IMHO. The main pain points for me in julia are the module/pkg system and that the runtime is not just batteries but more like 10 generators included i.e. it could be way more minimal. But I get that the goal is to have…

This is kind of bike-shedding (since that's such a small part of the language), but I also think there are arguments for using 0-indexing with open upper bounds. Guido explains his choice best: https://plus.google.com/115212051037621986145/posts/YTUxbXYZ...

From the comments section of that G+ post I found this Dijkstra essay with really good arguments for zero-based indexing.

Not only does it have sound mathematical reasoning but also some anecdotal evidence of problems caused by one-based indexing in programming languages.

http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF

Re: Static, Ahead of Time Compiled Julia

#19

Earlier quoted context omitted.

This is kind of bike-shedding (since that's such a small part of the language), but I also think there are arguments for using 0-indexing with open upper bounds. Guido explains his choice best: https://plus.google.com/115212051037621986145/posts/YTUxbXYZ...

Well, Julia is a language designed for mathematics, where indices starting at 1 is common (vectors, matrices). You can argue that polynomials have exponents starting at zero, but then you quickly get to Laurent polynomials, and what you really should be arguing is that the lower bound should be configurable, rather than being set at one specific value (which, of course, is still possible with custom types). Second, I…

Here are some tasks that are ugly with [1:n] indexing:

    - the 1D index of element (i,j) in a matrix is i+(j-1)*m instead of i+j*m

    - the i'th 3-element subvector of a vector is v[3*(i-1)+1:3*i] 
      instead of v[3*i:3*(i+1)]

    - if you have vector of indices that partitions an vector into chunks,
      the i'th chunk is v[ind[i]:ind[i+1]-1] instead of v[ind[i]:ind[i+1]]
Perhaps small issues, but these are all real examples from my most recent Matlab project that were annoying.

But maybe, like the static typing issue, my opinion on this topic is distorted because I spent a lot of time programming in C++ and comparatively little time reading math papers.

Or maybe it would be equally easy to make a list of tasks that are ugly with [0:n) indexing.

Re: Static, Ahead of Time Compiled Julia

#20
post #9
post #6

Julia seems like an almost perfect MATLAB replacement. (for my personal preference, I would like a slightly more static/rigid language, but I understand why that's not the right choice for Julia's target users.) There is just one problem... I really, really wish they had dropped the 1-based indexing and <= upper bound on index ranges. It is so annoying.

"I really, really wish they had dropped the 1-based indexing and really? There are quite a few things I don't like about julia, but using 1-indexing and "end" makes implementing algorithms much clearer IMHO. The main pain points for me in julia are the module/pkg system and that the runtime is not just batteries but more like 10 generators included i.e. it could be way more minimal. But I get that the goal is to have…

the 10 generators are critical if it's going to supplant Matlab. one of the biggest selling points for Matlab is that you don't have to spend a bunch of time searching for libraries, installing, configuring, matching versions, etc. You just spend a bunch of money on Toolboxes instead.
Post reply on HN