this post was submitted on 11 Mar 2024
82 points (96.6% liked)

Rust

5829 readers
61 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS
all 13 comments
sorted by: hot top controversial new old
[–] Deebster@programming.dev 25 points 6 months ago (2 children)

It looks interesting. While the compiler is written in Rust (a RRIR from Erlang), the code itself runs on the Erlang VM or on JS. Unfortunately, you can't do hot code reloading and I'm curious what/if you have to sacrifice to run on JS.

Their cheatsheet for Rust users might be of interest to others.

[–] autokludge@programming.dev 7 points 6 months ago* (last edited 6 months ago)

While having a quick look through old news:

From June 2021 (v0.16) (https://gleam.run/news/v0.16-gleam-compiles-to-javascript/#how-does-it-work)

Much like the Erlang compiler backend this new JavaScript backend outputs human readable and pretty printed source code. It is now included with the compiler and does not require any extra components to be installed to use it.
Rather than attempting to replicate a subset of Erlang’s actor model Gleam uses the standard promise based concurrency model when targeting JavaScript. While this may be disappointing for some, it means that there is no additional runtime code added. This keeps bundle size small and makes it so code written in Gleam can be called like normal from languages such as JavaScript and TypeScript.

Jan 2024 v0.34 (https://gleam.run/news/v0.34-multi-target-projects/#multi-target-projects) mentions some additional work done to enable multi target projects such as Lustre

[–] devfuuu@lemmy.world 2 points 6 months ago

The guide/tutorial has some specifics about things that are allowed in erlang vs js. There's a few features that don't work completely in one or another.

[–] owen@lemmy.ca 19 points 6 months ago (3 children)

Seems nice but I can't tell what its purpose is

[–] snaggen@programming.dev 9 points 6 months ago (1 children)

Exactly. I appreciate the "What’s Gleam" section, but I would also like to see a "Why Gleam?" section.

[–] devfuuu@lemmy.world 14 points 6 months ago

There's no nice static strong typed language on the erlang vm. This is it.

[–] AnUnusualRelic@lemmy.world 5 points 6 months ago* (last edited 6 months ago) (1 children)

This usually means that it's mostly useless.

[–] owen@lemmy.ca 1 points 6 months ago

Maybe they can pivot to being a Sanrio competitor with their cute mascot

[–] TehPers@beehaw.org 7 points 6 months ago (1 children)

Everytime I see a post about this, I end up confusing it with gleam.io (which is a popular service for people doing giveaways). Looks cool, just the naming conflict is unfortunate.

[–] anlumo@feddit.de 6 points 6 months ago* (last edited 6 months ago)

The gleam name is also already taken by some OpenGL bindings on crates.io.

[–] solrize@lemmy.world -4 points 6 months ago (1 children)

Another BEAM language. This one has (some?) static typing, and (bleach) JavaScript -like syntax. Is there a tldr of why write another of these instead of using an existing one? There are already a few. Even a port of typescript to beam might be a good approach. I agree with the concept of a typed functional language on BEAM but this doesn't look attractive. I liked PureScript in the JS world but I think it lost out to typescript.

[–] vcmj@programming.dev 2 points 6 months ago

Not sure if this is the right answer I'm not familiar with that ecosystem: They have comparisons on their site