← Back to context

Comment by asib

2 days ago

> [...] It’s an Elixir-like language that supports static typing.

Maybe just me, but when I tried Gleam it really came off much more like Rust. In fact, other than running on the BEAM (and having some OTP libs in the works), it doesn't really _feel_ like Elixir at all to me, but that is definitely an opinion.

They probably just mean "BEAM language that isn't Erlang."

All BEAM languages always bring something new to the table aside from just syntax (for Gleam it's static type, for Elixir it's macros and, well, mix!) but none of them try and abstract away the core tenants of the BEAM being functional working with modules and processes. So ya, in that sense you could say it's like Elixir.

How good is the interop story with Elixir/Erlang currently? Can I include a few gleam modules in my Elixir application and let mix take care of compiling and linking everything properly?

  • I'm currently working on a prototype that does exactly this (in our case, the Gleam is essentially a typed calculation module wrapped in Elixir's great libraries for network and database interactions but its all net-new application instead of an existing Elixir codebase). Its not yet perfect, but I've been eagerly following along with this PR: https://github.com/elixir-lang/elixir/pull/14262#issuecommen...

    Seems like (one of) the next Elixir releases will include the support you're looking for in mix.

    • This is going to be very good for Gleam IMO. Having a super-easy on-ramp for using Gleam in Elixir projects will let people experiment with implementing eg more complex business logic in Gleam, and allow gradual adoption. Naturally, this is not the focus of the Gleam project itself, but for me, using Gleam for the core of a project while having access to the amazing Elixir ecosystem is a dream come true. I've been using mix_gleam but it's not perfect and since I started using Gleam pre 1.0, and it's a low-velocity project, updating became too complicated and I actually ended up moving everything to Elixir recently.