197 points · by jgilias · 3y ago · 122 comments
- There are no changes since HEAD
- The commit is signed by Robin himself
...and for those interested in the code that does this
https://github.com/gren-lang/compiler/blob/main/builder/src/...
And found a great bug where it broke their own code. [1]
[0]: https://github.com/gren-lang/compiler/blob/main/docs/kernel_...
Seems more like a check to make sure the version of the JS is compatible with the version of gren than anything else.
[1] https://github.com/gren-lang/compiler/blob/e665e521367eeedec...
I know a lot of people got burned by this when Elm added this enforcement, and that seeing it here in Gren can cause a lot of eyerolls.
However.
The greatest feature of the language is the absence of mutation and user-defined exceptions, and managed side-effects. Making the kernel code api accessible to everyone would introduce those things to the language, and my memory from the pre 0.19 days of Elm tells me that this made for a worse experience overall.
One of the problems with this limitation is the lack of bindings to core web api’s. We’re actively working on adding more APIs here. LocalStorage was contributed by an external contributor. Contributors are also working on a HttpServer and a WebSocket API now.
And that’s another «change» worth noting when comparing with Elm. We have scheduled releases (June and December) and are more open to contributions.
As in, I do get the reasoning, but there are valid situations where one might need to do this for their own reasons. So maybe there’s some way to make it clear that you shouldn’t be doing this, yet still narrowly allow it. A non-default CLI flag, a scary compilation warning, maybe needs to use some special keyword to use code like that. Like how you need to use ‘unsafe’ in Rust to interact with C code directly.
Otherwise, thank you for working on this! An Elm inspired language that’s open to community development is something the world needed :-D
It will be looked at pre 1.0.
My memory tells me that 0.19 literally killed the language.
I will have to revisit kernel code at some point in the future, probably when looking into WASM (which will break all uses of kernel code), but I have other, more important, features to add first.
The main problem with ports is that (1) it's an async API, which can be awkward for certain operations and (2) you cannot define a package that contains ports.
I think it’s a little misleading that the title of this post is «Gren - an Elm fork».
While technically correct, I think there are many who will be dissapointed to find that Gren and Elm are incompatible languages.
In addition to some syntax changes and improvements, Gren adds the support of a NodeJS target. It’s still early, so we don’t support all of the builtin APIs yet, but we’ll slowly get there.
AMA
I did find a news post listing some differences, but it didn't really go into "why". A dedicated page outlining the differences / opinions on the changes would help me determine if this is a language I might use.
Having a NodeJS (server) target is definitely interesting.
I also improved pattern matching on records to make them more ergonomic.
No automatic record constructors: same as the above, but in my experience it also confused beginners.
I know of several that actively avoids it in their projects, even enforcing it with a linter rule.
No GLSL: never used it, and don’t know how it works. It also broke when I upgraded the version of the Haskell compiler (Gren’s compiler is written in Haskell). For those reasons, it was removed.
No reactor: never used it
Did you mean better refactoring?
I got a bit too ambitious with the type system, I think. At the very least, I got to a point where I got discouraged because the type system I wanted was difficult to implement, and I started to realize that there were a few problems with the design. At the same time, I was starting to feel that this may not actually be something I'd want to use in production.
On the flip side, I learned a whole lot about web assembly that I hope to put into Gren. I also felt a lot of pain with the lack of FileSystem APIs in Elm (which Stabel was implemented in). In a way, my work on Stabel triggered the work on Gren.
It also targets good interop with typescript which is a big plus in current state of frontend ecosystem.
Unrelated to your question but for those curious, here's a comparison between Gren and Elm :
https://gren-lang.org/book/faq.html#what-are-the-differences...
This is basically why I never used elm: because the compiler is hard to use as I struggle reading its output.
(Before anyone comments "why don't you change yellow in your terminal": then this will break applications such as pamix which hard-code to a black background and use yellow text on that, or applications which have a black statusbar or the like with yellow text on it – it's not so easy to choose colours that work in all scenarios and all things considered sticking to the default set is the "least broken" since almost everything has an option to just disable colours).
What does this mean? I know what GLSL is but I don't understand what Elm or Gren have to do with it.
I imagins this is useful when writing shaders for WebGL apps that are written in Elm. I don't know why Gren removed them, though.
https://github.com/elm/compiler/pulse/monthly
https://github.com/elm/core/pulse/monthly
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.
Maintaining a fork of Elm open to development is a big commitment. But one that will be well received by many.
I look forward to trying it.
Release branch basically means you get fixes. You won't get API changes, or new features. For a lot of people that stability is welcome.
[1] “the largest transport provider in Norway” https://blogg.bekk.no/using-elm-at-vy-e028b11179eb
The FAQ has a similar description, but doesn't make the assertion that it's not a fork, which I disagree with:
> Gren started as a fork of Elm. This is mostly considered to be an implementation detail, a way to speed up initial development.
> It's not a goal of Gren to replace, or stay compatible in any way with, Elm.
https://gren-lang.org/book/faq.html#what-is-the-relationship...
Most long-lived forks that I hear about are things that have developed into their own projects and have no intention of merging back to the original. Contrast with a short-term fork which will only live a few months and then will be hopefully be merged into the original; it will probably be so short-lived that people outside of the project won’t hear about it as a “fork” with its own distinct name.
A “fork” isn’t only making a GitHub fork so that you can make a PR against the original because you found a typo on the readme.
Seems like a fork to me.
Or maybe the thinking is that they'll rewrite it from scratch at some point which would make it not a fork from code perspective.
That said, people expect certain things when you market something as a fork, so I’m a little careful in making that the first thing someone hears of the language.
Stockholm Syndrome at work
Frankly Elm has more of a problem with negative fanboying: people who have decided it’s not for them yet have to constantly show up to neener neener every time Elm appears on HN instead of just moving on.
It’s very weird to me as someone who uses Elm daily. We get it. You don’t like it and everyone needs to know it.
That it’s some sort of cult is just HN drama begging fantasy.