1. 18
    1. 7

      I’ve been running essentially this setup in production for 1,5 years, with a Broadway application [1] accepting messages and delegating most of the work to Gleam code. Gleam is what finally got me to commit to the BEAM, because a strong type system is a big productivity booster for me, while the Elixir ecosystem (esp LiveView) is just fantastic and delightful.

      However, note that mix_gleam is a bit rough and doesn’t work well with the Gleam language server. You won’t get proper LS feedback, and false compiler warnings, mostly due to Gleam not being able to detect the transitive dependencies handled by mix. A fix for this is to manually add transitive dependencies to the gleam.toml file, but that’s tedious. There is an open PR to semi-automate this [2].

      Here’s another approach to using Gleam in Elixir projects, without mix_gleam: https://blog.nytsoi.net/2024/06/26/gleam-deps-in-elixir

      It does seem to suffer from the same problem with recursive dependencies, however. (According to recent discussion on the Gleam discord server).

      In short, the integration is not yet as tight as one might wish. A simpler approach is to set up a separate Gleam project and use it as a path dependency from Elixir.

      In any case: Elixir + Gleam is heaven!

      [1] elixir-broadway.org [2] https://github.com/gleam-lang/mix_gleam/pull/39