Live data from Hacker News

Gleam v1.12

github.com

1–10 of 91 posts

Re: Gleam v1.12

#2
Some highlights from this release are listed here[1].

The best part of Gleam in my opinion is the language's design. It's just so elegant to read and write. Take this example code snippet from the release notes:

    pub fn find_book() -> Result(Book, LibraryError) {
      case ask_for_isbn() {
        Error(error) -> Error(error)
        Ok(isbn) -> load_book(isbn)
      }
    }

It's a trivial code snippet, but I'm finding this kind of "first class" pattern matching produces very readable, elegant-looking, well organized code.

There was a discussion the other day about the pipe operator being added to PHP 8.x. Gleam was my first language which included a pipe operator. Now, having used it a bit, I feel every language should have something like it.

    pub fn hello_test() {
      telephone.ring()
      |> should.equal("Hello, Joe!")
    }
The pipe skips so much boilerplate and clearly communicates intent. Absolutely love it.

[1] https://gleam.run/news/no-more-dependency-management-headach...

Re: Gleam v1.12

#3
post #2

Some highlights from this release are listed here[1]. The best part of Gleam in my opinion is the language's design. It's just so elegant to read and write. Take this example code snippet from the release notes: pub fn find_book() -> Result(Book, LibraryError) { case ask_for_isbn() { Error(error) -> Error(error) Ok(isbn) -> load_book(isbn) } } It's a trivial code snippet, but I'm finding this kind of "first class" pa…

I'm so envious of this. In TypeScript I use ts-pattern and Effect Schema, and while they make this logic way nicer, it's insanely verbose and doesn't offer any of the niceties of being first class.

Re: Gleam v1.12

#4
post #2

Some highlights from this release are listed here[1]. The best part of Gleam in my opinion is the language's design. It's just so elegant to read and write. Take this example code snippet from the release notes: pub fn find_book() -> Result(Book, LibraryError) { case ask_for_isbn() { Error(error) -> Error(error) Ok(isbn) -> load_book(isbn) } } It's a trivial code snippet, but I'm finding this kind of "first class" pa…

I'm so envious of this. In TypeScript I use ts-pattern and Effect Schema, and while they make this logic way nicer, it's insanely verbose and doesn't offer any of the niceties of being first class.

I have not used it at all, but Gleam does have a javascript target in it's compiler/build-tool. So in theory, you can write Gleam (strongly typed, etc) and produce js.

I've exclusively used the BEAM/Erlang target so far - but the js community within Gleam seems quite interesting.

Re: Gleam v1.12

#5
post #2

Some highlights from this release are listed here[1]. The best part of Gleam in my opinion is the language's design. It's just so elegant to read and write. Take this example code snippet from the release notes: pub fn find_book() -> Result(Book, LibraryError) { case ask_for_isbn() { Error(error) -> Error(error) Ok(isbn) -> load_book(isbn) } } It's a trivial code snippet, but I'm finding this kind of "first class" pa…

Omg yes, pattern matching is such an amazing feature I miss it dearly in languages that don't have it!

Re: Gleam v1.12

#6
post #2

Some highlights from this release are listed here[1]. The best part of Gleam in my opinion is the language's design. It's just so elegant to read and write. Take this example code snippet from the release notes: pub fn find_book() -> Result(Book, LibraryError) { case ask_for_isbn() { Error(error) -> Error(error) Ok(isbn) -> load_book(isbn) } } It's a trivial code snippet, but I'm finding this kind of "first class" pa…

>It's just so elegant to read and write.

Interesting. I was just about to write the opposite. I tried Gleam to solve last year's Advent of Code, and it felt like a weird mix between Rust and Elixir. You can't write code as elegantly as you'd do in Elixir, which was somewhat disappointing. I switched back to Elixir after a couple of days. I think the biggest advantage of Gleam is static type system.

Re: Gleam v1.12

#7
post #2

Some highlights from this release are listed here[1]. The best part of Gleam in my opinion is the language's design. It's just so elegant to read and write. Take this example code snippet from the release notes: pub fn find_book() -> Result(Book, LibraryError) { case ask_for_isbn() { Error(error) -> Error(error) Ok(isbn) -> load_book(isbn) } } It's a trivial code snippet, but I'm finding this kind of "first class" pa…

>It's just so elegant to read and write. Interesting. I was just about to write the opposite. I tried Gleam to solve last year's Advent of Code, and it felt like a weird mix between Rust and Elixir. You can't write code as elegantly as you'd do in Elixir, which was somewhat disappointing. I switched back to Elixir after a couple of days. I think the biggest advantage of Gleam is static type system.

If you've examples of code you have in Elixir that you could not express well in Gleam I would be very happy to help you out with that.

The two languages are almost the same at the value level, so code should translate across well.

Re: Gleam v1.12

#8
post #2

Some highlights from this release are listed here[1]. The best part of Gleam in my opinion is the language's design. It's just so elegant to read and write. Take this example code snippet from the release notes: pub fn find_book() -> Result(Book, LibraryError) { case ask_for_isbn() { Error(error) -> Error(error) Ok(isbn) -> load_book(isbn) } } It's a trivial code snippet, but I'm finding this kind of "first class" pa…

>It's just so elegant to read and write. Interesting. I was just about to write the opposite. I tried Gleam to solve last year's Advent of Code, and it felt like a weird mix between Rust and Elixir. You can't write code as elegantly as you'd do in Elixir, which was somewhat disappointing. I switched back to Elixir after a couple of days. I think the biggest advantage of Gleam is static type system.

Depending when this was, it was likely pre-1.x days? Things moved very quickly there for a while - it's worth checking back in again.

Gleam seems to have a lot of obvious influences from Rust, and the creator is a rust dev.

While the Gleam ecosystem is vastly less mature than Elixir's or Rust's (because it's literally younger), the language itself, I've found, is vastly more pleasant to read/write. YMMV of course.

Re: Gleam v1.12

#9
The official website has an interesting footer

> As a community, we want to be friendly too. People from around the world, of all backgrounds, genders, and experience levels are welcome and respected equally. See our community code of conduct for more. Black lives matter. Trans rights are human rights. No nazi bullsh*t.

On one hand I applaud that their community standards are inclusive, but on the other hand, it shouldn't be that blatantly ideological from the get go. It's just another programming language, not a political platform.

Re: Gleam v1.12

#10
post #4

Earlier quoted context omitted.

I'm so envious of this. In TypeScript I use ts-pattern and Effect Schema, and while they make this logic way nicer, it's insanely verbose and doesn't offer any of the niceties of being first class.

I have not used it at all, but Gleam does have a javascript target in it's compiler/build-tool. So in theory, you can write Gleam (strongly typed, etc) and produce js. I've exclusively used the BEAM/Erlang target so far - but the js community within Gleam seems quite interesting.

I've been considering trying this, but my team already struggles to properly adopt TypeScript so I'm fairly sure introducing Gleam would cause a few people to throw me out a window.
Post reply on HN