Hacker News new | ask | show | jobs
by weatherlight 1082 days ago
> tooling lags behind some other options.

Just out of curiosity. What other options?

2 comments

I use IDEA and most typed languages I write (eg Java, Go, Python with annotations) have better support for things like automated refactoring, bug detection via static analysis, etc
Dialyzer gets you pretty far, Especially since Elixir is dynamically typed.
After spending 6 months working on an Elixir codebase, and spoiled by languages with proper IDE support, I'd say Dialyzer is nice... But doesn't get even close to what I'm used to. Sometimes the benefits of the BEAM and the OTP outweight these drawbacks, of course, but to me it sucked the joy out of programming (I'm very type oriented when writing and, more importantly, reading code).
> (I'm very type oriented when writing and, more importantly, reading code).

Me too!

Have you learned any tricks for getting up to speed on large code bases with very limited static typing?

In recent years I've mostly worked on large, complex Python systems. The consequences of (undisciplined) dynamic typing not only sapped my joy in programming, it really burned me out.

Some people are really good at living with code bases like that. I'm not one of them, but I'm still hoping to find some way to bridge the mental gap.

> it really burned me out.

For me it didn't go that far, fortunately, because I managed to jump ship on time... But it was getting _tiring_.

> Have you learned any tricks (...)?

My current apprach is: don't. These days I usually work in Rust, C# and sometimes Typescript. I'm only open to working with dynamically typed languages for short periods of time, as a side quest of the main task (e.g. for my last contract I had to read quite some C code, which somewhat resembled dynamically typed code, but I spent even more time writing Rust, so it was OK).

> My current apprach is: don't.

Eh, thanks. That's my approach as well. I was just hoping for some silver bullet I guess.

Personally I am most affected by language features that didn’t exist before September, 2021.
Are you an AI?
Are you?
Elixir leverages Erlang/OTP and the BEAM which is basically a whole platform for applications. Probably only the Java / JVM ecosystem is on par.
The tooling in the elixir ecosystem is excelent. The only lang/ecosystem that I think does a better job is maybe Rust.
I love Elixir, I use it daily, but I have to disagree. Elixir tooling is in my opinion one of the only sore spots of the ecosystem and its quality is seriously lagging behind the vast majority of other languages. When I say "tooling", I'm talking about language servers and overall editor support.

As much as I appreciate the work the team has done, I think we have to be honest about the good and bad parts. ElixirLS has never worked quite right for me, or most other Elixir developers I know. It's often painfully slow to respond even in small project, it often gets stuck in obscure failures that require an editor reload to get it fully working again. If you run into any kind of issue with it, the boilerplate response it always: Try running `rm -rf .elixir_ls _build` which sometimes works, but usually not.

Javascript, Typescript have immaculate tooling in this regard, same goes for Java, C#, Go, even Python (on IDE side, the package management situation is of course a dumpster fire). I'd go as far as to say that any language supported by Jetbrains has better tooling than Elixir does.

https://github.com/elixir-tools

Check out next-ls aims to replace ElixirLS.

https://www.elixir-tools.dev/next-ls/

There's a podcast/interview from its creator below.

https://podcast.thinkingelixir.com/153

> It's often painfully slow to respond even in small project

I had that problem with NeoVim's Mason plugin that manages language servers, then I just cloned `elixir-ls` and made a super small script to update it daily from GitHub and recompile it. I use that in NeoVim instead and it works near-instantly. Give it a try.

I don't disagree that IDE support can look subpar but I'd also venture a guess that proper IDE support is very first-world problem. You won't find yourself working on projects with millions of lines in Elixir ever, and thus not having e.g. full-blown IDE refactoring has never been a problem for me or any other Elixir dev I know.

All that being said, literally nothing I have ever saw was able to beat Golang's and OCaml's language servers. They just work and are amazingly fast to boot. It's simply a joy coding in those languages with their LS. Rust is trailing closely behind but it's also a fact that its LS is objectively slower -- still, they seem to have made a lot of strides on that front lately and it's much better compared to even one year ago.

I use VSCode at work on our Elixir codebases so I feel your pain trying to get ElixirLS working, though when it does work it's pretty good. However, on my personal laptop I've been trying out the Zed editor which has Elixir language server capabilities out of the box (not a user installed plugin) and haven't had any issues at all.
Haven't heard of Zed before, feels pretty snappy! Will try it out some more on other projects, though I can't tell how to set it up with PyEnv packages off the bat.
> Zed editor

macOS only, closed source, and VC funded :(

I don't work on a Mac, so it's a non-starter for me, but I'd be very reluctant to switch my workflow to an early stage VC funded product because I don't like having my rug pulled.

The command line tooling is pretty good, the elixirls/ide integration is pretty poor compared to other languages I have worked with. Some trivial examples while learning live view. Using : in pattern matching brings up erlang modules, instead of the atom I used elsewhere in the file. html.heex and the ~H sigil can’t seem to support both html and elixir syntax intellsense at the same time. I also somehow got def in intellsense to not make a new function but instead autocomplete to def(). Finally, after hearing how great Ecto was I was hoping it could provide some sort of hints based on the names of tables/rows I had provided in the migrations.
Sorry, can’t agree on that one. I like to play with elixir in my spare time, love the language. There is a ton of great tooling. But I use C# and Rider at work, and the IDE experience is light-years better.