Tuples and lists are both indexed starting at 1, since you ask for the 1st element of something, not the 0th
The 0 was only used by languages because it was a memory offset, so it doesnât make sense for higher level languages and ones that are closer to/used for mathematics probably all start indexing at 1 since that is natural.
Of course, that doesnât mean it isnât a gotcha since many languages sadly adopted indexing starting at 0. Its just one of those things I like to rant about.
Honestly I think the big thing is that a lot of mix users donât know how to use rebar3. Perhaps the rebar3 docs should have a page showing how to do mix stuff but using rebar, both commands and configuration, I bet that would help a lot of people how to understand and use rebar, plus would give a convenient link to give out for such posts.
Really though, most elixir people donât really understand how powerful rebar3 actually is.
I ask for the zeroth element of something in real life, have been since in early grade school near 40 years ago, 1 has always seemed weird to me, lol.
Hehe, yea, Dijkstra. My dad is a mathematician so I too was accused of âpendatryâ for once starting with 0 â I got started programming with C so it was all I knew. And that stuck with me
Iâm sure I can come up with a counterexample that breaks this, too. But I guess youâve got to draw a line somewhere. âDoctor, it hurts when I do thisâŠâ
Because ârebarâ is rebar 2.x, and itâs still needed (though more rarely these days) for older projects. Elixirâs mix, for example, allows you to specify which one you want to use for dependencies.
There has long been interest in either moving rebar3 into Erlang/OTP or some other way to have them install together even if they are in separate repos and simply packaged together. Sadly it is a good bit of work.
Would it be that hard to add kerl support to rebar3? Then rebar3 could bootstrap your Erlang install.
As someone who is quite new to Erlang and who isnât really a software dev, the toughest aspects of learning Erlang are thinking functionally and dealing with immutable data. I mostly work in Python these days and I have to think very differently about problems when trying to do something in Erlang, especially since most ways I would solve a problem involve some sort of mutable data.
But thanks to the usual books and the great folks over on the Erlang Slack #learning channel, itâs starting to click. Iâm still very much a beginner, but Iâm starting to get hooked.
We began rebar3 breaking backwards compatibility, it fundamentally changed the way rebar works. We didnât want a completely new name since it would still use rebar.config (some compatibility was kept where it made sense) and we wanted to make clear it was the successor. Simply bumping the version and keeping the name wouldnât convey how big of a change it was and as @rlipscombe points out it would make having both a litlte more difficult for users.
But I donât know if any projects that are used today actually need rebar 2.x â as in there are surely repos on like github that still use rebar but just because they havenât been touched in 10 years. And some of those will still work with rebar3, assuming they donât rely on the port compiler or a rebar plugin but are just Erlang code.
I guess there is still couchdb which is still rebar and I believe has been planning to move to mix.
Yeah I get that semantically starting at 1 is valid, if I said âplease raise your zeroth fingerâ it wouldnât make much sense Iâm just dyed in the wool from past experience I guess the reason I classed it as a gotcha is that after reading through LYSE and starting on some programming puzzles, it bit me in the ass and took me some time to figure out what was happening with my strings. Taking all the other languages I have worked in into account, this seems like an exotic thing, but its not loud and proud in the docs, so it tripped me up