TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Gleam Is Pragmatic

250 pointsby crowdhailer8 months ago

15 comments

jazzypants8 months ago
&gt; I won’t fall into the trap of trying to define Monads in this post. Instead, let’s talk about monadic-style APIs – that is, APIs that allow you to do a bunch of things one after another, with the ability to use the result of a previous computation in the next computation, and also allows some logic to happen between steps.<p>Am I crazy, or did he just give a really good definition of monads in programming? I think that it benefits by not letting itself get bogged down in Category Theory nomenclature which doesn&#x27;t actually matter when programming.
评论 #41761850 未加载
评论 #41765890 未加载
评论 #41761583 未加载
评论 #41765755 未加载
评论 #41762178 未加载
评论 #41763981 未加载
评论 #41767228 未加载
评论 #41774167 未加载
atemerev8 months ago
The greatest power of BEAM-based languages is the fully preemptive actor model. Nobody else supports it. This is a superpower, the solution of most problems with concurrent programming.<p>In Erland and Elixir, actors and actor-based concurrency hold the central place in the corresponding ecosystems, well supported by extensive documentation.<p>In Gleam, actors and OTP are an afterthought. They are there somewhere, but underdocumented and abandoned.
评论 #41759188 未加载
评论 #41761696 未加载
评论 #41759354 未加载
评论 #41764968 未加载
评论 #41760050 未加载
评论 #41759167 未加载
skybrian8 months ago
Gleam&#x27;s 1.0 release was in May and it&#x27;s still adding major features.<p>JavaScript support looks interesting. Browsing the package repo, I don&#x27;t see how to tell which packages are supported on Erlang&#x27;s VM, when compiling to JavaScript, or both. JavaScript-specific documentation seems pretty thin so far?
评论 #41764304 未加载
评论 #41777590 未加载
patte8 months ago
This is a very concise overview! I have made a small example chat app [1] to explore two interesting aspects of gleam: BEAM OTP and compilation to javascript (typescript actually). If anyone is interested...<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;patte&#x2F;gleam-playground">https:&#x2F;&#x2F;github.com&#x2F;patte&#x2F;gleam-playground</a>
rossng8 months ago
The `use` syntax is interesting - don&#x27;t recall seeing anything similar before. But I&#x27;m struggling to understand how exactly it is executed and a glance at the Gleam docs didn&#x27;t help.<p>Is the `use` statement blocking (in which case it doesn&#x27;t seem that useful)? Or does it return immediately and then await at the point of use of the value it binds?
评论 #41759412 未加载
评论 #41759960 未加载
评论 #41759832 未加载
评论 #41764496 未加载
评论 #41760427 未加载
评论 #41762157 未加载
评论 #41763935 未加载
fire_lake8 months ago
Gleam looks nice but if an F# comparisons was added, I think that would come out ahead based on the authors priorities.
评论 #41760788 未加载
评论 #41760344 未加载
评论 #41762784 未加载
评论 #41761265 未加载
steve_adams_868 months ago
Wow, this is a great overview. I’ve been playing with Gleam a bit and this was really helpful. I’ll definitely refer to this later.<p>I’d like to dig into the OTP library (I’m curious if anyone has worked with it much?) and create a state chart library with it, but I’m still firmly in the “I don’t totally get it” camp with a few parts of Gleam. I don’t deny that it’s pragmatic. Maybe it’s more so that I’m not up to speed on functional patterns in general. I was for years, but took a hiatus to write code for a game engine and supporting infrastructure. It was so Wild West, but I kind of liked it in the end. Lots of impure, imperative code, haha.
评论 #41759548 未加载
评论 #41760720 未加载
beanjuiceII8 months ago
tried gleam but the fact i have to manually serialize&#x2F;deserialize things, pretty annoying, that doesn&#x27;t seem very pragmatic
评论 #41759159 未加载
评论 #41760079 未加载
评论 #41759790 未加载
评论 #41761320 未加载
Degorath8 months ago
I understand why the `use` syntax is preferable for its generalizability to many different &quot;callback style&quot; things, but the whole construct of `use foo &lt;- result.try(bar())` is so much worse than defining let* in ocaml and being able to write `let* foo = bar() in`...
评论 #41777669 未加载
amelius8 months ago
&gt; Running on the battle-tested Erlang virtual machine that powers planet-scale systems such as WhatsApp and Ericsson, Gleam is ready for workloads of any size.<p>Does a Gleam programmer in practice need to deal with Erlang? Do Erlang error messages leak through?
评论 #41764483 未加载
d--b8 months ago
Doesn’t it compare mostly to F#, rather than Haskell or OCaml? The examples in the post really look like F# to me
ogogmad8 months ago
Is there a way to implement matrix arithmetic with nice syntax (for instance, &quot;A + B&quot; to add two matrices A and B) in Gleam? The lack of ad-hoc polymorphism might paradoxically be a blessing.
vivzkestrel8 months ago
newbie here, how does gleam compare to golang, rust and python?
评论 #41767002 未加载
behnamoh8 months ago
It&#x27;s not pragmatic if you have to import these basic libs:<p>```<p>import gleam&#x2F;dict.{type Dict}<p>import gleam&#x2F;int<p>import gleam&#x2F;io<p>import gleam&#x2F;result<p>import gleam&#x2F;string<p>```
评论 #41759265 未加载
评论 #41772029 未加载
zombot8 months ago
The syntax doesn&#x27;t look like it supports partial application? Big no-no. Also, no compilation to native code. Another big no-no.
评论 #41765724 未加载
评论 #41765056 未加载
评论 #41765821 未加载