520 karma · joined December 3, 2020
To me, Gleam feels like if Elm’s type system met Rust’s syntax. I really like it. But I also really liked Elixir too, I just can’t live without Gleam’s type system anymore.
Elixir’s use: https://hexdocs.pm/elixir/main/alias-require-and-import.html...
Gleam’s use: https://tour.gleam.run/advanced-features/use/
I find that `use` is quite effective when needed. This is the part referenced in her article where I find `use` particularly helpful. Something like:
fn outer() -> Result(success, failure) {
result.map(parse_id(), fn(id) {
... // More code that uses the id
})
}
Becomes: fn outer() -> Result(success, failure) {
use id <- result.map(parse_id())
... // More code that uses the id
}
In more concrete terms, I’m building an application with Gleam and Wisp that uses Wisp’s `require_form`. The type signature for `require_form` is: pub fn require_form(
request: Request(Connection),
next: fn(FormData) -> Response(Body),
) -> Response(Body)
But I get to use it like this: use form <- wisp.require_form(req)
I’m not sure if I have the appropriate nomenclature here, and I consider myself a beginner of writing strongly typed functional languages, but when I use `use`, I get to invoke the callback with the value on the left side of the arrow.As Erika so thoughtfully put it:
> The key is to use `use` when it allows you to highlight the happy path of your code … A use expression is syntax sugar, and it’s always possible to write Gleam code without it, though maybe not as clearly.
You can see more here [1] if you want, but note that there are a lot of structural changes in this codebase while I learn and figure out how to best use Gleam and Wisp :)
1. https://github.com/usepriceflow/app/blob/main/src/app/web/ad...
As an aside, I really love the citations in the third column of your website. Super cool!
Wow, that’s a pretty big reduction.
There's also [Elm on the Backend](https://gotoaarhus.com/2023/sessions/2529/elm-on-the-backend), a recent talk given by the creator of Elm, about his experiments in using Elm as a full-stack language. There are some notes and a few photos, but no video as far as I'm aware.
I'm not involved in the Elm community nor do I write it for a living though, so I'm only kind of aware of what's going on over in the Elm world.
https://twitter.com/sw_unscripted/status/1584695054563954689
The only thing that took me some time to adjust to was how overwhelming joining a new server can be. So many channels! Everything needs my attention! But after using it for a long time, I think this is actually a feature. I can mute channels and categories I’m uninterested in, but how many channels on Slack are never found due to poor discoverability?
We run both Slack and Discord at my work and the engineers vastly prefer Discord, for what it’s worth.
Here’s a relevant You Need A Budget podcast episode for those looking for more on this topic: https://open.spotify.com/episode/0Z9NQoseq5nvutAInURR2r
> “If I didn’t know exactly what it was, which is this computer program we built recently, I’d think it was a 7-year-old, 8-year-old kid that happens to know physics,” said Lemoine, 41.
https://www.washingtonpost.com/technology/2022/06/11/google-...