What do you think of Gleam compared to Elixir?

I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of a deal-breaker for me. Mainly the fact of it’s dynamic. I really miss an assertive autocomplete.
But well, now we have Gleam, it’s not ready, but looks promising, what do you guys think of it? Does the fact of being typed reduce the productivity from Elixir?

I’m not a big fan of statically typed languages and have never really stopped to take a look at Gleam. But, just curious here, what do you mean by “assertive autocomplete”? I’ve been using Elixir for some time and IDEs autocomplete is great.

I don’t know, for me the autocomplete is always breaking and I don’t know exactly what I can use with the current identifier.

In future it should be possible to provide better autocomplete with Gleam than with Elixir as it is capable of performing superior static analysis, but today there is no IDE like features in Gleam. It is on the backlog though :slight_smile:

2 Likes

I would say that in languages like Elixir it is not that much of the problem as you quite rarely need to dynamically lookup the possible functions (as there is no “methods” in a way that it is in OOP languages).

About Gleam - for now I didn’t have need to test this out yet as I mostly focus on Elixir and Erlang right now and adding new language to the set do not seem to be feasible.

2 Likes

Weird, might be something related to your setup. I’m using VSCode with ElixirLS Fork and I get accurate completions, and Typespecs helps a lot with the problem of not knowing where you can use the current identifier.

With types your editor would only suggest functions that have the correct signatures, you wouldn’t need to type Agent., and it would be able to suggest local variables and functions that fit too! :slight_smile:

Yes, it is never gonna be as complete as the auto complete of a statically typed language, my point is just that it should not be “always breaking” as OP mentioned and Typespecs make it really easy to know what types functions expects. I just don’t get it why I would not need to type Agent., that makes sense to OOP languages where the type/object comes first, but how does that applies to Elixir?

A statically typed Elixir could make suggestions from all modules rather that would be type correct rather than just showing a list of the contents of a module that you suggest.

I’m really enjoying Gleam, there are some things where I would say my productivity is improved.
Particularly the annoying glue code and making sure errors are handled.

Obviously total productivity for a project is reduced as many libraries don’t exist. It’s always quicker if you don’t have to build things.
If your willing to write some erlang code to get erlang librarys into your project I would say you might be surprised at your productivity. I was.

5 Likes