17 comments

  • zachrip4 hours ago
    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.
    • giacomocava1 hour ago
      Thank you so much!! Reading this really made my day <3
    • speerer3 hours ago
      ...And he animates his presentations by hand-drawing each frame transition, which speaks volumes.<p>[edit - this might have been ambiguous. I meant that it shows he really cares about the fine details.]
      • jxf2 hours ago
        Do you have an example you especially like?
        • speerer2 hours ago
          Yes! <a href="https:&#x2F;&#x2F;discourse.ubuntu.com&#x2F;t&#x2F;gleam-and-the-value-of-small&#x2F;80331" rel="nofollow">https:&#x2F;&#x2F;discourse.ubuntu.com&#x2F;t&#x2F;gleam-and-the-value-of-small&#x2F;...</a>
          • irickt55 minutes ago
            Here&#x27;s his presentations page: <a href="https:&#x2F;&#x2F;giacomocavalieri.me&#x2F;speaking" rel="nofollow">https:&#x2F;&#x2F;giacomocavalieri.me&#x2F;speaking</a>
        • dematz2 hours ago
          not from a presentation but he made this nice little syntax postcard <a href="https:&#x2F;&#x2F;cdn.bsky.app&#x2F;img&#x2F;feed_fullsize&#x2F;plain&#x2F;did:plc:vzaxc2idqnxovkqscsa3tvvi&#x2F;bafkreig65dyfsc5m3zq47plx2zhsykyps5x3cw75szuu35k4kpx2pjxmsu" rel="nofollow">https:&#x2F;&#x2F;cdn.bsky.app&#x2F;img&#x2F;feed_fullsize&#x2F;plain&#x2F;did:plc:vzaxc2i...</a>
    • cod1r3 hours ago
      yea he is super nice.
  • giancarlostoro1 hour ago
    Erlang is one of those runtimes I&#x27;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.
    • ch4s341 minutes ago
      I&#x27;d say if you know and like Rust, then Gleam should be easy to pick up but otherwise I&#x27;d try Elixir. You can learn most of the language in a few days and be experimenting with BEAM and supervision concepts basically on day one. As a learning exercise I think its worth peoples&#x27; time because actors&#x2F;processes are one of the concurrency models you don&#x27;t see everywhere but solve interesting problems well.
      • lpil36 minutes ago
        I don&#x27;t think that&#x27;s the case, Rust and Gleam have almost nothing in common beyond having static type systems, and those type systems are very different too.<p><a href="https:&#x2F;&#x2F;gleam.run&#x2F;frequently-asked-questions&#x2F;#How-does-Gleam-compare-to-Rust" rel="nofollow">https:&#x2F;&#x2F;gleam.run&#x2F;frequently-asked-questions&#x2F;#How-does-Gleam...</a>
        • ch4s328 minutes ago
          You don&#x27;t think that Gleam has more familiar syntax to a Rust dev than Elixir? Or that the type system might feel more familiar?
          • lpil25 minutes ago
            I think a Rust programmer is more likely to prefer Gleam to Elixir, but I don&#x27;t think there is much link between Gleam and Rust, and I especially do not thing that Gleam should only be considered over Elixir if you are already a Rust programmer.
            • ch4s322 minutes ago
              So I said:<p>&gt; I&#x27;d say if you know and like Rust, then Gleam should be easy to pick up<p>And you think that:<p>&gt; a Rust programmer is more likely to prefer Gleam to Elixir<p>Are we maybe splitting hairs here?
              • trenchgun8 minutes ago
                You said: &gt;I&#x27;d say if you know and like Rust, then Gleam should be easy to pick up but otherwise I&#x27;d try Elixir.<p>This is way too strong and narrow statement. Gleam is statically typed garbage collected language, closer to OCaml than Rust. Elixir if you like dynamically typed instead.
        • bmitc23 minutes ago
          &gt; I&#x27;d say if you know and like Rust, then Gleam should be easy to pick up<p>I think by sentiments like this, people mean if you know unions, records, and pattern matching then you&#x27;ll more easily pick up another language that has unions, records, and pattern matching.
          • ch4s321 minutes ago
            Yep, that&#x27;s essentially what I mean. There&#x27;s even this official cheatsheet[1] that shows a lot of overlap.<p>[1] <a href="https:&#x2F;&#x2F;gleam.run&#x2F;cheatsheets&#x2F;gleam-for-rust-users&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gleam.run&#x2F;cheatsheets&#x2F;gleam-for-rust-users&#x2F;</a>
  • 0x694203 hours ago
    to those curious, erlang abstract form[1] is the AST representation used by the erlang compiler&#x2F;etc. per [1], you can see that it&#x27;s canonically made of erlang terms, and you have easy access to routines for manipulating this representation from the standard library; it&#x27;s really comfy when you need it! it&#x27;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.<p>most BEAM languages actually settle on erlang abstract format. you&#x27;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&#x27;s a moving target without any particular stability guarantees from release to release.<p>1: <a href="https:&#x2F;&#x2F;www.erlang.org&#x2F;doc&#x2F;apps&#x2F;stdlib&#x2F;erl_parse.html#t:abstract_form&#x2F;0" rel="nofollow">https:&#x2F;&#x2F;www.erlang.org&#x2F;doc&#x2F;apps&#x2F;stdlib&#x2F;erl_parse.html#t:abst...</a><p>2: <a href="https:&#x2F;&#x2F;www.erlang.org&#x2F;doc&#x2F;apps&#x2F;stdlib&#x2F;qlc.html#q&#x2F;2" rel="nofollow">https:&#x2F;&#x2F;www.erlang.org&#x2F;doc&#x2F;apps&#x2F;stdlib&#x2F;qlc.html#q&#x2F;2</a><p>3: <a href="https:&#x2F;&#x2F;www.erlang.org&#x2F;doc&#x2F;apps&#x2F;syntax_tools&#x2F;merl.html" rel="nofollow">https:&#x2F;&#x2F;www.erlang.org&#x2F;doc&#x2F;apps&#x2F;syntax_tools&#x2F;merl.html</a>
  • MichaelNolan2 hours ago
    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.
    • packetlost1 hour ago
      I feel like Go would be a great backend target for Gleam
      • lpil42 minutes ago
        Go&#x27;s garbage collection isn&#x27;t well suited for an immutable language like Gleam, so the performance would likely be disappointing compared to other targets.
        • ch4s338 minutes ago
          The concurrency model in Go is also poorly suited to the BEAM&#x27;s process model. Goroutines share a heap so you can&#x27;t do a lot of things safely that processes can do. Having independent memory space for a process allows you to free it safely when work is done without GCing everything and you can also safely share data because you have a copy not a ref.
        • packetlost31 minutes ago
          An JavaScripts is? Rust is probably a more performant target regardless
          • lpil27 minutes ago
            Surprisingly yes! JavaScript&#x27;s allocator and garbage collection system is quite well suited to immutable programming.<p>Rust is a very poor compile target as the compiler is slow and not commonly available, and the aspects of Rust that make it good for humans to write make it a poor choice for compilers to target. With humans the produced code is verified, but with a compiler the compiler is what is to be verified, so the inflexibility of Rust are largely a hindrance compared to other native compilation targets.
          • __MatrixMan__10 minutes ago
            I don&#x27;t get the impression that javascript is among Gleam&#x27;s targets because of performance.<p>- server target: BEAM<p>- client target: js<p>Once you&#x27;ve covered those bases, you&#x27;re kind of done.<p>If the server needs to do something special in an OS process... might as well let the OS mediate that interaction so that it can be fully generic, rather than trying to bend the language around whatever the unknown action might be.
    • whalesalad1 hour ago
      I am working on a language called blasphemy which intends to do this.
      • znpy43 minutes ago
        Looking forward to be able to claim to be “proficient in blasphemy” on my cv! &#x2F;s
    • fggbbjnvh2 hours ago
      [flagged]
  • __jonas2 hours ago
    Pretty exciting change that I didn’t see coming —- I wonder if someone will end up implementing an integration with the Whatsapp Erlang debugger
    • lpil1 hour ago
      The only thing that would be needed for this is for 2 flags to be passed to the Erlang compiler. It would be very trivial!
  • impoppy2 hours ago
    This raises an obvious question. Why Gleam team weren&#x27;t doing that in the first place? Obviously they didn&#x27;t have direct Gleam AST -&gt; Erlang source pipeline, they must have had to build some their own custom Erlang AST representation that they then translated into the source code.
    • lpil1 hour ago
      We did not (and still don&#x27;t) have an internal Erlang AST representation in the compiler. Previously we did have a Gleam AST -&gt; printing algebra -&gt; Erlang source pipeline, now we construct a buffer of bytes with the data encoded as Erlang Term Format.<p>Source was the previous target as at the time Erlang Abstract Terms was not established as the go-to format (Core Erlang was more popular but it did not have a stable API outside of the BEAM, so Gleam&#x27;s in-Rust compiler could not construct it), and due to the newness of the language having an &quot;escape hatch&quot; where one could abandon Gleam and eject to Erlang was highly valuable. It also meant we could use the Erlang build tool until the Gleam one was ready for use.
  • lexx3 hours ago
    Amazing news! Thank you!
  • vortegne4 hours ago
    Congratulations to the team! I love Gleam and am genuinely having fun every time I write Gleam code.
  • jazzypants2 hours ago
    Let me guess: still no string interpolation in a language ostensibly intended for building user interfaces?
    • lpil1 hour ago
      Gleam is not ostensibly intended for building user interfaces.
      • jazzypants1 hour ago
        Then, why is JavaScript a compilation target? If you&#x27;re not using it on the client-side, then why not stay exclusive to the BEAM?
        • lpil41 minutes ago
          JavaScript is useful in lots of places, and even if one compile target is especially good for in-browser user interfaces that doesn&#x27;t mean that language is specifically intended for user interface development.
        • yladiz56 minutes ago
          You can do a lot more with JavaScript than building UIs.
          • jazzypants53 minutes ago
            Yeah. I know. I use it every day. That doesn&#x27;t answer my question. Why would I want to write something in Gleam if I want it to run in a JavaScript engine? When would that ever make sense? Could you please just engage with me in good faith?<p>Multiple compilation targets require increased implementation complexity so you would think they would have a good reason for when you would compile to one target or the other. I couldn&#x27;t find any information about it on their website, so I was hoping you would actually respond with something helpful rather than... that.
            • yladiz43 minutes ago
              So, you started by making a pointed comment about that the language has no string interpolation when it&#x27;s ostensibly for building UIs, so I&#x27;m not sure why you&#x27;re surprised you&#x27;re getting responses like mine or the one from lpil. Gleam is not ostensibly meant for building UIs just because it targets JS, and while you don&#x27;t get string interpolation in the way you might get in other languages you can go pretty far with the &lt;&gt; syntax.<p>To answer your question about why you would use Gleam when you&#x27;re running code in a JS engine, it&#x27;s the same about any language that compiles down to another, such as Clojure, and you can take your pick of those reasons: preference, syntax, pragmatism, etc. I&#x27;m not sure what kind of answer you&#x27;re looking for beyond that.
              • jazzypants29 minutes ago
                I&#x27;m looking for the intention behind it. They chose two compilation targets. That made things harder. They had a reason. That&#x27;s what I&#x27;m asking about.<p>None of your reasons (&quot;preference, syntax, pragmatism&quot;) fully explain the situation without more context. Whose preference? What syntax are users even seeing? Why is it pragmatic?<p>Compilation targets are generally chosen based on performance characteristics and where the code is actually expected to be run. If you&#x27;re not expecting the code to run on the client, then there&#x27;s no reason to use JavaScript. V8 performance is better when single-threaded, but then why use the actor model?<p>When I go to the ClojureScript website, they have a whole section about why they chose JavaScript as a compilation target[0]. Notably, it mentions the word &quot;client&quot; multiple times.<p>[0] <a href="https:&#x2F;&#x2F;clojurescript.org&#x2F;about&#x2F;rationale" rel="nofollow">https:&#x2F;&#x2F;clojurescript.org&#x2F;about&#x2F;rationale</a>
      • whalesalad1 hour ago
        I still don&#x27;t know what gleam is for tbh. I like it conceptually. But interop with for instance elixir libraries is not as seamless as you&#x27;d like.
        • __jonas1 hour ago
          I use it mostly for web APIs &#x2F; services, it&#x27;s great for that!<p>Interop is not seamless since Elixir does not have the same static type system, but it is possible and that does help sometimes. When resizing images for example, I fall back to Elixir&#x27;s bindings to libvips. I&#x27;ve also used Oban from Gleam in the past.
        • lpil40 minutes ago
          It&#x27;s a general purpose programming language, like OCaml, Python, or Scheme. It&#x27;s not intended for any specific business domain.
    • dematz2 hours ago
      gleam is very much a language of &quot;no&quot; which if you like that, cool, if not, also cool :)
  • karel-3d1 hour ago
    What is Gleam? Where would I want to use it?<p>All I understand from the frontpage is that it&#x27;s typesafe. Good I guess? Then there is something about Erlang which I never used.
    • lpil38 minutes ago
      Gleam is a simple functional programming language which leans into static typing , friendly tooling, and a one-way-to-do-it style. You&#x27;d want to use it if you enjoy the programming experience it provides.
    • jeltz37 minutes ago
      It is if you want Erlang but typesafe and with a modern syntax. And why would you want Erlang? Erlang was built for making it easy to build fault-tolerant concurrent applications, for example in telecom.
  • fpemberton15 minutes ago
    [flagged]
  • corbinvachal33 minutes ago
    [flagged]
  • massimodeluisa33 minutes ago
    [flagged]
  • quietFalcon4 hours ago
    [flagged]
  • phcreery3 hours ago
    The misuse of commas is distracting; at least it’s better than reading ai blogs.
    • gamache3 hours ago
      Your semicolon would be more effective as a comma followed by &quot;but&quot;. HTH
    • dominikh3 hours ago
      Which commas are misplaced?
      • Joker_vD2 hours ago
        Before the &quot;and&quot;, &quot;but&quot;, &quot;so&quot;, &quot;while&quot;, etc. — while most European languages, indeed, (usually) require commas before conjunctions, English is following a somewhat reversed convention. Well, at least the author remembered that they need to omit a comma before &quot;that&quot;.
        • shakna2 hours ago
          Apart from in Australian [0] and Canadian [1] English, where it is generally optional, but used where it can increase clarity or meter.<p>[0] Australian Government Publishing Service&#x27;s Style Manual for Authors, Editors and Printers, ISBN: 978 0 7016 3648 7<p>[1] The Canadian style: a guide to writing and editing <a href="https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;canadianstylegui0000unse" rel="nofollow">https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;canadianstylegui0000unse</a>
        • pipe012 hours ago
          As a non-native English speaker I&#x27;m always so self conscious when using commas, it feels like I&#x27;m always using either too many or too few
          • GrantMoyer1 hour ago
            Informally, commas are &quot;misused&quot; regularly even by native writers, and almost no one notices or cares unless the misuse is frequent and egregious.<p>Formally, most comma use is an issue of style, not grammar, and style guides differ on when they should and shouldn&#x27;t be used. The main rule that&#x27;s actually a matter of grammar is this: commas cannot be used to join two &quot;clauses&quot; (phrases which could be independent sentences) without a conjunction.
            • Joker_vD48 minutes ago
              So putting the commas in &quot;I&#x27;m eating a hot dog, she&#x27;s listening to radio, we are having a wonderful time.&quot; is grammatically wrong? TIL, I guess.
              • GrantMoyer28 minutes ago
                English has no central authority, so the lines between grammar and style can get fuzzy. Most guides would say you need an &quot;and&quot; after the second comma, but some make an exception if the clauses are &quot;very short and alike in form&quot;. See Wikipedia&#x27;s article <i>Comma splice</i> if you are interested in the pedantics. <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Comma_splice" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Comma_splice</a>
          • john_strinlai1 hour ago
            i dont think anyone actually cares unless you are in english class or someone wants to feel smug on the internet (you can ignore the 2nd one completely).
          • zulux1 hour ago
            Don&#x27;t worry about it.<p>The lack or excess of commas doesn&#x27;t upset any reasonable person in the slightest.
          • steele2 hours ago
            You&#x27;re doing fine. English grammar pedants speak infrequently. Mostly due to the disinterest of the listener.
          • tenuousemphasis2 hours ago
            As a native English speaker, same.
        • sarchertech2 hours ago
          You do need a comma before a conjunction if it connects two independent clauses.
          • Joker_vD1 hour ago
            So it&#x27;s &quot;You do need a comma before a conjunction, if it connects two independent clauses&quot; then — &quot;you need a comma before a conjunction&quot; and &quot;it connects two independent clauses&quot; are two fully formed simple sentences, each having its own subject and predicate. See what I mean?<p>And almost nobody writes sentences like &quot;I love her and she loves me back&quot; with a comma before &quot;and&quot;.
  • nwalkr3 hours ago
    idk, i&#x27;m not sure about wording. erlang abstract form still is erlang source, it&#x27;s ast of erlang source text. one call to <i>erl_prettypr:format</i> and text source is back. word &#x27;transpiler&#x27; is still there and there is nothing &quot;pejorative&quot; in it, it&#x27;s transpilers all the way down everywhere.<p>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&#x27;s not that good of idea to implement compiler in language completely foreign to target ecosystem.
    • lpil1 hour ago
      I don&#x27;t think your &quot;it is source as you can convert it back into source&quot; argument holds water as all the Erlang formats can be decompiled into Erlang source code, including the final bytecode itself.<p>I think you&#x27;re overthinking the cost of compiling to source, and also underestimating how common it is.