6 ms·
Shine with Gleam
- dxxvi 2y agoIt seems to me that Scala has all the features that Gleam has. And they both run in VM's. Scala is not very popular and Gleam is less popular that that. Someone must really love learning a new language to learn Gleam. I respect it very much.
- ljlolel 2y agoScala doesn’t have Erlang’s BEAM VM?
- __oh_es 2y agoIt runs on the jvm
- davedx 2y agoI worked with Scala professionally once and agree it’s very similar. Honestly what put me off Scala the most were the atrocious compile times, it was like working with big complex C++ projects in that respect. Sorry but my time is more valuable than that.
- vips7L 2y agoCompile times, lots of backwards compatibility breaking, and the forced functional everything from the community even though it was designed to be a blend of OO and FP.
- widdershins 2y agoGleam compiles very fast - I believe the language has been designed in part to enable this. No context-dependent grammar, etc.
- felixyz 2y agoScala is known for being multi-paradigm and quite complex, with competing factions promoting different Best Ways of Doing Things. Gleam is designed to be small and simple with a single clear path for getting things done. Apart from that, Gleam leans heavily on Erlang's actor model, which IMO is one of the greatest successes of language design to date.
- dxxvi 2y ago> Scala is ... quite complex Do you mean the Scala language is complex or the Scala libraries (not the Scala API) that people created (e.g. Cats, Akka ...) are complex? If you say that the Scala language is complex, could you give an example? > Erlang's actor model ... is one of the greatest successes of language design to date IMO, if you work within 1 VM, the thread model is closest to us as almost all languages have it. How many languages the actor model is implemented in? I know Erlang, Scala. What else?
- sureglymop 2y agoGleam is great. I think adoption will highly depend on developer tooling, LSP, ide integration etc. The experience is alright now but it has to get better to go mainstream (if that's even desired). If I had time I'd love to contribute.
- victorbjorklund 2y agoAs an elixir developer I'm so jealous at Gleam (but stay with Elixir because ecosystem and phoenix)
- dqv 2y agoYou can use Gleam from Elixir. I wanted to use lpil's jot library and it was pretty seamless. https://blog.appsignal.com/2024/07/23/enhancing-your-elixir-codebase-with-gleam.html https://blog.appsignal.com/2024/07/23/enhancing-your-elixir-...
- 28304283409234 2y agoFrom https://gleam.run https://gleam.run : > Black lives matter. Trans rights are human rights. No nazi bullsh*t. I agree, but I do not agree with painting people that disagree as 'Nazi'. *edit: that quote was from the Gleam website, not the website linked.
- hus2b3 2y ago[dead]
- evnix 2y agoI would be with you till I experienced South Korea. Here in South Korea, there is institutionalized racism or something we call as institution enabled racism. People who are not Korean or white aren't even allowed in most clubs or jobs and it isn't illegal to do so. Labeling deters bringing exclusionary views into tech projects, It could be just words, but I am happy to see the privileged society at least care for the minority in the west. I wish there was more of this in Korean tech websites, but xenophobia is so ingrained that people don't realise that it is wrong. People openly admit that they are xenophobic but don't see anything wrong with it. In korea, labeling someone a nazi doesn't work as they don't care and can't relate. But the label that works here is calling someone "poor" or "ugly".
- hus2b3 2y agoYes, they should just say on there website: We don't tolerate racism of any kind. Unless they want to express something different with their "No nazi bullsh*t". Unfortunately plain and clear statements are not used often. But (esp. younger) people are more often echoing political main stream slogans. That is by the way the key thing to understand when talking about the history of Nazis.
- maxcan 2y agoAre they killing unwanted minorities and political dissidents on an industrial scale? No, they aren’t. Ergo, they aren’t N*is. Labeling them as such is unfair to them and an insult to the memory of those killed by the actual kind. There can be widespread bigotry that falls far far short of N*ism. Words and precision matter.
- davedx 2y agoGreat programming lang article, starts with premises then shows examples, iterations, and final words. Gleam looks really interesting, though personally I’ll stick with TypeScript because it’s “good enough” and I understand where mutability can sneak in sometimes well enough these days.
- k__ 2y agoHalf-OT: Is there any effort on getting BEAM on WebAssembly? There was Lumen/Firefly, but the repo got archived a few months ago.
- zeroc8 2y agoI'm currently a Java developer working on a large code base. This is where Java's object oriented nature really shows its weaknesses. Reading other people's code becomes a huge pain, since everything is mutable and you can never be sure what state your program is in after a function call. Even C++ is better in that regard, at least you can pass values by copy or const reference. Gleam looks really nice at first glance. The problem of course is, as long as there is no industry support, it doesn't make sense to invest into it. It may be ok for small side projects, but I wouldn't dare starting a major application in something like that. Sooner or later you come across something you need and there is no library for it. Then you are forced to start messing around with FFI and whatnot.
- layer8 2y ago> everything is mutable That’s the real problem, not OOP. There is a functional-ish OOP style where most objects are immutable. Classes are used to capture invariants (in the sense of https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/ https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-va...), or for local-only mutations (like building a collection in a local scope, which is passed on as immutable after building). The defining characteristics of OOP are encapsulation and subtyping, not mutability.
- kriops 2y agoAnd Java doesn’t properly support immutability :( Encapsulation is a whole other issue, to which the ‘solution’ is almost always more encapsulation. The nice thing about immutability is that it is not really compatible with how we do encapsulation, so if you are strict about immutability then you are suddenly free from the whole quagmire as a side-effect.
- layer8 2y agoI disagree on both accounts. It’s not difficult to code truly immutable classes in Java. And encapsulation is beneficial regardless of mutability.
- jroesner 2y agoAs always put together perfectly. Not only fun to read, but also a new item on my todo list.
- WuxiFingerHold 2y agoA perfect hands-on introduction. Gleam is on the paper the "Simpler Rust". Yet very powerful. But it's so incredible hard to become relevant in the programming language world. As others have said: Typescript (esp. with Deno) is not that bad. Yes, error handling is miles away from Gleam, but is this enough for people to make the switch?
- weinzierl 2y agoGleam is on the paper the "Simpler Rust" I've heard this sentiment expressed a lot, but I don't understand it. Rust is unique because it is a relatively high-level language that at the same time does constrain you in the least possible ways. It doesn't require a runtime, it has no mandatory garbage collector, it runs on a wide variety of hardware platforms and operating systems. Rust is not only suitable to write embedded software, operating systems, web applications and web frontends, it is good at each - it might not be perfect or the best in each category, but it is astonishingly good. And finally it manages to be like that, being a relatively boring language even - familiar syntax, modern features but from a research perspective nothing fancy. There will always be new languages that have their niche, but to be a "Rust, just X" it will have to be as general purpose as Rust already is.
- skywhopper 2y agoIt’s pretty easy to understand. The syntax is similar and it uses a lot of the same patterns, but it’s a lot lighter weight. Glad you love Rust, but it is not remotely straightforward or “boring” — there’s a lot of hidden magic behind idiomatic Rust. And I wouldn’t call it “astonishingly good” for many of the use cases you mention. It can do all those things, but often not easily.
- widdershins 2y agoYes, Gleam and Rust are very different in the use-cases they address, performance etc. They share superficial syntax, which is why people think they're similar. The other main similarity is a focus on sum-types and pattern matching, which people associate with Rust but is really an ML borrowing. That's really where the similarities end. I enjoy both. Rust for its performance and close-to-metalness, Gleam for its delightful simplicity. It really is a tiny language, and very tastefully designed.
- oDot 2y agoI rewrote my webapp, Nestful[0], in Gleam. I use it in Vue components with Vleam[1]. About half of the frontend is rewritten at the moment, and it is a joy to use. I'd do it again just for the error handling. [0] https://nestful.app https://nestful.app [1] https://github.com/vleam/vleam https://github.com/vleam/vleam
- deleted 2y ago[deleted]
- widdershins 2y ago> the "flattening" above seems unnecessary but I could not avoid it since "Result#map" wraps the Result in another Result (I could not find a flat_map). In Gleam, this is called `result.try`[1] [1] https://hexdocs.pm/gleam_stdlib/gleam/result.html#try https://hexdocs.pm/gleam_stdlib/gleam/result.html#try