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

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.


sort by: page size:

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 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.

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.

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 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.


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.


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

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.


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.

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 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.


> Since Julia is about speed

Is it ? At least that's not the part that excites me most, although its a nice by product to have. Its a nice flexible language with good syntax and a good set of features. I still dislike 1 based indexing though.


Also a lot of people left early on because their concerns and use cases were dismissed as "holding it wrong". Thus what's left of Julia audience is just the one they catered for.

The big selling point from the getgo was that Julia is general purpose. It's now over 10 years and it's still about as general purpose as MATLAB (although on a totally different level design-wise).

A big smell from the getgo was 1-based indexing. I appreciate that it's more familiar from some branches of math and physics (and MATLAB), and it's something I could live with, but more or less all general purpose languages index from zero. And there's a good reason for that. And that makes interoperability trickier.

https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/E...


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


Yes, writing pre-1.0 Julia code was like balancing on a log in the water - the platform kept moving under you :D I'm glad it's gotten a lot stabler now.

And I agree about academics as a key user base. I think Julia's growth is far from over, there's a lot of organic spread yet to come. It may never replace Python in terms of global popularity, but then, why should it have to?


julia is so nice but WHY did they have to decide to do a 1 based index?? like theres literally no reasonnnnnnnnnnnnnnnn

I agree with much of what the article gripes about. To me it's not prohibitive, and obviously brilliant stuff is being built in Julia as it is right now. But I just feel that things could be that much better.

That said, I do feel some of the defensiveness around these topics from years past is fading somewhat. Still, while some of the things are fixable in Julia 1.X, others likely will require a 2.0 release...


>Why use it, when there are so many other good languages out there with more community/support? Honest question.

Such a question seems sort of in bad faith (or loaded), since the selling points of Julia have been hammered time and again on HN and elsewhere, and are prominent on its website. It's a 1 minute search to find them, and if someone is already aware that there's this thing called Julia to the point that they think it's made to be "a big deal", they surely have seen them.

So, what could the answer to the question above be? Some objective number that shows Julia is 25.6% better than Java or Rust or R or whatever?

But first, who said it's a "big deal"? It's just a language that has some development action, seems some adoption, and secured a modest fundng for its company. That's not some earth shattering hype (if you want to see that, try to read about when Java was introduced. Or, to a much lesser degree, Ada, for that matter).

You use a language because you've evaluated it for your needs and agree with the benefits and tradeoffs.

Julia is high level and at the same time very fast for numerical computing allowing you to keep a clean codebase that's not a mix of C, C++, Fortran and your "real" language, while still getting most of the speed and easy parallelization. It also has special focus on support for that, for data science, statistics, and science in general. It's also well designed.

On the other hand, it has slow startup/load times, incomplete documentation, smaller ecosystem, and several smaller usability issues.


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.
next

Legal | privacy