Live data from Hacker News

Writing your own BEAM

martin.janiczek.cz

91–94 of 94 posts

Re: Writing your own BEAM

#92

Earlier quoted context omitted.

How is it unstable? It's one of the most reliable pieces of software I have used honestly. In any case 'nix-shell -p erlang|elixir' does not seem too complicated to me.

Flakes is still experimental despite being very widely used.

Flakes is also more stable than many "stable" projects. Flakes is more stable than Python 3, for example.

Re: Writing your own BEAM

#93

Earlier quoted context omitted.

Perhaps you should give Nix a try :)

Nix is enormously complicated, kind of unstable and not well documented. I get that if you've gone through the pain of learning it you get a system with some very nice properties. But casually suggesting "maybe try nix" is a bit like telling someone who wants to listen to Mozart "maybe try playing a piano".

OP is already trying to do something pretty un-casual:

> If you want to control the exact version that's being used across your team (via `asdf` or similar), this practically means you'll end up compiling the BEAM over and over...

So I think it is perfectly appropriate to suggest a sharp tool.

Re: Writing your own BEAM

#94
post #43

Earlier quoted context omitted.

Perhaps you should give Nix a try :)

Correct me if I'm wrong, but you'd still have to compile it from source on nix, no? On my relatively powerful workstation, Erlang/BEAM takes about 7 minutes to compile. We're working around this currently by having a fat devcontainer image, pre-built with Erlang inside (from source) by our CI. It chews through CI minutes unavoidably due to how docker layer caching works. It would be awesome to just download and unpac…

We do exactly this at my dayjob - we have (multiple) very specific combinations of (erlang, elixir, hex, rebar3) that we use which are pinned to exactly the versions we need. We have a private Nix cache so we only have to build them once.

https://www.cachix.org/ simplifies running a custom cache. Well worth the money, IMO.

That said, learning nix and setting up a nix cache is still a lot of work. Docker buildx might offer you some more knobs to cache portions of your build in a finer-grained manner without having to take the nix plunge.

Post reply on HN