4 ms·
Gleam Version 1
- manicennui 3y agoHighly recommend clicking the “learn in an afternoon” link.
- djaouen 3y agoWhile I am glad that Gleam exists, I just can’t get used to the curly braces. Python and Elixir have spoiled me lol
- ubertaco 3y agoI'm still surprised the "use" syntax survived the 0.x release "experimentation" phase. It's more confusing than explicit "I can read and tell what this is doing by matching the braces" callbacks, _and_ it's more confusing (and less expressive) than full-on do-notation (or F#-like "computation expressions"). Instead, it's the worst possible middle ground: it's a third, different mental model that is unfamiliar in an already-unfamiliar language amid other "rough-edges" choices (like not having if-then statements -- even though you can pattern-match on `case true...case false`, it's still another rock in the shoe), but it doesn't offer improved clarity (since you have to keep "what will the real code look like when this is desugared" in mind constantly when figuring out which variables to `use` and which to just assign, and which parameters should stay in the function call and which should get "magically" floated outside the parens, and so on...), nor does it offer improved power/flexibility (in the way that do-notation does, where you can generalize expressing any given nested/monadic operations as though they were not nested). I love ML-family languages, and I find the BEAM VM intriguing. I want Gleam to be great, but it has just enough friction (in the form of unique-but-not-clearer-or-more-powerful language decisions) and just enough limitation (in the form of a very limited standard library) that I think it's currently just "okay".
- giraffe_lady 3y agoIDK I really don't mind use. Your "worst possible middle ground" is my "useful compromise between complexity and expressiveness."
- lpil 3y ago> it's more confusing (and less expressive) than full-on do-notation (or F#-like "computation expressions"). It's strictly more expressive than do-notation. Anything that Haskell's `do` can do Gleam's `use` can do, but not everything that Gleam's `use` can do Haskell's `do` can do. I don't think the clarity argument holds true, I think rather this is about what you're familiar with rather than an actual property of the syntax. Both are rather opaque. Given there's a few languages with `use` now I think that familiarity problem will lessen too.
- tome 3y agoCan it be nested? Haskell's do can be used like do r <- do foo bar quux r But I don't see (from https://gleam.run/news/v0.25-introducing-use-expressions/ https://gleam.run/news/v0.25-introducing-use-expressions/) any obvious way of nesting like that in Gleam.
- lpil 3y agoUnlike in Haskell `{}` are not optional in Gleam, so that would be written like so: use a <- one({ use b <- two // etc })
- tome 3y agoThanks. I don't fully grasp what `one` is, but do notation has the nice property that do r <- do foo bar quux r is the same as do foo r <- bar quux r It doesn't look like that holds for use. Specifically one({ use b <- two foo }) baz is not the same as use b <- two foo baz right?
- lpil 3y agoCorrect, it’s not.
- comex 3y agoFor reference: https://tour.gleam.run/advanced-features/use/ https://tour.gleam.run/advanced-features/use/
- Buttons840 3y agoBeautiful site! I've been watching Gleam and I think it will be my preferred Beam language. https://tour.gleam.run/ https://tour.gleam.run/ How does Gleam run in the browser?
- jackwilsdon 3y agoLooks like it's using the WebAssembly build of the compiler which compiles to JavaScript: https://github.com/gleam-lang/language-tour/blob/6d69cee90a3c79b3fcc79deeea4336b077bd40fe/static/compiler.js#L3-L11 https://github.com/gleam-lang/language-tour/blob/6d69cee90a3... Although currently it's running v0.34.1 and not v1.0.0 (there doesn't seem to be a v1.0.0 wasm build yet): https://github.com/gleam-lang/language-tour/blob/6d69cee90a3c79b3fcc79deeea4336b077bd40fe/bin/download-compiler https://github.com/gleam-lang/language-tour/blob/6d69cee90a3...
- asplake 3y ago> How does Gleam run in the browser? There was some detail in its announcement in January: https://gleam.run/news/gleams-new-interactive-language-tour/ https://gleam.run/news/gleams-new-interactive-language-tour/
- Buttons840 3y agoLinks says "Gleam compiles to either Erlang or JavaScript" which I didn't realize. Neat!
- deleted 3y ago[deleted]
- xnorswap 3y agoI've been keeping an eye on Gleam since I saw a talk by it's creator at Code Mesh London 2019, linked below. It was one of my favourite talks of the conference, and of all the efforts to marry types and the BEAM it struck me as much more promising than other similar efforts. https://codesync.global/media/gleam-lean-beam-typing-machine-cmldn19/ https://codesync.global/media/gleam-lean-beam-typing-machine...
- ChrisArchitect 3y ago[dupe] / link fix https://news.ycombinator.com/item?id=39590246 https://news.ycombinator.com/item?id=39590246
- lenkite 3y agoCan Gleam run on mobile platforms ?
- Ndymium 3y agoI've run Gleam compiled for the Erlang target using the elixir-desktop project as a "native" Android app. Meaning that the Erlang runtime is packaged with Elixir and the Phoenix framework into an APK. The app runs your code in Phoenix and opens a LiveView frontend that serves as the app's UI. Right now I'm working on a streaming music client in Gleam that runs as a progressive web app in browsers, desktops, and mobile. It looks just as native as the elixir-desktop app and has integration to the OS media notifications. This is using the JavaScript target. If you are able to make mobile apps with JavaScript in other ways (Cordova?), then you can take Gleam's JS output and use that in such a system.
- sea-gold 3y agoRecent discussion on Gleam from ~3 months ago with 236 comments https://news.ycombinator.com/item?id=38183454 https://news.ycombinator.com/item?id=38183454