Comment by heliumtera

14 hours ago

One of the best things about erlang/elixir is the repl driven development/manual testing.

Gleam has no `interpreted` story, right? Something like clojure, common lisp, etc. I think this matters because debugging on beam is not THAT great, there are tools in erlang/elixir to facilitate debugging, like inspect() or dbg().

If anyone has experience in this language, what is the mindset with gleam? How you guys debug?

> If anyone has experience in this language, what is the mindset with gleam? How you guys debug?

There is the echo keyword now, which is comparable to elixir's dbg(), I use that a lot.

Lacking a REPL, what I normally do is make a dev module, like 'dev/playground.gleam' where I'm testing things out (this is something that the gleam compiler supports, /dev is similar to /test) and then run it with 'gleam run -m playground'.

Sometimes I also use the Erlang shell. You can get an Erlang shell with all the gleam modules from your project loaded in with the 'gleam shell' command. You just need to know the Erlang syntax, and how Gleam modules are named when compiled to Erlang (they use an '@' separator, so gleam/json becomes 'gleam@json').

You can use all the BEAM debuggers and tracing tools, and Gleam has a print debugging keyword.

Unfortunately there is not yet a plugin for the BEAM debuggers for them to use Gleam syntax.