I realized that I’m just guessing what all the version numbers mean — and there are a lot of them. I’m not sure if this is documented anywhere. (?) Here’s what I do on MacOS, which seems to work:
$ brew install asdf
Install the asdf plugins for Elixir and Erlang. (Is it necessary to do both? I think so.)
$ asdf plugin add elixir
$ asdf plugin add erlang
Look at the Elixir versions available:
$ asdf list all elixir
The version 1.14.0-otp-25 seems like the most recent production-ready one, so I install that:
$ asdf install elixir 1.14.0-otp-25
Now I need to find a compatible Erlang version. (Am I correct here?)
$ asdf list all erlang
Cool, the number 25 matches otp-25 from the Elixir package, and although the 25 here theoretically refers to the Erlang version and the other refers just to OTP, I suspect the nomenclature is rather loose. So I install 25.1.1:
$ asdf install erlang 25.1.1
Excellent! I’m almost ready to get to work. I have just one more hour ahead of me:
Try to write Elixir code in VS Code with the LSP.
It’s broken. Try to debug my dev env unsuccessfully. Post a forum question. Learn that the LSP has an undocumented dependency on OTP < 25.
Redo all the above steps with Erlang 24 and Elixir with otp-24.
Test all of this, and it appears to work: My inference about Erlang 24 = top-24 might be correct.
This is the setup process for new Elixir devs. Did I miss some docs or sign-posts along the way that would have made this easier?
Erlang is the language and OTP is the distribution of the standard library and tools. Think java and jdk. Elixir is buiilt on top of the OTP, think Scala. And the LSP is another layer up. Usually, the backward compatibility of both Erlang and Elixir is pretty good; but in the case of LSP, it is probably doing something more intimate than an average package to the core.
Isn’t it even worse if you want wxwidgets compiled in the asdf version of erlang? I usually use Windows which is just scoop install erlang elixir and was a little frustrated by how much harder it was setting it up with asdf on Linux.
Weren’t the ElixirLS issues with OTP 25 patched recently? It’s been working for me for at least a couple of weeks.
On linux you don’t even need asdf. just old fashion ./configure; make; make install and you have OTP. If you are lazy, just use whatever the distribution provides. I always compile elixir myself. It is only a minute and it is a good sanity check of your Erlang environment.
in asdf the version suffix in the elixir distribution is to tell you which erlang version it was compiled against. I don’t know if there is actually a difference between them, but I always make sure they are in the same major range.
I am not using VSCode, but Lunarvim and have no issues with elixir-lsp and erlang 25+
Although Elixir projects are not required to follow SemVer, they must follow the format outlined on SemVer 2.0 schema.
x.y.z at the start is the version of Elixir
-rc.x is a x release candidate for said version
-otp-x is a precompiled Elixir release for xmajorErlang version
The release without otp part before install needs to be compiled first with already installed and officially supported Erlang version
main is the name of git branch which means you can test more or less stable new features before they added to an official release
If you want to install latestElixir together with latest supported Erlang and you are not interested in release candidates as well as unstable main branch then you need to select release with latest x.y.z version of Elixir and latest -otp-x version, currently 1.14.0-otp-25.
In Erlang it’s much easier as it does not have a precompilled releases for other languages.
a.b or a.b.c or a.b.c.d at the start is the version of Erlang - here we do not have padded .0 except b
-rcx is a x release candidate for said version
master is the name of git branch which means you can test more or less stable new features before they added to an official Erlang/OTP release
maint and maint-x are stable git branches based on previous work in master, see otp/CONTRIBUTING.md for more information
Again if you look for latest stable release for Elixir version -otp-25 you need to select latest a.b or a.b.c or a.b.c.d - currently it’s 25.1.1.