WhatsApp / erlang-language-platform

Erlang Language Platform. LSP server and CLI.
https://whatsapp.github.io/erlang-language-platform/
Apache License 2.0
236 stars 19 forks source link

Request: Distribute on HEx #49

Closed i-am-linja closed 1 week ago

i-am-linja commented 3 weeks ago

Downloading a binary and keeping it synchronised with the various installed Erlang versions seems very tedious. It would be nice to be able to pull it down with rebar3, and have it managed that way; the nicest version of that experience requires it to be on HEx.

I understand running code services through rebar3 can be strange though; I remember erlfmt had some problems when it wasn't escriptised. I have no immediate solution.

tsloughter commented 3 weeks ago

I'm not sure what the best solution is but with https://github.com/tsloughter/beamup it will be supporting "components" to install things like rebar3 and elp. I've yet to decide if I should support automatic mapping, or some sort of user supplied mapping, of components like elp to specific OTP versions so that switching elp version it automatically switches OTP versions.

But, you will for sure be able to say, 'in this directory use elp-26 and otp-26`.

i-am-linja commented 1 week ago

@robertoaloi Apologies if ping is unwanted, but you mentioned setup flow in #52 and I thought this was a better place for that discussion. And I've had some thoughts.

The typical language package manager (think opam, cargo) catalogues four broad classes of package:

rebar3 manages -1 and -2, and I personally believe that -4 is an overreach of scope; but -3 is perfectly sensible, and as yet unserved by the Erlang ecosystem. I do now believe rebar3 is the wrong place for it (doesn't make much sense to commit "ELP WOZ ERE" to a repository), so I will close this issue in favour of a more general discussion.

The question then is, where is the right place? Certainly no BEAM-specific tool that currently exists, and packaging for every individual system is linear work. I have no solution to share today.

tsloughter commented 1 week ago

@i-am-linja do you think beamup is the right place and would you try it out? I have elp install working but haven't released it yet because the code is done in 2 ways as I learn Rust and I still need to remove the way I ditched but its kinda backing the the way I went with at the moment so will take a little time (hopefully today or tomorrow morning).

But if you have rust you can install from source on the branch, https://github.com/tsloughter/beamup/tree/component-install

and run:

target/debug/beamup component install elp latest
i-am-linja commented 1 week ago

@tsloughter It's hard to say, as it's a very new tool without yet a defined identity. Personally, I think edit-time utilities are most sensibly installed and managed system-wide, save maybe the occasional plugin or option per-project; if BEAMUp does that, it may be the right place, if you're willing to commit to the maintenance burden.

That said, I cannot guarantee that I personally will use it. This is nothing to do with BEAMUp itself: I have an unhealthy relationship with computer science [so I write code infrequently to start], and the main appeal of Erlang for me is to understand the diametric opposite of OCaml's error strategy [so I'm leaning towards no code intelligence at all]. I suspect it will have many users though, as long as it has minimal overlap with rebar3 (otherwise people may think "I already have rebar3 and kerl").