logoalt Hacker News

Gleam doesn't compile to Erlang source anymore

175 points • by ingve • today at 8:08 AM • 71 comments • view on HN

Comments

zachrip • today at 11:30 AM

Shout out to Giacomo's twitch streams. He has taught me about some features of Gleam, Rust, and on top of that he's just a very chill person. He takes time away from his focus to answer questions politely and without judgement. There are dozens of programming streams where the streamer forgets to leave their ego at the door and he is not one of them. I highly recommend following it.

➕ show 4 replies
giancarlostoro • today at 2:21 PM

Erlang is one of those runtimes I've loved since learning about it all the way back in 2008, but I never took time to learn the syntax, but Elixir and Gleam have had me fiddling with the Erlang VM over the years. Happy to see Gleam growing into maturity.

➕ show 1 reply
0x69420 • today at 11:37 AM

to those curious, erlang abstract form[1] is the AST representation used by the erlang compiler/etc. per [1], you can see that it's canonically made of erlang terms, and you have easy access to routines for manipulating this representation from the standard library; it's really comfy when you need it! it's also the target elixir compiles down to, and the representation manipulated by parse transforms, which in base erlang are the way syntactic sugar (notably qlc[2] and some of the more cutesy pattern matches in merl[3] (which, in turn, manipulates the very same representation to do its job. very meta!)) is done.

most BEAM languages actually settle on erlang abstract format. you'd think core erlang would be more common since it feels more like a traditional functional IR, but basically only LFE does this, because it's a moving target without any particular stability guarantees from release to release.

1: https://www.erlang.org/doc/apps/stdlib/erl_parse.html#t:abst...

2: https://www.erlang.org/doc/apps/stdlib/qlc.html#q/2

3: https://www.erlang.org/doc/apps/syntax_tools/merl.html

MichaelNolan • today at 1:30 PM

Gleam is such a beautiful language. I wish I had the opportunity to use it more. If it could compile (transpile) to a native target like rust or go, it would be truly perfect.

➕ show 4 replies
olexsmir • today at 3:37 PM

I love seeing how gleam gets better and better with every release, sadly I dont have any projects where I could use gleam :(

__jonas • today at 12:55 PM

Pretty exciting change that I didn’t see coming —- I wonder if someone will end up implementing an integration with the Whatsapp Erlang debugger

➕ show 1 reply
impoppy • today at 1:14 PM

This raises an obvious question. Why Gleam team weren't doing that in the first place? Obviously they didn't have direct Gleam AST -> Erlang source pipeline, they must have had to build some their own custom Erlang AST representation that they then translated into the source code.

➕ show 1 reply
lexx • today at 12:11 PM

Amazing news! Thank you!

vortegne • today at 10:59 AM

Congratulations to the team! I love Gleam and am genuinely having fun every time I write Gleam code.

jazzypants • today at 1:11 PM

Let me guess: still no string interpolation in a language ostensibly intended for building user interfaces?

➕ show 2 replies
karel-3d • today at 1:47 PM

What is Gleam? Where would I want to use it?

All I understand from the frontpage is that it's typesafe. Good I guess? Then there is something about Erlang which I never used.

➕ show 2 replies
corbinvachal • today at 3:01 PM

[flagged]

fpemberton • today at 3:19 PM

[flagged]

massimodeluisa • today at 3:01 PM

[flagged]

quietFalcon • today at 11:17 AM

[flagged]

➕ show 2 replies
phcreery • today at 11:44 AM

The misuse of commas is distracting; at least it’s better than reading ai blogs.

➕ show 2 replies
nwalkr • today at 12:14 PM

idk, i'm not sure about wording. erlang abstract form still is erlang source, it's ast of erlang source text. one call to erl_prettypr:format and text source is back. word 'transpiler' is still there and there is nothing "pejorative" in it, it's transpilers all the way down everywhere.

but talking pejorative, i was surprised. my opinion of gleam was already pretty low, but i did not expect to see post-1.0 compiler emitting text erlang source. maybe it's not that good of idea to implement compiler in language completely foreign to target ecosystem.

➕ show 1 reply