Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Julia is a great language, but I'm still waiting for someone to create a Julia fork that uses 0-based indexing.


sort by: page size:

Julia is actually a very well designed programming language. 1 based indexing is really very insignificant when it comes to all the difficult aspects of writing good software that it becomes a non-issue.

Fair enough, I might have to eat my words a bit. Julia does have a lot to offer in terms of language characteristics, that's true, and I think part of the appeal. It has been a breath of fresh air, and feels well-thought out from basic principles. But along the lines of the original linked article, it's maybe worth thinking about why Julia hasn't seen more widespread adoption in say, web servers or systems programming, etc and so forth. I don't mean that as a criticism, just that I do think it's been marketed (or received) as a numerical computing language, and that's the community that it's primarily developed around for one reason or another, with its concomitant specific blind spots (as do all language communities).

For what it's worth, I prefer 1-based indexing.

My guess is a lot of what's in the post is probably tied to growing pains and maybe butterfly effects of novel language features on bigger-picture patterns. It would be interesting to see where things were at at a similar stage in other languages.


Every time I look at Julia, I like it a lot, right up to the point where I remember that indexing is 1-based and I loose the will to go on.

Quite a milestone for Julia, and an important step forward towards stability as well: I believe a core Julia team member (Viral Shah IIRC) said that there would be only one or two major releases between 0.5 and 1.0.

One thing I like about Julia development is how receptive they are to community ideas, while also making sure the suggestions fit into the larger pattern and rejecting those that don't. (The "Support for arrays with indexing starting at values different from 1" thing does worry me, since it has the potential to screw things up gloriously, but it seems[1] they predicted HN will gnaw at this one. :) And I'm yet to read the whole of that issue, maybe it'll end up convincing me it's a good idea.)

[1] https://github.com/JuliaLang/julia/pull/16260


why? i like Julia but it's not a great general purpose language IMO.

Been wanting to try Julia out for a while, but the 1-based indexing is perennially putting me off. I can't see how I can avoid spending a large chunk of time (and endless frustration) unlearning years of 0-index muscle memory (nor I see why should I, for the sake of adapting to a single language that, at least initially, I will be just toying with).

It was probably a good marketing move on their part, a wink towards the Fortran/Matlab crowd, but it certainly damages the language's appeal for potential converts from C, C++ and Python.


If Julia had wanted to be taken seriously then it shouldn't have dropped the ball at the very first hurdle by having 1-based array indexing.

I think your pain points with Julia are real, but they don’t bother me too much. I mostly use Lisp languages, enjoy but am not so good with Haskell, so I am very flexible in syntax. I shared the dislike for 1 based indexing, but when I recently started evaluating Wolfram/One and Language, my limited experience with Julia and Octave made Wolfram’s use of 1 based indexing OK.

I love experimenting with programming languages but I don’t like recommending languages just as I don’t like recommending movies: I figure that everyone has their own tastes, and that is a good thing.


I do wonder if the 1 based indexing puts off a lot of developers. I have no issue with it but it seems to come up in most threads discussing Julia, here and on Reddit.

Julia is a young language, so I'm not surprised about the lack of libraries. I am wondering about the future... is it, as a language, capable of these things?

I disagree. When immersed in a language it doesn't tend to be an issue, but switching between them absolutely is. Over my career I've had to deal with a ton of off-by-one bugs in code that was prototyped in Matlab then ported to C++. My hope with Julia was that the language was fast enough that you wouldn't have this divide between prototype and production, but given the overhead in using it anywhere but a REPL, it doesn't look like things are going to work out that way.

On it's own, 1-based indexing certainly isn't enough to keep me from using a language though.


"I really, really wish they had dropped the 1-based indexing and <= upper bound on index ranges."

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 a powerful scientific computing language and not to build a multipurpose language that emphasizes modular construction of code units and production ready package and build management utilities.

All in all, when judged by how well julia achieves its self-stated goals, I think it is excellent.


Three years ago, when I found out about Julia (and quickly fell in love with the language), I not happy at all about the 1-based indices and column-major storage, and at the time, a lot of the responses I got were along the lines of "Julia is for mathematicians, and 1-based indexing and column major are just fine for us". Now, Julia is able to have indices with any base that you want, and can handle row-major storage as well (thanks to Tim Holy's great work). Why is anybody concerned about this anymore? Julia can do whatever you want, you shouldn't be stuck with languages that can ONLY do 0-based indexing.

Isn't Julia trying to be the language you propose?

It's quickly dismissed probably because that, along with 1 indexing (instead of 0 offsetting) are such minor negative decisions compared to all the extremely apt decisions made in the design of Julia. Those two are both controversial with minor pros and cons, but larger scale core design issues like multiple dispatch, integrated multidimensional arrays, a packaging system based off of github, the ability to immediately generate llvm or native code etc. far outweigh the cosmetic issues people might not be as comfortable with.

I hope this capability gets to maturity. It consistently seems like anything I want in a language is in progress in Julia; new scientists in 15 years are going to be very spoiled if Julia becomes mainstream.

On the other hand having cut my teeth programming in MATLAB and lua 1-based indexing is on of the things that endears Julia to me.

Thanks for the info. What worries me is that you can replace 'Julia' with 'Scala' in that sentence and a data scientist wouldn't know the difference. It's already fast. If Julia wants to win in data science then they need to poach users away from other languages.

As much as it pains me to say it, I don't think Julia will. It looks to me like the practical problems with Julia, while addressable, are being addressed too slowly.

There is simply too many rough edges and usability problems as it is now, and at the current pace it will take maybe 10 or 15 years to address them.

On the other hand, the major use case for Julia is to have a fast, dynamic language. And it seems to me the time horizon for Python to become fast, or Rust or C++ to become dynamic is indefinite, so Julia is still the best bet in that space.

next

Legal | privacy