25 comments

  • pkos9824 days ago
    Coming from Elixir, I gave Gleam a try for a couple of days over the holidays. Reasons I decided not to pursue:<p>- No ad-hoc polymorphism (apart from function overloading IIRC) means no standard way of defining how things work. There are not many conventions yet in place so you won’t know if your library supports eg JSON deserialization for its types<p>- Coupled with a lack of macros, this means you have to implement even most basic functionality like JSON (de)serialization yourself - even for stdlib and most popular libs’ structs<p>- When looking on how to access the file system, I learned the stdlib does not provide fs access as the API couldn’t be shared between the JS and Erlang targets. The most popular fs package for erlang target didn’t look of high quality at all. Something so basic and important.<p>- This made me realise that in contrast to elixir which not only runs on the BEAM („Erlang“) but also runs with seamless Erlang interop, Gleam doesn’t have access to most of the Erlang &#x2F; Elixir ecosystem out of the box.<p>There are many things I liked, like the algebraic data types, the Result and Option types, pattern matching with destructuring. Which made me realize what I really want is Rust. My ways lead to Rust, I guess.
    • hayleighdotdev23 days ago
      &gt; Gleam doesn’t have access to most of the Erlang &#x2F; Elixir ecosystem out of the box.<p>Gleam has access to the entire ecosystem out of the box, because all languages on the BEAM interoperate with one another. For example, here&#x27;s a function inside the module for gleam_otp&#x27;s static supervisor:<p><pre><code> @external(erlang, &quot;supervisor&quot;, &quot;start_link&quot;) fn erlang_start_link( module: Atom, args: #(ErlangStartFlags, List(ErlangChildSpec)), ) -&gt; Result(Pid, Dynamic) </code></pre> As another example, I chose a package[0] at random that implements bindings to the Elixir package blake2[1].<p><pre><code> @external(erlang, &quot;Elixir.Blake2&quot;, &quot;hash2b&quot;) pub fn hash2b(message m: BitArray, output_size output_size: Int) -&gt; BitArray @external(erlang, &quot;Elixir.Blake2&quot;, &quot;hash2b&quot;) pub fn hash2b_secret( message m: BitArray, output_size output_size: Int, secret_key secret_key: BitArray, ) -&gt; BitArray </code></pre> It&#x27;s ok if you don&#x27;t vibe with Gleam – no ad-hoc poly and no macros are usually dealbreakers for certain types of developer – but it&#x27;s wrong to say you can&#x27;t lean on the wider BEAM ecosystem!<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;sisou&#x2F;nimiq_gleam&#x2F;blob&#x2F;main&#x2F;gblake2&#x2F;src&#x2F;gblake2.gleam" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sisou&#x2F;nimiq_gleam&#x2F;blob&#x2F;main&#x2F;gblake2&#x2F;src&#x2F;g...</a><p>[1]: <a href="https:&#x2F;&#x2F;hex.pm&#x2F;packages&#x2F;blake2" rel="nofollow">https:&#x2F;&#x2F;hex.pm&#x2F;packages&#x2F;blake2</a>
      • pkos9823 days ago
        Isn’t this the proof of my point - How does the need of writing „@external“ annotations by hand not contradict the point of being „out of the box“ usable?<p>Hayleigh, when I asked on the discord about how to solve my JSON problem in order to get structured logging working, you replied that I’m the first one to ask about this.<p>Now reading this: &gt; It&#x27;s ok if you don&#x27;t vibe with Gleam – no ad-hoc poly and no macros are usually dealbreakers for certain types of developer<p>Certainly makes me even more feel like gatekeeping.
        • widdershins23 days ago
          I don&#x27;t think Hayleigh was trying to gatekeep, just noting that some developers prefer features that Gleam intentionally omits.<p>As for the @external annotations, I think you&#x27;re both right to a degree. Perhaps we can all agree to say: Gleam can use most libraries from Erlang&#x2F;Elixir, but requires some minimal type-annotated FFI bindings to do so (otherwise it couldn&#x27;t claim to be a type-safe language).
        • okkdev23 days ago
          How does it contradict it? Without any modification&#x2F;installation you can interop with Erlang&#x2F;Javascript. How is that not out of the box usability of the Erlang&#x2F;JS ecosystem? Syntax isn&#x27;t as seamless as Elixir, but we need a way to tell Gleam what types are being passed around.<p>Why do you feel like a gatekeeper? Your opinion is valid, it&#x27;s just that the interop statement was wrong.
          • nextaccountic23 days ago
            That&#x27;s FFI bindings. I need to provide the function signature of every API, because Erlang isn&#x27;t statically typed. It&#x27;s okay if some library provides it (like the linked , but I don&#x27;t want to write this by hand if I can avoid it. And it&#x27;s definitely not out of box, someone has to write the bindings for it to work<p>It would be different if I didn&#x27;t have to write bindings and Gleam integrated automatically with foreign APIs. For Erlang that&#x27;s probably not possible, but for the Javascript ecosystem it could make use of Typescript signatures maybe. (it would be very hard though)
          • cmoski23 days ago
            Yeah, it&#x27;s there out of the box but it&#x27;s certainly not seamless. For an Elixir dev, it is more friction than you&#x27;re used to. It is the cost of static types.
        • lpil23 days ago
          This is the same as Elixir, you need to specify what Erlang function to use in that language if you want to use Erlang code. The only difference is that Gleam has a more verbose syntax for it.
          • rkangel23 days ago
            In Elixir you just call the Erlang function directly. It&#x27;s basically the same as calling an Elixir function, just with a different naming convention.<p>In Gleam, you first have to declare the function type and THEN you can call the function directly.<p>This is probably the lightest way you can bridge between statically and dynamically typed languages, but it&#x27;s <i>not</i> the same as Elixir.
            • lpil23 days ago
              Sorry, I&#x27;ve been unclear.<p>The runtime behaviour and cost of calling an Erlang function is the same in Elixir and Gleam, however the syntax is more verbose in Gleam as it asks for type information, while in Elixir this is optional.
    • ngruhn23 days ago
      I&#x27;m a bit torn on ad-hoc polymorphism. You can definitely do cool things with it. But, as others have pointed out, it does reduce type safety:<p><a href="https:&#x2F;&#x2F;cs-syd.eu&#x2F;posts&#x2F;2023-08-25-ad-hoc-polymorphism-erodes-type-safety" rel="nofollow">https:&#x2F;&#x2F;cs-syd.eu&#x2F;posts&#x2F;2023-08-25-ad-hoc-polymorphism-erode...</a>
      • alpinisme23 days ago
        The same point holds of interfaces. And it’s not clear what the alternative is. No type system I’m aware of would force you to change all occurrences of this business logic pattern, with or without ad hoc polymorphism.<p>But at least ad hoc polymorphism lets you search for all instances of that business logic easily.
        • ogogmad23 days ago
          ML languages have a &quot;types, modules, types-of-modules, and functors&quot; approach to ad-hoc poly. It&#x27;s a bit strange compared to what other languages do. I am wondering whether it&#x27;s ever been seen outside of SML and OCaml.<p>For JSON deserialisation, you would declare a module-type called &quot;JSON-deserialiser&quot;, and you would define a bunch of modules of that module-type.<p>The unusual thing is that a JSON-deserialiser would no longer be tied to a <i>type</i> (read: <i>type</i>, not <i>module-type</i>). Types in ML-like languages don&#x27;t have any structure at all. I suppose you can now define many different JSON-serialisers for the same type?
      • instig00722 days ago
        The article provides a contrived example and doesn&#x27;t prove that ad-hoc polymorphism reduces type-safety. Even when `Maybe [a]` is being folded via `Foldable f` the claimed type-safety isn&#x27;t reduced, it&#x27;s the context of the folding that&#x27;s being changed from `[a]` to `Maybe a`, and everything is type-safe. Secondly, if you really want to distinguish between the empty list and disabled allow-lists within your type-system you do define your own data type with that representation, and you don&#x27;t declare it foldable, because the folding algebra doesn&#x27;t make sense for any practical use-case of the disabled allow-lists. The language actually provides you with the means to reduce evaluation contexts your types can be part of.
    • nesarkvechnep23 days ago
      I’ve been doing Elixir for 9 years, 5 professionally. Nobody cares about ad-hoc polymorphism. The community doesn’t use protocols except “for data”. Whatever that means. Global singleton processes everywhere. I’m really discouraged by the practices I observe but it’s the most enjoyable language for me still.
      • threethirtytwo23 days ago
        &gt;I’ve been doing Elixir for 9 years, 5 professionally. Nobody cares about ad-hoc polymorphism.<p>That’s true for Elixir as practiced, but it’s the wrong conclusion for Gleam.<p>Elixir doesn’t care about ad-hoc polymorphism because in Elixir it’s a runtime convention, not a compile-time guarantee. Protocols don’t give you universal quantification, exhaustiveness, coherence, or refactoring safety. Missing cases become production crashes, not compiler errors. So teams sensibly avoid building architecture on top of them.<p>In a statically typed language, ad-hoc polymorphism is a different beast entirely. It’s one of the primary ways you encode abstraction safely. The compiler enforces that implementations exist, pushes back on missing cases, and lets you refactor without widening everything into explicit pattern matches.<p>That’s exactly why people who like static types do care about it.<p>Pointing to Elixir community norms and concluding “nobody cares” is mixing up ecosystem habits with language design. Elixir doesn’t reward those abstractions, so people don’t use them. Gleam is explicitly targeting people who want the compiler to carry more of the burden.<p>If Gleam is “Elixir with types,” fine, lack of ad-hoc polymorphism is consistent. If it’s “a serious statically typed language on the BEAM,” then the absence is a real limitation, not bikeshedding.<p>Static types aren’t about catching typos. They’re about moving failure from runtime to compile time. Ad-hoc polymorphism is one of the main tools for doing that without collapsing everything into concrete types.<p>That’s why the criticism exists, regardless of how Elixir codebases look today.
      • pkos9823 days ago
        Well, for the specific example I gave (JSON serialization), you certainly do care whether Jason.Encoder is implemented for a struct.
        • nesarkvechnep23 days ago
          Yes, I just ranted, sorry. I share your view about Gleam.
      • krainboltgreene23 days ago
        IMHO this is an education problem.
        • nesarkvechnep23 days ago
          Problem which plagues 90% of the people? How to overcome it?
          • threethirtytwo23 days ago
            It&#x27;s an education problem on two fronts. People inside the ecosystem need to know about it. And also people too deep in the elixir ecosystem who don&#x27;t know how ad-hoc polymorphism is supposed to be used in a statically typed language.<p>Both overcome it by admitting they don&#x27;t know and need to learn.
  • smweber23 days ago
    I’m trying Gleam out right now, and having most recently been writing Go, I’m really loving: - No nil, instead Option and Result - ADTs - Pattern matching + destructuring - Immutable everything by default - `use` syntactic sugar (weird at first, but once you’re used to it it’s pretty elegant) - LSP server works great for such a young language<p>But most of all I think the overall simplicity of the language is really what’s standing out to me. So far I think the lack of ad-hoc poly and macros are a plus - it really reduces the impulse to write “magical” code, or code with lots of indirections. In the past I’ve definitely been guilty of over-abstracting things, and I’m really trying to keep things as simple as possible now. Though I’ve yet to try Gleam with a large project - maybe I’ll miss the abstractions as project complexity increases.<p>I suspect Gleam will be a great language for small to medium sized projects written with LLM assistance (NOT vibecoded) - the small language, strong typing and immutability gives good guardrails for LLM-generated code, and encourages a simple, direct style of programming where a human programmer can keep the whole structure in their head. Letting an LLM run free and not understanding what it’s written is I think where projects run into big problems.
    • packetlost23 days ago
      The use &lt;- syntax is even more crazy when you realize that it&#x27;s a programmer-friendly way of doing continuation-passing style.
      • perrygeo23 days ago
        In a language that is otherwise as simple as it could possibly get away with (no `if`!), `use &lt;-` initially feels like magic and somewhat out of place.<p>But take look at nested callback code, the pyramid of doom, and you see why it&#x27;s pragmatically necessary. It&#x27;s a brilliant design that incorporates just enough metaprogramming magic to make it ergonomic. The LSP even lets you convert back and forth between nested callback style and `use`, so you can strip away the magic in one code action if you need to unravel it.
      • sureglymop22 days ago
        I prefer kotlins trailing lambdas, which do mostly the same. But the way they are written allows code to almost look like JSON&#x2F;some declarative DSL.<p>But use is nicer to avoid callback hell and all the indentations&#x2F;scoping.
  • wiskiy23 days ago
    I am in love with Gleam! As a young computer science student, I found that Gleam brought back the joy of programming just when I felt like I was seriously burning out. I was never a fan of functional programming languages. I had tried other BEAM languages like Elixir and Erlang before, but Gleam is the one I’ve enjoyed the most :)
    • replwoacause23 days ago
      Have you tried F#? That usually gets a lot of praise in FP discussions.
      • systems23 days ago
        F# seem to be in abandon-ware state the creator of F# moved to another job as his primary work the forum and community are very dry<p>Nothing interesting being created in F#<p>As much as I had high hopes for F# I think its safe at this point, to not pursuit it any further<p>.Net is C#<p>If you want an Ocaml like language, that is not Ocaml, your best bet is Rescript and that being said, Rescript is probably more of a competitor to gleam, since gleam also have javascript as a target
        • throw123543521 days ago
          The language is still ahead of C#, and still receiving features and keeping up by and large with the .NET ecosystem. Tbh I don&#x27;t get the sheer negativity; the same thing could be said for Gleam or any other functional language these days tbh especially with AI coming along w.r.t long term support. Eventually things just work and are mostly complete; things don&#x27;t have to get reinvented or get better forever.<p>&gt; As much as I had high hopes for F# I think its safe at this point, to not pursuit it any further<p>I find this attitude interesting; you wanted it to be more than it was. I don&#x27;t have high hopes for any language; other than it building my software which it and many others can do. Right tool for right job. I&#x27;m not attached to my code, other than if it can be maintained, changed, has sane defaults&#x2F;guardrails to introduce less defects, etc. F# can do this, as many others. Interestingly I&#x27;ve seen the same attitude eventually happen to all languages of this class other than Rust; Scala, OCaml, etc are in similar positions.<p>Funnily enough Opus&#x2F;CC has a number of times for my projects has suggested Rust, and if that doesn&#x27;t work (too much for the team) went F# even over Java based langs assuming domain modelling code and the need for more perf (e.g. value types, and other stuff) without explicit prompting. Its then generated fsx scripts to run experiments, etc that seem to be more reliable than the default Python ones it runs (package errors and static typing fixes mostly). `dotnet fsi` fits well into the agentic workflow.<p>&gt; Rescript and that being said, Rescript is probably more of a competitor to gleam<p>Depends on your target. F# at least has a backdoor into the C# ecosystem - from a risk perspective that makes it more palatable. New languages have an initial &quot;excitement&quot; about them; but generally they are just tools.<p>Pick something that fits your team and build. F# does work, and so do many other tools. In the age of AI IMO the ecosystem and guardrails for the AI matter more than the language and its syntax IMO other than readability. In this regard F# still is &quot;less risky&quot; with its .NET interop.
          • akkad3317 days ago
            Wake up and smell the coffee: fsharp is dead. Look at the release notes of fsharp. It&#x27;s laughable for a major version update. It&#x27;s maintained by like 5 people working in eastern Europe and they only do maintenance updates basically. C# is getting all its features and DotNet is basically c# oriented anyway. So even in the past you had to learn C# to program in F#
        • pjmlp22 days ago
          I would assert that Microsoft&#x27;s management always behaved as if they repented to have added F# to VS 2010, with all the maintenance guarantees it implies, throughout the years they have searched how to sell it.<p>Nowadays CLR has effectively changed meaning to C# Language Runtime, and ironically the JVM is more lively as the original goal of the CLR back in 2001.
  • behnamoh24 days ago
    I&#x27;d rather them stick with ONE: JS or BEAM. Everytime a project claims it can do multiple things at once, it can&#x27;t do either very well.<p>It&#x27;s confusing too. Is Gleam suitable for distributed computing like Elixir&#x2F;Erlang on BEAM? Would that answer change if I compile it to JS?
    • isodev23 days ago
      My “intro to gleam” was a lustre form for my blog, where people could submit feedback. So I was able to create a neatly separated client module in Gleam and compile it to JavaScript so I can insert it in my static blog page. The server part was a separate gleam module with erlang as a target. They shared models and some constants with a “shared” module - just like the tutorial.<p>I find this kind of explicit separation very powerful. It also removes some of the anxiety if something will end up in a client bundle when it’s supposed to be server only.
      • akkad3317 days ago
        How is it hosted if you don&#x27;t mind saying
    • tunderscored23 days ago
      I&#x27;ve used gleam for a toy project in uni, and AoC<p>My main friction point is that the Int type maps to different concepts in erlang and js<p>In erlang it&#x27;s a arbitrary precision Int<p>In js it the js number type, which is a 64bit float iirc.<p>Also recursion can hit limits way sooner in js.<p>For me, my code rarely ran in both js and erlang. But could be skillissue
      • okkdev23 days ago
        Fair, but you usually don&#x27;t run your project on both, unless you&#x27;re writing a library.<p>Pick the target that makes sense for your project and stick with it :)
        • rkangel23 days ago
          JS&#x2F;TS isn&#x27;t my favourite language, but it&#x27;s pretty decent these days. If I&#x27;m picking a different language and targeting the web, it&#x27;s probably because I want to run the same code natively as well.
    • Ndymium23 days ago
      Gleam is technically as suitable for distributed computing as Erlang: since it compiles to Erlang, it can do anything that Erlang can. You can use Erlang and Elixir libraries and write FFI code to do things that would be unergonomic to do in Gleam. Sure the experience is different and if you want to embrace the guarantees of static typing, then the APIs will look different, like gleam_otp.<p>If you compile it to JS, then the guarantees change to JS&#x27;s guarantees.<p>Personally I&#x27;ve felt that the JS target is a big plus and hasn&#x27;t detracted from Gleam. Writing a full stack app with both sides being in Gleam and sharing common code is something I&#x27;ve enjoyed a lot. The most visible impact is that there&#x27;s no target specific functions in the stdlib or the language itself, so Erlang related things are in gleam_erlang and gleam_otp, and e.g. filesystem access is a package instead of being in the stdlib. If you&#x27;re just into Erlang, you don&#x27;t need to interact with the JS target at all.
      • wink23 days ago
        Same here, I&#x27;ve only been using it for a bit and have 100% been ignoring the JS part and the only time where I felt I needed to think about it for a moment was when I was writing a patch for someone else&#x27;s code that did not ignore it, so basically when contributing to a library you might have to do extra work.<p>Of course I can&#x27;t say if anyone ever made any decisions based on the other target that would have repercussions for me only using the BEAM.
  • brandonpollack224 days ago
    I really like the idea of gleam but I don&#x27;t want to hand implement serialization for every type (even with an LSP action) in 2026.
    • ocean_moist24 days ago
      Biggest issue with this language. But... fairly trivial to implement codegen with gleam&#x2F;glance[0]. No good libraries do this well right now (e.g. support for discriminated unions).<p>[0] <a href="https:&#x2F;&#x2F;hexdocs.pm&#x2F;glance&#x2F;glance.html" rel="nofollow">https:&#x2F;&#x2F;hexdocs.pm&#x2F;glance&#x2F;glance.html</a>
    • lawn23 days ago
      Indeed. Gleam is a sort-of mix between Elixir and Rust, yet you don&#x27;t have to explicitly implement serialization for either of them.<p>It&#x27;s definitely something they should figure out.
    • worthless-trash24 days ago
      I rarely serialise every type in my gleam code, My quick back of the napkin math is less than 5%.
      • brandonpollack223 days ago
        But 100 percent of projects writing the same stuff
        • worthless-trash23 days ago
          I don&#x27;t think anyone is serializing exactly the same stuff that i&#x27;m doing.
    • virtualwhys24 days ago
      Dart has the same glaring issue (yes, yes, you can use a codegen library but it&#x27;s not the same).
  • tombert24 days ago
    I remember playing with Alpaca a few years ago, and it was fun though I didn’t find the resulting code to significantly less error-prone than when I wrote regular Erlang. It’s inelegant, but I find that Erlang’s quasi-runtime-typing with pattern matching gets you pretty far and it falls into Erlang’s “let it crash” philosophy nicely.<p>Honestly, and I realize that this might get me a bit of flack here and that’s obviously fine, but I find type systems start losing utility with distributed applications. Ultimately everything being sent over the wire is just bits. The wire doesn’t care about monads or integers or characters or strings or functors, just 1’s and 0’s, and ultimately I feel like imposing a type system can often get in the way more than it helps. There’s so much weirdness and uncertainty associated with stuff going over the wire, and pretty types often don’t really capture that.<p>I haven’t tried Gleam yet, and I will give it a go, and it’s entirely possible it will change my opinion on this, so I am willing to have my mind changed.
    • sfvisser24 days ago
      I don’t understand this comment, yes everything going over the wire is bits, but both endpoints need to know how to interpret this data, right? Types are a great tool to do this. They can even drive the exact wire protocol, verification of both data and protocol version.<p>So it’s hard to see how types get in the way instead of being the ultimate toolset for shaping distributed communication protocols.
      • tombert24 days ago
        Bits get lost, if you don’t have protocol verification you get mismatched types.<p>Types naively used can fall apart pretty easily. Suppose you have some data being sent in three chunks. Suppose you get chunk 1 and chunk 3 but chunk 2 arrives corrupted for whatever reason. What do you do? Do you reject the entire object since it doesn’t conform to the type spec? Maybe you do, maybe you don’t, or maybe you structure the type around it to handle that.<p>But let’s dissect that last suggestion; suppose I do modify the type to encode that. Suddenly pretty much every field more or less just because Maybe&#x2F;Optional. Once everything is Optional, you don’t really have a “type” anymore, you have a a runtime check of the type everywhere. This isn’t radically different than regular dynamic typing.<p>There are more elaborate type systems that do encode these things better like session types, and I should clarify that I don’t think that those get in the way. I just think that stuff like the C type system or HM type systems stop being useful, because these type systems don’t have the best way to encode the non-determinism of distributed stuff.<p>You can of course ameliorate this somewhat with higher level protocols like HTTP, and once you get to that level types do map pretty well and you should use them. I just have mixed feelings for low-level network stuff.
        • eyelidlessness24 days ago
          &gt; But let’s dissect that last suggestion; suppose I do modify the type to encode that. Suddenly pretty much every field more or less just because Maybe&#x2F;Optional. Once everything is Optional, you don’t really have a “type” anymore, you have a a runtime check of the type everywhere. This isn’t radically different than regular dynamic typing.<p>Of course it’s different. You have a type that accurately reflects your domain&#x2F;data model. Doing that helps to ensure you know to implement the <i>necessary</i> runtime checks, <i>correctly</i>. It can also help you avoid implementing a lot of superfluous runtime checks for conditions you don’t expect to handle (and to treat those conditions as invariant violations instead).
          • tombert24 days ago
            No, it really isn’t that different. If I had a dynamic type system I would have to null check everything. If I have declare everything as a Maybe, I would have to null check everything.<p>For things that are invariants, that’s also trivial to check against with `if(!isValid(obj)) throw Error`.
            • dwb23 days ago
              Sure. The difference is that with a strong typing system, the compiler makes sure you write those checks. I know you know this, but that’s the confusion in this thread. For me too, I find static type systems give a lot more assurance in this way. Of course it breaks down if you assume the wrong type for the data coming in, but that’s unavoidable. At least you can contain the problem and ensure good error reports.
            • eyelidlessness23 days ago
              The point of a type system isn’t ever that you don’t have to check the things that make a value represent the type you intend to assign it. The point is to encode <i>precisely</i> the things that you need to be true for that assignment to succeed <i>correctly</i>. If everything is in fact modeled as an Option, then yes you have to check each thing for Some before accessing its value.<p>The type is a way to communicate (to the compiler, to other devs, to future you) that those are the expected invariants.<p>The check for invariants is trivial as you say. The value of types is in expressing <i>what those invariants are</i> in the first place.
            • the-grump24 days ago
              You missed the entire point of the strong static typing.
              • tombert24 days ago
                I don’t think I did. I am one of the very few people who have had paying jobs doing Scala, Haskell, and F#. I have also had paying jobs doing Clojure and Erlang: dynamic languages commonly used for distributed apps.<p>I like HM type systems a lot. I’ve given talks on type systems, I was working on trying to extend type systems to deal with these particular problems in grad school. This isn’t meant to a statements on types entirely. I am arguing that most systems don’t encode for a lot of uncertainty that you find when going over the network.
                • instig00722 days ago
                  You&#x27;re conflating types with the encoding&#x2F;decoding problem. Maybe your paying jobs didn&#x27;t provide you with enough room to distinguish between these two problems. Types can be encoded optimally with a minimally-required bits representation (for instance: <a href="https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;flat" rel="nofollow">https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;flat</a>), or they can be encoded redundantly with all default&#x2F;recovery&#x2F;omission information, and what you actually do with that encoding on the wire in a distributed system with or without versioning is up to you and it doesn&#x27;t depend on the specific type system of your language, but the strong type system offers you unmatched precision both at program boundaries where encoding happens, and in business logic. Once you&#x27;ve got that `Maybe a` you can (&lt;$&gt;) in exactly one place at the program&#x27;s boundary, and then proceed as if your data has always been provided without omission. And then you can combine (&lt;$&gt;) with `Alternative f` to deal with your distributed systems&#x27; silly payloads in a versioned manner. What&#x27;s your dynamic language&#x27;s null-checking equivalent for it?
                • the-grump24 days ago
                  With all due respect, you can use all of those languages and their type systems without recognizing their value.<p>For ensuring bits don&#x27;t get lost, you use protocols like TCP. For ensuring they don&#x27;t silently flip on you, you use ECC.<p>Complaining that static types don&#x27;t guard you against lost packets and bit flips is missing the point.
                  • tombert24 days ago
                    With all due respect, you really do not understand these protocols if you think “just use TCP and ECC” addresses my complaints.<p>Again, it’s not that I have an issue with static types “not protecting you”, I am saying that you have to encode for this uncertainty regardless of the language you use. The way you typically encode for that uncertainty is to use an algebraic data type like Maybe or Optional. Checking against a Maybe for every field ends up being the same checks you would be doing with a dynamic language.<p>I don’t really feel the need to list out my full resume, but I do think it is very likely that I understand type systems better than you do.
                    • the-grump23 days ago
                      Fair enough, though I feel so entirely differently that your position baffles me.<p>Gleam is still new to me, but my experience writing parsers in Haskell and handling error cases succinctly through functors was such a pleasant departure from my experiences in languages that lack typeclasses, higher-kinded types, and the abstractions they allow.<p>The program flowed happily through my Eithers until it encountered an error, at which point that was raised with a nice summary.<p>Part of that was GHC extensions though they could easily be translated into boilerplate, and that only had to be done once per class.<p>Gleam will likely never live to that level of programmer joy; what excites me is that it’s trying to bring some of it to BEAM.<p>It’s more than likely your knowledge of type systems far exceeds mine—I’m frankly not the theory type. My love for them comes from having written code both ways, in C, Python, Lisp, and Haskell. Haskell’s types were such a boon, and it’s not the HM inference at all.
                    • folex23 days ago
                      &gt; ends up being the same checks you would be doing with a dynamic language<p>Sure thing. Unless dev forgets to do (some of) these checks, or some code downstream changes and upstream checks become gibberish or insufficient.
                      • tombert23 days ago
                        I know everyone says that this is a huge issue, and I am sure you can point to an example, but I haven’t found that types prevented a lot of issues like this any better than something like Erlang’s assertion-based system.
                        • instig00722 days ago
                          When you say &quot;any better than&quot; are you referring to the runtive vs comptime difference?
      • andypants23 days ago
        While I don&#x27;t agree with the OP about type systems, I understand what they mean about erlang. When an erlang node joins a cluster, it can&#x27;t make any assumptions about the other nodes, because there is no guarantee that the other nodes are running the same code. That&#x27;s perfectly fine in erlang, and the language is written in a way that makes that situation possible to deal with (using pattern matching).
    • jakelazaroff24 days ago
      Interesting! I don&#x27;t share that view at all — I mean, everything running locally is just bits too, right? Your CPU doesn&#x27;t care about monads or integers or characters or strings or functors either. But ultimately your higher level code <i>does</i> expect data to conform to some invariants, whether you explicitly model them or not.<p>IMO the right approach is just to parse everything into a known type at the point of ingress, and from there you can just deal with your language&#x27;s native data structures.
      • tombert24 days ago
        I know everything reduces to bits eventually, but modern CPUs and memory aren’t as “lossy” as the network is, meaning you can make more assumptions about the data being and staying intact (especially if you have ECC).<p>Once you add distribution you have to encode for the fact that the network is terrible.<p>You absolutely can parse at ingress, but then there are issues with that. If the data you got is 3&#x2F;4 good, but one field is corrupted, do you reject everything? Sometimes, but often Probably not, network calls are too expensive, so you encode that into the type with a Maybe. But of course <i>any</i> field could be corrupt so you have to encode lots of fields as Maybes. Suddenly you have reinvented dynamic typing but it’s LARPing as a static type system.
        • jakelazaroff24 days ago
          I think you can avoid most issues by not doing what you&#x27;re describing! Ensuring data arrives uncorrupted is usually not an application-level concern, and if you use something like TCP you get that functionality for free.
          • tombert24 days ago
            TCP helps but only to a certain extent; it only guarantees specific ordering of bits during its session. Suppose you have to construct an object out of three separate transmissions, like some kind of multipart style thing. If one of the transmissions gets corrupted or gets errors out from TCP, then you still fall into that maybe trap.
            • obsoleetorr24 days ago
              so you need transactions?<p>I get what your saying, but can&#x27;t you have the same issue if instead you have 3 local threads that you need to get the objects from, one can throw an exception and you only receive 2, same problem
              • tombert24 days ago
                Sometimes, but I am arguing that you need to encode for this uncertainty if you want to make distributed apps work correctly. If you can do transactions for what you’re doing then great, not every app can do that.<p>When you have to deal with large amounts of uncertainty, static types often reduce to a bunch of optionals, forcing you to null check every field. This is what you end up having to do with dynamic typing as well.<p>I don’t think types buy you much in cases with extreme uncertainty, and I think they create noise as a result.<p>It’s a potentially similar issue with threads as well, especially if you’re not sharing data between them, which has similar issues as a distributed app.<p>A difference is that it’s much cheaper to do retries within a single process compared to doing it over a network, so if something gets borked locally then a retry is (comparatively) free.
                • folex23 days ago
                  &gt; static types often reduce to a bunch of optionals, forcing you to null check every field<p>On one end, you write &#x2F; generate &#x2F; assume a deserialisator that checks whether incoming data satisfies all required invariants, eg all fields are present. On the other end, you specify a type that has all the required fields in required format.<p>If deserialisation fails to satisfy type requirements, it produces an error which you can handle by eg falling back to a different type, rejecting operation or re-requesting data.<p>If deserialisation doesn&#x27;t fail – hooray, now you don&#x27;t have to worry about uncertainty.<p>The important thing here is that uncertainty is <i>contained</i> in a very specific place. It&#x27;s an uncertainty barrier, if you wish: before it there&#x27;s raw data, after it it&#x27;s either an error or valid data.<p>If you don&#x27;t have a strict barrier like that – <i>every place</i> in the program has to deal with uncertainty.<p>So it&#x27;s not necessarily about dynamic &#x2F; static. It&#x27;s about being able to set barriers that narrow down uncertainty, and growing number of assumptions. The good thing about ergonomic typing system is that it allows you to offload these assumptions from your mind by encoding them in the types and let compiler worry about it.<p>It&#x27;s basically automatization of assumptions book keeping.
            • jakelazaroff23 days ago
              Why couldn&#x27;t you fix this by validating at the point of ingress? If one of the three transmissions fails, retry and&#x2F;or alert the user.
        • LinXitoW23 days ago
          But your program HAS to have some invariants. If those are not held, simply reject all the data!<p>What the hell is really the alternative here? Do you just pretend your process can accept any kind of data, and just never do anything with it??<p>If you need an integer and you get a string, you just don&#x27;t work. This has nothing to do with types. There&#x27;s no solution here, it&#x27;s just no thank you, error, panic, 500.
          • tombert23 days ago
            You handle that in the validation layer, like millions of people have done with dynamic languages in the past.
    • hayleighdotdev23 days ago
      &gt; Honestly, and I realize that this might get me a bit of flack here and that’s obviously fine, but I find type systems start losing utility with distributed applications. Ultimately everything being sent over the wire is just bits.<p>Actually Gleam somewhat shares this view, it doesn&#x27;t pretend that you can do typesafe distributed message passing (and it doesn&#x27;t fall into the decades-running trap of trying to solve this). Distributed computing in Gleam would involve handling dynamic messages the same way handling any other response from outside the system is done.<p>This is a bit more boilerplate-y but imo it&#x27;s preferable to the other two options of pretending its type safe or not existing.
      • instig00722 days ago
        &gt; handling dynamic messages<p>the dynamic messages have to have static properties to be relevant for the receiving program, the properties are known upfront, and there&#x27;s no &quot;decades-running trap of trying to solve this&quot;.
        • zbentley22 days ago
          &gt; there&#x27;s no &quot;decades-running trap of trying to solve this&quot;.<p>I’m not as certain. The fact that we’ve gone from ASN.1 to COBRA&#x2F;SOAP to protobuf to Cap’n’web and all the million other items I didn’t list says something. The fact that, even given a very popular alternative in that list, or super tightly integrated RPC like sending terms between BEAMs, basic questions like “should optionality&#x2F;absence be encoded differently than unset default values?” and “how should we encode forward compatibility?” have so may different and unsatisfactory answers says something.<p>Not as an appeal to authority or a blanket endorsement, but I think Fowler put it best: <a href="https:&#x2F;&#x2F;martinfowler.com&#x2F;articles&#x2F;distributed-objects-microservices.html" rel="nofollow">https:&#x2F;&#x2F;martinfowler.com&#x2F;articles&#x2F;distributed-objects-micros...</a><p>It absolutely is a decades old set of problems that have never been solved to the satisfaction of most users.
          • instig00722 days ago
            &gt; I’m not as certain. The fact that we’ve gone from ASN.1 to COBRA&#x2F;SOAP to protobuf to Cap’n’web and all the million other items I didn’t list says something.<p>&gt; It absolutely is a decades old set of problems that have never been solved to the satisfaction of most users.<p>ASN.1 wasn&#x27;t in the same problem space with CORBA&#x2F;DCOM, both CORBA and DCOM&#x2F;OLE were heavily invested in a general-purpose non-domain-specific object model representation that would suppot arbitrary embeddings within an open-ended range of software. I suspect this is the unsolvable problem indeed, but I also believe that&#x27;s not what you meant with your comment either, since all the known large-scale BEAM deployments (the comment I originally replied to implied BEAM deployments) operate within bounded domain spaces such as telecom and messaging, where distributed properties of the systems are known upfront: there are existing formats, protocols of exchange, and the finite number of valid interactions between entities&#x2F;actors of the network, the embeddings are either non-existent or limited to a finite set of media such as static images, videos, maps, contacts etc. All of these can be encoded by a compile-time specification that gets published for all parties upfront.<p>&gt; basic questions like “should optionality&#x2F;absence be encoded differently than unset default values?”<p>However you like, any monoid would work here. I would argue that [a] and [] always win over (Option a) and especially over (Option [a]).<p>&gt; and “how should we encode forward compatibility?”<p>If you&#x27;d like to learn if there&#x27;s a spec-driven typed way of achieving that, you can start your research from this sample implementation atop json: <a href="https:&#x2F;&#x2F;github.com&#x2F;typeable&#x2F;schematic?tab=readme-ov-file#migrations" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;typeable&#x2F;schematic?tab=readme-ov-file#mig...</a>
      • tombert23 days ago
        Interesting. Them being honest about this stuff is a point in their favor.<p>I might give it a look this weekend.
    • phplovesong23 days ago
      You seem to have a fundamental misunderstanding about type systems. Most (the best?) typesystems are erased. This means they only have meaning &quot;on compile time&quot;, and makes sure your code is sound and preferrably without UB.<p>The &quot;its only bits&quot; thing makes no sense in the world of types. In the end its machine code, that humans never (in practice) write or read.
      • tombert23 days ago
        I know, but a type system works by encoding what you want the data to do. Types are a metaphor, and their utility is only as good as how well the metaphor holds.<p>Within a single computer that’s easy because a single computer is generally well behaved and you’re not going to lose data and so yeah your type assumptions hold.<p>When you add distribution you cannot make as many assumptions, and as such you encode that into the type with a bunch of optionals. Once you have gotten everything into optionals, you’re effectively doing the same checks you’d be doing with a dynamic language everywhere anyway.<p>I feel like at that point, the types stop buying you very much, and your code doesn’t end up looking or acting significantly different than the equivalent dynamic code, and at that point I feel like the types are just noise.<p>I like HM type systems, I have written many applications in Haskell and Rust and F#, so it’s not like I think type systems are bad in general or anything. I just don’t think HM type systems encode this kind of uncertainty nicely.
        • instig00722 days ago
          &gt; When you add distribution you cannot make as many assumptions<p>You absolutely can make all assumptions relevant to the handling&#x2F;dispatching logic expressed at type-level.<p>&gt; and as such you encode that into the type with a bunch of optionals.<p>Not necessarily, it can be `Alternative f` of non-optional compound types that define the further actions downstream.<p>&gt; Once you have gotten everything into optionals, you’re effectively doing the same checks you’d be doing with a dynamic language everywhere anyway.<p>Not true, your business logic can be dispatched based on a single pattern comparison of the result of the `Alternative f`.
  • erlend_sh23 days ago
    For a fairly advanced example project I can recommend looking at Quickslice, a dev toolkit for making AT protocol applications.<p><a href="https:&#x2F;&#x2F;tangled.org&#x2F;slices.network&#x2F;quickslice" rel="nofollow">https:&#x2F;&#x2F;tangled.org&#x2F;slices.network&#x2F;quickslice</a>
    • idoubtit23 days ago
      For anyone opening the link and wondering why the expected &quot;gleam.toml&quot; is missing: the project contains 2 Gleam sub-projects. The server&#x2F; directory is the BEAM server (no framework) and the client&#x2F; directory is the gleam-compiled-js client (lustre framework).<p>Unfortunately, there are many tests for the server, and none for the client.
  • heliumtera23 days ago
    One of the best things about erlang&#x2F;elixir is the repl driven development&#x2F;manual testing.<p>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&#x2F;elixir to facilitate debugging, like inspect() or dbg().<p>If anyone has experience in this language, what is the mindset with gleam? How you guys debug?
    • __jonas23 days ago
      &gt; If anyone has experience in this language, what is the mindset with gleam? How you guys debug?<p>There is the echo keyword now, which is comparable to elixir&#x27;s dbg(), I use that a lot.<p>Lacking a REPL, what I normally do is make a dev module, like &#x27;dev&#x2F;playground.gleam&#x27; where I&#x27;m testing things out (this is something that the gleam compiler supports, &#x2F;dev is similar to &#x2F;test) and then run it with &#x27;gleam run -m playground&#x27;.<p>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 &#x27;gleam shell&#x27; command. You just need to know the Erlang syntax, and how Gleam modules are named when compiled to Erlang (they use an &#x27;@&#x27; separator, so gleam&#x2F;json becomes &#x27;gleam@json&#x27;).
      • heliumtera23 days ago
        Cool, thanks! I really like Erlang syntax, will try that in the afternoon.
    • lpil23 days ago
      You can use all the BEAM debuggers and tracing tools, and Gleam has a print debugging keyword.<p>Unfortunately there is not yet a plugin for the BEAM debuggers for them to use Gleam syntax.
  • phplovesong23 days ago
    Gleam is nice. However it is still very lacking in the stdlib. You will need lots of dependencies to build something usable. I kind of wish Gleam could target something like Go, then you would have the option to go native without a &quot;heavy&quot; VM like the BEAM.
    • cmoski23 days ago
      Surely the BEAM is one of the major selling points.
      • phplovesong21 days ago
        Not for executables. Not everything needs an runtime.
    • lpil23 days ago
      In a world with package management there’s no practical difference between the core modules being in one package or multiple packages.
    • Papipo23 days ago
      [dead]
  • azhenley24 days ago
    A recent post about using Gleam for Advent of Code:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=46255991">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=46255991</a>
  • lxdlam24 days ago
    I still suspect the effectiveness of plugging in a type system patch to a complete system, like typescript to javascript. We still observe so many `as any` or `as unknown as` at every corner.<p>Despite of the suspicion, Gleam provides a better and elegant syntax for those who are not familiar with Erlang or functional programming languages, which I loved most.
    • giacomocava24 days ago
      There’s no “unknown” or “any” in Gleam, it’s not possible to cheat the type system that way
    • __jonas23 days ago
      That doesn’t really apply to Gleam, it’s not a type syntax for another language that can be stripped, it’s its own language that compiles to Erlang and JS
  • kunley23 days ago
    One of programming languages with political agenda.
    • YorickPeterse23 days ago
      The type of people complaining about this are usually the people you don&#x27;t want in your community to begin with, so I doubt Gleam is missing out here.
      • kunley23 days ago
        Or the contrary, the kind of people finding this cool is usually the people you don&#x27;t want in your community. Nice to have clarity about who doesn&#x27;t want to even bother to deal with whom.
      • self_awareness23 days ago
        This is a perfect example of what your club understands as &quot;friendly&quot; and &quot;inviting&quot;.<p>It always ends the same way, always.
    • lexx23 days ago
      Since when not being an asshole is a political agenda?
      • tinfoilhatter23 days ago
        This is a terrible take. Just because your personal opinions &#x2F; morals &#x2F; values don&#x27;t align with others in a community, doesn&#x27;t automatically make you an asshole. If people can&#x27;t handle others having differing opinions, they have some growing up to do and shouldn&#x27;t be leading a community.
        • yellowapple23 days ago
          When one of those “differing opinions” is “you should be oppressed”, then yeah, that kind of does automatically make someone an asshole.
          • tinfoilhatter22 days ago
            Someone not being a BLM supporter, doesn&#x27;t equate to them holding the opinion that anyone should be oppressed. Only someone who views everything through a binary lens &#x2F; is trapped in dualistic thinking, would suggest such a thing. One shouldn&#x27;t automatically claim someone else is an asshole for not agreeing to think the exact same way they do.
            • akkad3317 days ago
              It didn&#x27;t say BLM supporter. It says black lives matter. If you take offence to that, that&#x27;s a you problem
        • Papipo23 days ago
          [dead]
    • tkzed4923 days ago
      human rights are not politics
      • self_awareness23 days ago
        Every &quot;right&quot; is politics.<p>A set of &quot;rights&quot; comes from current law.<p>And Code of Law is an invention like everything else.
        • tkzed4921 days ago
          let me clarify the intent of my comment then. Human rights is not a &quot;two-sides&quot; issue to be debated. If you attempt to reduce an affirmation of human rights for all people to a &quot;political agenda&quot;, I will call out your conservative dogwhistle. I don&#x27;t care how that&#x27;s received.
    • KevinMS23 days ago
      red flag for future drama that might cause problems, one of the reasons I walked away
    • lpil23 days ago
      All open source projects are political by their very nature.
      • self_awareness23 days ago
        But not every open source project has a political agenda.
        • lpil23 days ago
          All open source projects have a political agenda. That&#x27;s the purpose of the licence, to force certain behaviour.
          • self_awareness23 days ago
            Behavior related to the project maybe, but not behavior how should users behave every day in areas that are completely unrelated.<p>&quot;You are welcome to our community only if your hair is long and you drive a yellow car, if you&#x27;re not then you&#x27;re not welcome.&quot; is pretty insane IMO.
            • __jonas23 days ago
              How is it insane to only welcome people to a community that act respectful towards other people? That seems like a really good way to build a solid community.
              • tinfoilhatter23 days ago
                That&#x27;s not the case with the Gleam community though. Unless you&#x27;re willing to adopt their opinions &#x2F; values &#x2F; moral stance on certain issues, you won&#x27;t be treated respectfully - you will be ostracized for having an unpopular opinion or view on a given issue.<p>It is a totally insane way to run a project, and it&#x27;s quite obvious the Gleam community is run by persons who are unable to handle people with opinions that differ from their own.<p>It does sound like a great way to build an echo chamber.
                • okkdev23 days ago
                  Unpopular opinion like... being racist?
                  • tinfoilhatter23 days ago
                    Ah yes, because not automatically supporting grifts like the BLM movement (which enriched the founders and did very little for the black community at large), makes someone a racist - I totally forgot!
                    • DrNefario23 days ago
                      Black Lives Matter is objectively not a grift. There is an argument to be made regarding &quot;BLM Global Network&quot;, but calling them BLM is like saying all vegans support PETA.<p>Regardless, that&#x27;s irrelevant to the discussion at hand. You don&#x27;t have to change your beliefs to be part of the Gleam community, you just have to not be an asshole about them. If you&#x27;re the kind of person that starts an argument any time BLM is mentioned, is it understandable why they wouldn&#x27;t want you in their community?
                      • self_awareness23 days ago
                        &gt; Black Lives Matter is objectively not a grift.<p>There we go again. I think that you people would gain if you&#x27;d read what does it mean if something is objective and also the meaning of &quot;subjective&quot;. Either you live in social bubbles or you&#x27;re intentionally ignoring anything that&#x27;s not in line with your ideology. I&#x27;m actually not surprised this is the case, since you&#x27;re not allowing people outside of your bubbles in your community spaces. You cherish diversity, yet in reality you&#x27;re the most ideologically closed social group that I know. Letting people in only if it&#x27;s easy for you is very far from &quot;welcoming&quot;.<p>You&#x27;re accusing the parent of being an asshole, yet you dismiss his arguments based on false &quot;objectivity&quot;. And because of your &quot;objectivity&quot;, which is clearly subjective, you reinforce the argument that parent is not welcome in your community. How is this welcoming?<p>I mean I know the answer.
                        • DrNefario22 days ago
                          I explicitly did not call them an asshole, it was very much conditional on the way they choose to act inside these communities.<p>Regarding your accusation of subjectivity, I was addressing the misnomer that BLMGN is equivalent to the BLM movement - it&#x27;s not. BLMGN might be a grift for all I know, but that cannot be used to call the entire BLM movement a grift. By definition a grifter is aware that they&#x27;re grifting, do you believe that every BLM protest was organised by someone looking to make a profit? If not, BLM is objectively not a grift.<p>On the topic of being &#x27;welcoming&#x27;, clearly you don&#x27;t understand the paradox of tolerance. Is it intolerant to exclude Nazis from a community? Obviously not, despite what the Nazis would claim, because Nazis make the communities they&#x27;re involved in intolerable to anyone that&#x27;s not a Nazi.<p>Thus, if you want to create an inclusive community, you have no choice but to exclude certain groups of people.<p>It&#x27;s actually pretty simple to figure out which groups should be excluded: - Transphobes are constantly imposing their beliefs on trans people, trans people want equal rights. - White supremacists are constantly imposing their beliefs on black people, black people want equal rights. - Homophobes are constantly imposing their beliefs on gay people, gay people want equal rights. Do I need to continue?<p>To be clear, I barely interact with these &quot;safe&quot; communities - pretty much only when I need some help with my code. It&#x27;s very easy to hide your beliefs if you want to participate, I could be a raging homophobe for all they know because I&#x27;ve never talked about gay people in there.<p>You say the they don&#x27;t tolerate anyone outside their bubbles, but anyone is free to join and start getting support, there&#x27;s no purity test. So do you mean they don&#x27;t tolerate people questioning trans rights in a support channel? Because obviously they don&#x27;t. If you want to start an argument there are plenty of appropriate places to do so, places that don&#x27;t make people feel unsafe.
                          • 1515522 days ago
                            &gt; Transphobes are constantly imposing their beliefs on trans people, trans people want equal rights<p>What happens if you don&#x27;t use the correct pronouns someone has declared for themselves?<p>Is this not &quot;imposing beliefs&quot; on other people?<p>This goes far beyond &quot;tolerance&quot;: you <i>must</i> be an active, enthusiastic participant or face punishment.<p>&gt; It&#x27;s very easy to hide your beliefs if you want to participate<p>That&#x27;s the point: only one set of ideas are allowed, everyone else must hide, regardless of forum.<p>&gt; anyone is free to join and start getting support<p>Try espousing ideals contrary to theirs in completely unrelated venues and see how much support you get sans anonymity.<p>&gt; places that don&#x27;t make people feel unsafe.<p>&quot;Feeling unsafe&quot; is an outstanding weapon to crush behavior one doesn&#x27;t like. Doesn&#x27;t even require logic: it&#x27;s literally a feeling.
                            • DrNefario21 days ago
                              &gt; What happens if you don&#x27;t use the correct pronouns someone has declared for themselves? Is this not &quot;imposing beliefs&quot; on other people?<p>That&#x27;s a false equivalence. All that&#x27;s asked of you is to not misgender or deadname them, whereas transphobes are actively making it impossible for trans people to freely live as themselves.<p>It&#x27;s also about not being a dickhead. If you met an autistic kid, and were told that he becomes incredibly distressed if you don&#x27;t refer to him as &#x27;Mr.&#x27;, would you at least make an effort to call him that? It doesn&#x27;t matter how ridiculous you think calling a kid &#x27;Mr.&#x27; is, he isn&#x27;t imposing his beliefs on you by asking that of you. If someone decides that their community will be a safe place for the kid to be, then of course they&#x27;re justified in removing you if you refuse to call him &#x27;Mr&#x27;.<p>Regardless of whether you believe trans people are mentally ill or just a normal part of humanity, not misgendering them is a simple courtesy to avoid causing a fellow human distress.<p>&gt; &quot;Feeling unsafe&quot; is an outstanding weapon to crush behavior one doesn&#x27;t like. Doesn&#x27;t even require logic: it&#x27;s literally a feeling.<p>How is this relevant to a programming language community? Who, in your scenario, is doing the crushing?
                              • 1515521 days ago
                                &gt; not misgender or deadname them<p>In other words: be an active, enthusiastic participant in someone&#x27;s beliefs regardless of your own.<p>&gt; How is this relevant to a programming language community?<p>Easy example: &quot;I feel unsafe because DHH doesn&#x27;t like that his country has been overrun by immigrants, he must be removed!&quot;
                          • self_awareness22 days ago
                            For the sake of simplicity, and to detach our feelings from this subject, let&#x27;s assume that Ω-GN is a grift. Ω is a superset of Ω-GN. We cannot conclude that Ω is a grift solely because a subset (Ω-GN) is a grift. However, can we objectively say that Ω is <i>not</i> a grift just because there are some instances within Ω that are not grifts? Clearly, there are also instances within Ω that are grifts, since Ω-GN (a subset of Ω) is a grift by our assumption. Therefore, the existence of both grift and non-grift instances in Ω means we cannot categorically label Ω as either a grift or not a grift based solely on its subsets.<p>Yet you say that objectively it&#x27;s not a grift because there is at least 1 instance of a non-grifting event in Ω. Even Kenneth Copeland _sometimes_ is right about _something_, can we say that objectively he&#x27;s not a liar because _there was at least 1 instance of him telling the truth_? I think not.<p>Also, you people use this word, &quot;nazi&quot;, but do you actually know what are Nazis? German National-Socialists. Even the name &quot;NAZI&quot; is taken from German language. So if you ask me &quot;what is wrong with disliking nazis&quot;, yet you use some artificial and historically wrong definition of a nazi, then I&#x27;m telling you that the problem is with you people using &quot;nazis&quot; for others who disagrees with you. I probably am a Nazi in someone&#x27;s eyes, because I&#x27;m opposed to trans-women participating in women&#x27;s sports. In reality, my grandfather fought with the actual nazis which existed in real world, not in your imagination.<p>&gt; Thus, if you want to create an inclusive community, you have no choice but to exclude certain groups of people.<p>Yeah, this is how I understand it as well. People want easy inclusivity, a mono-themed style of thinking, and diversity only within their own strictly defined boundaries. I interpret this as a contradiction and a lie: diversity among selected groups is not true diversity, and inclusivity limited to chosen pools is not genuine inclusivity. For me there is absolutely no difference between this and a situation where whites stick to whites, blacks stick to blacks, etc.<p>If something is marked as &quot;LGBTQ+ friendly&quot; then I&#x27;m all fine -- it&#x27;s very understandable and I know what I&#x27;m dealing with. But if something is &quot;inclusive&quot; then I automatically know I&#x27;m not in the target audience, because the sole definition of &quot;include&quot; is already loaded. The language already contains words with different meanings. For me this means &quot;we&#x27;re so closed, we even use our own definition of &#x27;inclusion&#x27; to not think about the outside world&quot;.
                            • __jonas22 days ago
                              You seem quite passionate about this, which I find difficult to understand, maybe because I’m not as deeply immersed in American political culture as you (I had no idea people see BLM as an organisation rather than a movement &#x2F; ethical stance) but I’m curious: Is it really just about language for you?<p>If the section was phrased as “We are LGBTQ+ friendly and do not tolerate transphobia or racism” that would feel more welcoming to you?<p>At the end of the day, it’s a programming language community. If you join and ask a question about how to call functions from Erlang, you’ll definitely get an answer. If you join and bring up your feelings about trans women in sports you’ll most likely be asked to stop or removed, as it’s just not a space where that kind of discussion is welcome.<p>But why should it be?
                              • 1515522 days ago
                                &gt; If the section was phrased as “We are LGBTQ+ friendly and do not tolerate transphobia or racism” that would feel more welcoming to you?<p>It&#x27;s very, very easy to turn ideas into &quot;racism&quot; or &quot;transphobia.&quot;<p>&gt; it’s just not a space where that kind of discussion is welcome<p>These folks believe <i>no</i> space exists where this type of discussion is welcome and will deny participation to anyone not towing the party line in all forums - not just their little fiefdom.
                              • self_awareness22 days ago
                                It&#x27;s not American, it&#x27;s global. I&#x27;m not American, yet I&#x27;m judged by the these political culture quirks. The creator of Gleam is not American, he&#x27;s from UK. Trans-movements aren&#x27;t American, they&#x27;re in my country too, and I&#x27;m interested somewhat in the politics of my own country. Also parent posts differentiated between BLM and BLM-GN, where one is a &quot;movement&quot;, and the other one is supposedly a marxist organization, so I guess there&#x27;s a difference too.<p>&gt; Is it really just about language for you?<p>No. I mean, I&#x27;m not a murderer. I&#x27;m not a thief. I only do to others what I want others to do to me. I don&#x27;t want to be treated differently because of my race or my gender, therefore I don&#x27;t want to treat others differently because of those things. Yet, I actually am treated differently because of it; and it&#x27;s mostly by those people who &quot;fight racism&quot; and &quot;fight transphobia&quot;. Who are virtue signalling left and right how tolerant they are. How inclusive they are. When a black director says &quot;I&#x27;ll never hire a white main actor&quot; then it&#x27;s OK. But when I point out he said it, then I&#x27;m a racist -- this is how it works today. So:<p>&gt; If the section was phrased as “We are LGBTQ+ friendly and do not tolerate transphobia or racism” that would feel more welcoming to you?<p>No, because it&#x27;s too easy to frame my views as transphobic or racist, like I&#x27;ve written in my previous paragraph. And this is the language part. Using &quot;master&quot; branch in git today is a manifestation of racism. People fork &quot;rubocop&quot; projects because it has a &quot;cop&quot; in the name; and they want to defund the police. I think that police is needed because without it the law wouldn&#x27;t exist? Then I&#x27;m a nazi. When I&#x27;m asking questions about whether someone&#x27;s wheels were spinning during sudden acceleration, I&#x27;m being called an ICE-lover.<p>You might see me being passionate, but I&#x27;m merely a product of current political polarity.<p>&gt; If you join and bring up your feelings about trans women in sports you’ll most likely be asked to stop or removed, as it’s just not a space where that kind of discussion is welcome. But why should it be?<p>No, I will be removed only when I say that it&#x27;s not OK. I will be upvoted when I&#x27;ll say that it&#x27;s OK. But more generally, that&#x27;s a good question, but I don&#x27;t know the answer, ask Ipil, he sees the necessity. I do think that there&#x27;s no reason why it should be a place for discussion of trans-rights and racism and I wouldn&#x27;t want to discuss it there (not even here to be honest). So why it&#x27;s being manifested on the main page, before the language tour and before the newsletter, since it&#x27;s clearly not a place for these topics?
                            • DrNefario22 days ago
                              I used &#x27;Nazi&#x27; in reference to the series of tweets about a polite Nazi. (Forgive the Reddit link) <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;TalesFromYourServer&#x2F;comments&#x2F;hsiisw&#x2F;kicking_a_nazi_out_as_soon_as_they_walk_in&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;TalesFromYourServer&#x2F;comments&#x2F;hsiisw...</a><p>Take it to mean a literal straight out of 1942 National Socialist if you like, it doesn&#x27;t change what I was trying to convey.<p>If you want a historical comparison to BLM, how about the suffragettes. I can guarantee that there were grifters looking to make money off the movement, which would be a subset of it, but I think it&#x27;s quite fair to say the suffragettes were objectively not grifters.<p>I would also say that Christianity is objectively not a grift, despite the fact that there are many grifters within the faith. If the core ideas of a movement are spread by people that truly believe in them, and are not controlled by any individual, then how exactly could it qualify as a grift?<p>Legitimately, I don&#x27;t understand how a decentralised set of ideas could be a grift. Do you have any examples?<p>&quot;Diversity only within their own strictly defined boundaries&quot; is exactly right, but you don&#x27;t seem to understand that those boundaries are what let&#x27;s diversity thrive. Without rules against bigotry, LGBTQ+ people are far less able to express themselves due to the increased scrutiny from people that refuse to accept them.<p>When there are people in a community that denegrate others for being themselves it creates a toxic environment where being different makes you a target, so everyone either falls in line or leaves.
                              • self_awareness22 days ago
                                It&#x27;s really funny, because that&#x27;s how I portray inclusive people. They&#x27;re nice until they bring friends. And later friends require changing the vocabulary and I don&#x27;t even know how to communicate with them. But I&#x27;m not calling them soviets.<p>I&#x27;ve literally said in my previous message that in my opinion it can&#x27;t be said that BLM is a grift, and can&#x27;t be said that it is not a grift. It&#x27;s not even about a grift, it&#x27;s about objective statements.<p>I guess we have to agree to disagree, since it&#x27;s apparent we&#x27;re not even reading ourselves properly.<p>By the way, one date of importance when it comes to nazism for me is 1st September 1939. German nazis marked a whole country for extermination, but you&#x27;re having a good time by comparing children with computers from a Reddit story to nazis.
              • self_awareness23 days ago
                Well it&#x27;s not insane to only welcome people that act respectful towards other people.<p>We&#x27;ll see if this will be a solid community I guess.
                • okkdev23 days ago
                  It already is :)
            • lpil23 days ago
              How you behave in community spaces is 100% related to the project.<p>I agree, that would be very silly. I don&#x27;t think you can compare not tolerating racists to mandating a particular car colour.
              • self_awareness23 days ago
                SQLite promotes Christian values but I don&#x27;t think that they have a problem that a satanist is using their software.<p>It depends on your definition of racism I guess.
                • yellowapple23 days ago
                  I don&#x27;t think Gleam has a problem if Kenneth Copeland is using their software, either. The problem arises when you mistreat community members in community spaces; I can&#x27;t speak for DRH, but I&#x27;m reasonably sure if someone waltzed into SQLite&#x27;s forum denigrating the devs and their religious beliefs, there wouldn&#x27;t be much hesitation in removing that person from said forum.
                  • self_awareness23 days ago
                    &gt; I don&#x27;t think Gleam has a problem if Kenneth Copeland is using their software, either.<p>I wouldn&#x27;t be so sure. In leftist projects, there are <i>countless</i> of examples why someone is <i>not</i> welcome based on their personal beliefs, and because of this I&#x27;m cautiously suspicious about Gleam.<p>If I&#x27;m wrong then the Internet is a better place than I think it is, which would be a good thing. If I&#x27;m right, then at least I&#x27;ll dodge another bullet. Either way I win I guess.
                • lpil20 days ago
                  Gleam is the same as SQLite, we have some community values on the website but the licence doesn’t exclude anyone from using the software.
                  • Alupis20 days ago
                    It is, however, unfortunate that a single statement on the Gleam homepage generates this exact conversation every time Gleam trends somewhere.<p>It&#x27;s your project, and your community, of course, and I fully respect that. However it doesn&#x27;t seem good that this statement creates so much friction and controversy for Gleam over and over.<p>After all, none of the statement&#x27;s topics would be &quot;on-topic&quot; for any of the Gleam community hangouts. For instance, it would be equally off-topic for someone to discuss supporting <i>or</i> hating Nazis.<p>Perhaps moving the statement to a formal Code of Conduct page would be a &quot;have cake and eat it too&quot; type thing.<p>The Gleam community is wonderful, and you&#x27;ve done an incredible job building it. But I don&#x27;t suspect the homepage statement had anything to do with that.
                    • lpil19 days ago
                      It only happens on hacker news. Elsewhere it is not mentioned or it is praised.<p>Gleam does have a formal code of conduct.
    • UnknownUser123423 days ago
      Not having a crappy app is my political agenda.
  • qwertfisch23 days ago
    As with many languages that compile to a VM, I always ask myself: that’s all nice, but how do I interact with anything OUTSIDE of my program?<p>Can I do networking? Can I do system calls to my OS? Display graphics and sound? Can I import a C library that will do all that and call its functions? And if so, how? I just can’t see it from any documentation. Yes, I can call functions from other BEAM-based languages, but then I’m going in circles.
    • __jonas23 days ago
      If you mean specifically on the BEAM (ignoring JS runtimes), the two options are ports and NIFs, both of which unfortunately have their drawbacks.<p>The Erlang docs on this are here: <a href="https:&#x2F;&#x2F;www.erlang.org&#x2F;doc&#x2F;system&#x2F;overview.html" rel="nofollow">https:&#x2F;&#x2F;www.erlang.org&#x2F;doc&#x2F;system&#x2F;overview.html</a>
      • qwertfisch23 days ago
        Thank you for the docs and explanation.
  • akanapuli23 days ago
    I am really interested in whether anyone has evaluated the performance of Gleam? The language is simple, easy to understand, like `Go` for example, but is it really performant like Go, or does it have any performance cost since it runs on top of a VM?
    • onlyrealcuzzo23 days ago
      I&#x27;m working on a similar language.<p>The facts about Gleam:<p>1. It runs on the BEAM - exceptionally slow compared to Go, but infinitely scalable by default in a way that Go is not - in practice, very rarely matters.<p>2. They will argue the slowness doesn&#x27;t matter -&gt; if ~97% of time is spent waiting on I&#x2F;O -&gt; you can be 10x slower and that means you&#x27;re only ~30% for typical applications -&gt; it&#x27;s easier to scale more machines on the BEAM than it is to scale a single machine -&gt; this is true, but largely irrelevant in Go&#x27;s core market -&gt; it&#x27;s almost as if Go was built by smart people.<p>3. The reality is that predictability is much harder to guarantee once you start moving components to different machines. Correct, predictable distributed computing makes correct, predictable concurrent programming look easy.<p>4. The BEAM does not allow shared memory, Go does (unsafely). There are many cases where the performance impact of this is night and day (why Go ultimately allowed unsafety).<p>I assume Gleam claims to make this <i>just work</i>. But as someone working in this space, this seems like trying to abstract away the difference between taking a boat to Europe or a plane.<p>Gleam may be nice if you&#x27;re building something for the BEAM (massively scalable single app that <i>just makes sense</i> with the actor model, typically chat &#x2F; telecom).<p>Though I question why you would use it over Elixir.<p>Go&#x27;s syntax kind of blows, but it is so <i>INCREDIBLY</i> good at what it does, that you are not going to beat Go by just having better syntax and being &quot;infinitely scalable&quot; by default.<p>In practice, Go is easily <i>scalable enough</i> for almost anyone. If it isn&#x27;t congrats, you&#x27;re a $10B+ company. You can afford to rearchitect and optimize your hot paths.
    • packetlost23 days ago
      I would look at benchmarks for Erlang and Elixir to get a rough idea of how Gleam performs at runtime. It&#x27;s faster than Python generally, but not by a lot. It&#x27;s for this reason that I really wish Gleam had a LLVM or Golang backend instead of JS &#x2F; BEAM.<p>Here&#x27;s some webserver benchmarks that cover a handful of popular languages: <a href="https:&#x2F;&#x2F;stressgrid.com&#x2F;blog&#x2F;webserver_benchmark&#x2F;" rel="nofollow">https:&#x2F;&#x2F;stressgrid.com&#x2F;blog&#x2F;webserver_benchmark&#x2F;</a><p>I believe BEAM got a JIT compiler built into the runtime not too long ago (after that post, iirc), so it might perform a bit better now.
  • lexx23 days ago
    Gleam is ready and is amazing. We use gleam as the main language in our company
    • Lyngbakr23 days ago
      What&#x27;s the product&#x2F;use case?
      • lexx23 days ago
        We are a web agency, so client projects that are open to use a new language and our products like:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=46530011">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=46530011</a>
  • pjmlp23 days ago
    Glean is interesting from language nerd point of view, however I never had a reason to use Erlang at work, and probably never will, and I suspect that relates to most folks.
    • misiek0823 days ago
      It’s funny how we avoid the technologies we can’t complain about much. Seeing an Elixir projects on production I always wonder „why we are not using it more often”. More talking about Elixir here.<p>For Elixir I saw a simple distributed job scheduler - it was dead simple in code and was ripped, because it didn’t require maintenance for ~8 years just working without issue and people who knew anything about it left company or switched part of company and acted as they forgot everything.<p>The other example is medium sized (in terms of features and code) web app - maintained by &lt;30 people now, delivering more than 800 people at the other company, no stress, no issues and with great DX because of the BEAM (other company is drowning in JVM based nano-services).
      • pjmlp23 days ago
        The way many of us get work assignments is:<p>- Have to deploy product XYZ (because we don&#x27;t write everything from scratch)<p>- Need to extend said product<p>- Use one of the official SDKs, because we aren&#x27;t yak shaving for new platforms<p>Thus that is how we end up using the languages we kind of complain about.<p>To be fair, languages like Elixir and Gleam do exist, because too many complain about Erlang, which me with my Prolog background see no issues with.
        • wink23 days ago
          I think the problem is that there is Erlang, the syntax, then Erlang, the features, and then there&#x27;s OTP. It&#x27;s a bit much all in one if you might have not done FP before, and then only with C-like syntax languages (e.g. Java).<p>When I joined an Erlang project I also had some aha moments with the syntax and how stuff is structured, and I found Elixir much nicer to work with (without any real Ruby experience). I don&#x27;t want to say Erlang is not modern enough, but some things felt like they were around half the work (and more enjoyable) with some Elixir libraries (vastly bigger ecosystem than pure Erlang), for example handling XML.<p>It might be a bit simplistic, but I don&#x27;t think you really lose anything meaningful when using Gleam or Elixir over pure Erlang. Just like you don&#x27;t lose anything when using Clojure or Kotlin over pure Java.
    • gregors23 days ago
      I suspect you&#x27;ve also had zero reason to use the vast majority of programming languages at work in any meaningful capacity outside of the normal top ones. That&#x27;s normally how tech decisions work. That certainly doesn&#x27;t negate the possible benefits of other languages.<p>Others use Erlang and Elixir quite effectively and successfully in several billion dollar businesses apart from nerd aspects. It will be interesting to me personally if Gleam also has its day in the sun.
  • liampulles23 days ago
    I&#x27;m now working on a real world legacy Elixir project in my day job and man oh man do I miss well defined types. Coming from Go, it makes a huge difference to my productivity when I&#x27;m able to click through fields and find usages of things, which comes down to the excellence of the Go language server. I know that the Elixir language server can infer some of this, but the language server in my experience is very fickle and flat out doesn&#x27;t work if you have an older Elixir project.<p>I&#x27;m paying keen attention to Gleam to see if it can provide a robust development experience in this way, in the longer term.
    • mercer23 days ago
      Do the big updates to Elixir&#x27;s type system help at all? afaik the most recent update added a huge amount of coverage that should extend to older code automatically.
      • liampulles23 days ago
        I don&#x27;t want to go into details of my work project too much, but the fundamental issue is that ElixirLS only supports 1.12+ (at least last time I checked).
  • tekkk23 days ago
    Well. Coming from TS, Gleam just wasn&#x27;t&#x2F;isn&#x27;t my jam. It&#x27;s a nice programming language research project, but it just goes against the grain for me a little too much. All the made-up rules early returning always being weird `use` call, the type boilerplate—no inline object types as I remember. Lot of inventions that just makes me go &quot;why?&quot; Like the opposite ideology of Go. And yes I&#x27;ve used Haskell before (didn&#x27;t like it) and Rust (kinda like it) and others in smaller quantity.<p>I am more excited about making things rather than fetishizing about some language paradigms so, I acknowledge that Gleam just isn&#x27;t for me. I did give me the insight that for me, it might be the best to stick with the common denominator languages for the foreseeable future.
    • css_apologist23 days ago
      learning curve isn’t always a bad thing<p>to effectively critique a language you must understand the design trade offs made
  • brightball23 days ago
    Saw a great talk about Gleam last year at the Carolina Code Conference.<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;vyEWc0-kbkw?si=AayavKhhoqO5Mydh" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;vyEWc0-kbkw?si=AayavKhhoqO5Mydh</a>
  • s_trumpet23 days ago
    I have worked extensively on Elixir in the past and had a decent enough time, some warts aside. How different is programming in Gleam in the day-to-day apart from type safety?
  • stanlogin24 days ago
    I think they have an issue on homepage: there is no &quot;download&#x2F;get start&quot; link. All big buttons link to a tour page, and stopped there.
    • zethsg24 days ago
      I was able to find that in the Docs <a href="https:&#x2F;&#x2F;gleam.run&#x2F;documentation&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gleam.run&#x2F;documentation&#x2F;</a> ( from gleam.run )
      • dematz23 days ago
        tbf <a href="https:&#x2F;&#x2F;gleam.run&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gleam.run&#x2F;</a> -&gt; <a href="https:&#x2F;&#x2F;gleam.run&#x2F;documentation&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gleam.run&#x2F;documentation&#x2F;</a> -&gt; <a href="https:&#x2F;&#x2F;gleam.run&#x2F;getting-started&#x2F;installing&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gleam.run&#x2F;getting-started&#x2F;installing&#x2F;</a> is two clicks, maybe it should only be one<p>although the playground is a much gentler introduction than installing gleam+erlang+rebar3
  • kristopolous23 days ago
    I&#x27;ve always thought this would be an excellent language for coding agents.
    • kevsim23 days ago
      To use to write coding agents or for coding agents to write code in?
  • librasteve23 days ago
    thought I’d try the showcase example in Raku (<a href="https:&#x2F;&#x2F;raku.org" rel="nofollow">https:&#x2F;&#x2F;raku.org</a>), so this Gleam<p><pre><code> import gleam&#x2F;io pub fn main() { io.println(&quot;hello, friend!&quot;) } </code></pre> becomes this Raku<p><pre><code> say “hello, friend!” </code></pre> well maybe you really want to have a main() so you can pass in name from the command line<p><pre><code> #!&#x2F;usr&#x2F;bin&#x2F;env raku sub MAIN($name) { say &quot;hello, $name!” }</code></pre>
    • preommr23 days ago
      Oh God, they actually put that awful logo front and center.<p>I&#x27;d always thought it would be a go-like thing where the put the mascot away for everything except for the minor hero section or buried in the footer.<p>RIP Perl.
      • librasteve23 days ago
        lol - I had the temerity to raise the &quot;how about a new logo&quot; topic last week and it&#x27;s going to time time for me to (hopefully) convince the community of the need to let go
    • okkdev23 days ago
      Raku looks sweet, but what is the point of this comparison? :)
      • librasteve23 days ago
        I love coding in Raku - and I am sure that Gleam is nice too. But I get the feeling that Raku is underappreciated &#x2F; dismissed by many due to the perl5 &#x2F; perl6 history. So my thinking is, when I see a new language showcase an example on their website, presumably a carefully chosen snippet that showcases their language at its best, I like to see how Raku compares to that.<p>You know the take-aways from the comparison are quite instructive:<p>- do I need to import the io lib? (shouldn&#x27;t this just be included)<p>- do I need a main() in every script? (does this rule out one liners like `&gt; raku -e &quot;say &#x27;hi&#x27;&quot;`)<p>- is `io.println` quite an awkward way to spell `print`?<p>I am not making the case that these are right or wrong language design decisions, but I do think that they are instructive of the goals of the designers. In the case of raku its &quot;batteries included&quot; and a push for &quot;baby raku&quot; to be as gentle on new coders as eg. Python.
        • brabel23 days ago
          The differences you mentioned are advantageous for Gleam depending on what you want. Like, having to namespace symbols instead of implicitly importing symbols makes it explicit where things come from which is good. Needing main, same thing. But the big differences are that Gleam is both functional, so everything is immutable, and fully typed safe. Completely the opposite of Perl&#x2F;Haku so comparing these languages makes zero sense. If you don’t need types or functional programming you probably would just never use Gleam.
        • __jonas23 days ago
          I think comparing &#x27;printing hello world&#x27; programs isn&#x27;t particularly useful, except that from how you describe it, Raku sounds more like a scripting language, which Gleam is not.<p>In comparison with Gleam, I would be more interested to see how good Raku is at helping the programmer prevent errors through static analysis, how easy it is to build with concurrency, how much value the language puts into being easy to understand and reason about, and whether it can run on the server as well as compile to JS.<p>I have no negative predisposition, I don&#x27;t really care about the history of pearl or whatever, I have looked at Raku before but I find the syntax very foreign, and the fact that it seems to (maybe optionally?) incorporate glyphs that I can&#x27;t easily type with a keyboard.<p>I love the butterfly though, so I&#x27;d love to get to know the language more.
        • tasuki23 days ago
          &gt; But I get the feeling that Raku is underappreciated &#x2F; dismissed by many due to the perl5 &#x2F; perl6 history.<p>Yes that would be me! If you like making these comparisons, can you write the following pattern matching in Raku?<p><pre><code> import gleam&#x2F;io pub type Fish { Starfish(name: String, favourite_colour: String) Jellyfish(name: String, jiggly: Bool) } pub fn main() { handle_fish(Starfish(&quot;Lucy&quot;, &quot;Pink&quot;)) } fn handle_fish(fish: Fish) { case fish { Starfish(_, favourite_colour) -&gt; io.println(favourite_colour) Jellyfish(name, ..) -&gt; io.println(name) } }</code></pre>
          • librasteve23 days ago
            sure...<p><pre><code> role Fish { has Str $.name } class Starfish does Fish { has Str $.favourite-colour; } class Jellyfish does Fish { has Bool $.jiggly } sub handle-fish(Fish $fish) { given $fish { when Starfish { say .favourite-colour } when Jellyfish { say .name } } } handle-fish Starfish.new: :name(&quot;Lucy&quot;), :favourite-colour(&quot;Pink&quot;); </code></pre> I would probably reach for multi-dispatch...<p><pre><code> role Fish { has Str $.name } class Starfish does Fish { has Str $.favourite-colour; } class Jellyfish does Fish { has Bool $.jiggly } multi sub handle-fish(Starfish $fish) { say $fish.favourite-colour } multi sub handle-fish(Jellyfish $fish) { say $fish.name } handle-fish Starfish.new: :name(&quot;Lucy&quot;), :favourite-colour(&quot;Pink&quot;);</code></pre>
            • librasteve23 days ago
              Here&#x27;s the other Gleam concurrency example in Raku for good measure:<p><pre><code> my @promises; sub MAIN() { # Run loads of green threads, no problem for ^200_000 { spawn-greeter($++); } await Promise.allof(@promises); } sub spawn-greeter($i) { @promises.push: start { say &quot;Hello from $i&quot;; } }</code></pre>
              • tasuki22 days ago
                Again, thanks!
            • tasuki22 days ago
              That doesn&#x27;t look half bad - thank you!
  • Kindercrusher23 days ago
    [dead]
  • rapnie24 days ago
    Now here&#x27;s a type-safe functional programming language I recently bumped into, which with their focus on simplicity, ease of use, and developer experience, and compiling to either Erlang or Javascript, is really tempting to delve in deeper.