Skip to content

Comment on Elixir and Machine Learning in 2024 so far: MLIR, Arrow, structured LLM, etc.

Comments

My experience with Elixir onboarding was meh. Spent hours trying to setup the LSP in VSCode and Neovim. Their pseudo-official LSP (elixir-ls) didn't work at all. I even made a post about it on Reddit, Github, and here. No one really knew what was going on.

Even with Haskell you have something like ghcup and you're good to go. Not to mention Rust's amazing Cargo and Go's tooling as well.

So far, Elixir has been even more challenging to just get up and running than Common Lisp!

By the way, the official Elixir website recommends using Homebrew to install it. But almost everyone in the Github issues and comments says ASDF is the way to go.

ASDF is easy to use once you've learned a few of the basic commands, and that way you'll have an easy time when new versions come out and want to check out new features. Like the built-in JSON parser, the gradual typing when it drops, things like that.

If you built something useful you might not want to upgrade it just to look at the new stuff, and if you built nothing and just drop into iex a couple of times per year it'll still be easier to pull in the latest BEAM and Elixir versions and play around than figuring out if Homebrew has the new version, and if so, whether it installs nicely over the old or not.

I don't think I've got the LSP running, might check tomorrow. It's OK, the IDE autocompletes some things and for me development basically happens in the REPL and then gets pasted into tests and the project anyway. And iex has good autocomplete and help functions and so on.

Edit: A hurdle might be to install the GUI libraries needed for Observer, but you'll probably be able to search out an incantation for your operating system once you're into doing stuff with process trees.

I think the Python dev style I adopted can't be easily ported to Elixir. In Python, I rely heavily on an LSP because I want to fiddle with a lot of functions/classes located deeply in libraries. In VSCode, I simply press CMD and click on any function (or in Neovim, I `gf` or `gd` it). I thought it'd make even more sense in Elixir because apparently everything is a module. Am I missing something? How do you use iex efficiently?

Sorry you are having so many issues. That has not been my experience with elixir-ls either locally or in Codespaces. Just want to say that when you do get it working, it does indeed have that and many more features. If you are interested, the Elixir slack is very active and helpful and there is a #language-server channel.

Thank you! It seems the Elixir LSP does provide useful features... I'm worried that even after getting it working on my Mac, the same troubles happen again when I move to remote machines. I'll try the Elixir slack!

You're not missing anything. It should be a better experience, it just isn't yet. Sorry. I hope development on the possibilities accelerates!

Yeah, the LSP situation remains a sore point, which is deeply unfortunate. One of the big reasons I like Gleam! Luckily, there are new contenders popping up to hopefully solve the issues with elixir-ls: try https://github.com/elixir-tools/next-ls or https://github.com/lexical-lsp/lexical. They might give a better experience. In fact, the creator of Elixir recently started directly sponsoring next-ls, so it's probably a safe enough bet.

By the way, the official Elixir website recommends using Homebrew to install it. But almost everyone in the Github issues and comments says ASDF is the way to go.

The Elixir website is right. Just use Homebrew until you find a real need for asdf or similar tools. It's far simpler.

asdf (or mise[0]) is merely a way to manage different runtime versions between various projects, you would use it the same way as one might use rbenv/rvm, nvm/n, pyenv, or even Docker/nix, and so on. You don't need it until you have several ongoing projects requiring different runtime versions. If you reach that point, great! It'll be worth the effort then, and it isn't difficult.

Personally, I just use Homebrew Elixir for easy ad-hoc access to iex/livebook. If I truly need reproducible environments, devbox[1] (a sort of nix wrapper) is nice and extremely straightforward.

Tl;dr: Just use Homebrew. If your requirements expand beyond that, you probably have far more challenging problems than installing asdf (or whatever).

[0] https://mise.jdx.dev/dev-tools/comparison-to-asdf.html

[1] https://www.jetify.com/devbox

Thanks! I just checked out devbox, it's so great to have a more user-friendly nix for people like me who don't want to mess with nix!

Also, great point about Gleam! What I like about it, other than types and JS compilation, is exactly the tooling! The devs clearly understood that tooling is extremely important these days and have focused on that. If it's truly inter-operable with Elixir/Erlang libs, I'll probably just use Gleam instead.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.