It’s more general than that. It can be used to implement async operations, but also so much more. It’s basically syntactic sugar for continuation passing style.
I know, right?! When I realized what it was I bust into the Gleam Discord and asked “omg do you realize what you have done?!” and the response was just “oh yeah, totally”. I next asked whether they had any grand plans for extending it into async or coroutines or other fancy advanced language features and the answer was “maybe someday, but right now we’re pretty happy just having an equivalent of Rust’s ? operator”. For some reason that struck me as very charming.
They mostly run on JS or the BEAM so cooperative multitasking probably doesn’t buy Gleam much value. Maybe if it turns into a natively compiled language!
fun! the gleam “language tour” website is excellent, compiling gleam code in realtime really helped me get a “feel” for the language. lots of golang inspo in this language imo, it really feels like we’re honing in on very very practical language ergonomics. excited abt the future
These use expressions are a really interesting idea. This might also fit a lot of non-FP languages with closures.
They seem very similar if not identical to Koka’s “with” statement. Very cool idea either way.
It looks equivalent to the
await
expression in languages with async/await.It’s more general than that. It can be used to implement async operations, but also so much more. It’s basically syntactic sugar for continuation passing style.
Yeah, it’s the first time I’ve seen a PL make CPS style not immensely annoying to read.
I know, right?! When I realized what it was I bust into the Gleam Discord and asked “omg do you realize what you have done?!” and the response was just “oh yeah, totally”. I next asked whether they had any grand plans for extending it into async or coroutines or other fancy advanced language features and the answer was “maybe someday, but right now we’re pretty happy just having an equivalent of Rust’s
?
operator”. For some reason that struck me as very charming.They mostly run on JS or the BEAM so cooperative multitasking probably doesn’t buy Gleam much value. Maybe if it turns into a natively compiled language!
Not that complicated afaik. The following Gleam code:
is equivalent to the following OCaml (using a binding operator):
fun! the gleam “language tour” website is excellent, compiling gleam code in realtime really helped me get a “feel” for the language. lots of golang inspo in this language imo, it really feels like we’re honing in on very very practical language ergonomics. excited abt the future
Is using Gleam pragmatic yet, i.e. is the compiler and infrastructure sound enough for production use or semi-serious side-projects?
Yep! I’ve only played with it a little, but it cleared the bar of “semi-serious side project” pretty well.
I think the goal of releasing 1.0 was to say that it is.
[Comment removed by author]