Perfect example: Clojure. Clojure is the textbook esoteric programmers dream... but it's SUPER easy to sell and integrate in a typical Java shop. Why? Clojure is Java. You can use everything on Maven. You can interop with any Java tooling. No hacks or BS required... it's a native compatibility. The fact that the Gleam did not opt for this level of congruence is mind boggling to me.
I could be wrong btw so please correct me if I am. I am genuinely interested in using Gleam in place of Elixir (I think they nailed syntax and got rid of a lot of bullshit) but it is unfortunately not a drop-in replacement. It should be.
Using Gleam in an Elixir project did/does rely on mix_gleam. I've used it some years ago and it worked then, but I haven't had recent experiences. There is a pull request[0] to Elixir to add built-in support for Gleam and as I understand it the Gleam team have made several changes to Gleam tooling to facilitate it, but it's unmerged as of now.
Using Elixir in a Gleam project is just an external function away, just like using Erlang or JavaScript (when using the JS target). E.g.
@external(erlang, "Elixir.Some.Module", "my_fun")
fn my_fun(some_arg: Wibble) -> Wobble
You can also write .ex files in your codebase and use functions from them as externals and they'll be compiled by Gleam.The two main issues on that side are macros and structs. Since Gleam doesn't know about Elixir source or Elixir macros, you can't use them directly. But you can have an .ex file that uses macros and then you can call functions from that file. Structs are trickier, because they're just dynamic maps with a special key-value pair, and maps in Gleam (called Dict) have fixed types for the keys and values. That means you can't model a struct as a Dict. Gleam uses records for its own custom types, so what you can do is either use records on the Elixir side (with the Record module or by hand), or map the Elixir side data structures to be more palatable for Gleam (and vice versa) in your external functions --- which is what you generally do with externals anyway. Of course, if you only intend to pass the Elixir structs around and then back to Elixir, you can model them as external types that are then opaque to Gleam.
https://gleam.run/frequently-asked-questions/#Can-I-use-Elix...