6 ms·
A big missing piece is the why. From what I can understand, it's garbage collected, it has ADTs, lists and arrays, it compiles to WASM, it has a "modern" syntax
by Zababa 5y ago
A big missing piece is the why. From what I can understand, it's garbage collected, it has ADTs, lists and arrays, it compiles to WASM, it has a "modern" syntax. What's the use case? Who's the target audiance? What are the tradeoffs comapred to JS, OCaml and Rust? I don't see any milestones or projets on Github. Is there a roadmap? What's the goal? A fullstack language?
I feel like I really want the "no marketing bullshit" version of that frontpage. "Grain is a new language that puts academic language features to work". Okay, but what "academic language features"? ADTs and pattern matching? Linear types? What's your pitch for developers that see new languages every 6 months, with usually more features than ADTs and a WASM backend?
I'll add that the answer to those can be "We made Grain because we wanted to, without a specific audiance in mind except ourselves" and that would be fine. I would just like some clarity on the goals and scope of Grain.
- nerdponx 5y agoI agree that a programming language should have a strong rationale behind its design, especially if they expect people to use it and take it seriously. That said, I think there's so much left unexplored in the PL design space that new languages are probably worth writing, if only to explore that space. In this case, it seems like the main feature is that it's designed specifically around the WebAssembly runtime. Skimming the docs, it also looks like it's meant to be a kind of cleaned-up OCaml. I guess that's not very different from Reason, Rescript, or even Fable. A "why this and not those things" document would make me more inclined to spend my energy on it. Does it run faster on Wasm than other similar languages? Does it have some interesting developer UX related to the Wasm sandboxing features? Does it have a nice build toolchain?
- Zababa 5y agoTotally agree, my criticism are only for the website, not for the language itself.
- throwaway894345 5y ago> Skimming the docs, it also looks like it's meant to be a kind of cleaned-up OCaml. I guess that's not very different from Reason, Rescript, or even Fable. It's implemented in Reason, so presumably the authors see some advantage to this over Reason. Personally I think more distance from the OCaml ecosystem is a competitive advantage relative to Reason et al. Yeah, there are advantages to being able to plug into an existing ecosystem, but the disadvantage is that in practice you have to understand the host language that you're plugging into.
- pbiggar 5y agoReason doesn't really exist anymore. "Native Reason" was just reskinned Ocaml, and the thing previously referred to as ReasonML continues life as ReScript.
- Zababa 5y agoReason does actually still exists. Rescript is a modified ReasonML syntax + BuckleScript. ReasonML is between the two, a foot in the OCaml world, a foot in the JavaScript world.
- pbiggar 5y agoIt may claim to be that, but in practice it is not. Most of the Reason repos have barely been touched in months, while ReScript continues to have a lot of momentum. The reasonml forums [1] are down to 3 posts in the last month, vs 85 in the rescript forum [2]. I don't know what you mean by "still exists", but in practice you can consider ReasonML to be dead, replaced by ReScript. [1] https://reasonml.chat/ https://reasonml.chat/ [2] https://forum.rescript-lang.org/c/general/1 https://forum.rescript-lang.org/c/general/1
- Zababa 5y agoIt may not look active from the outside, but I'm sure that the companies that used it still use it, while Rescript is still very young. > ReScript continues to have a lot of momentum Rescript has 4k weekly downloads on npm. Typescript has 22 millions. Coffeescript 1 million. Reason 1.5k. Elm 22k and it's not the official installer. PureScript 2.5k.
- deleted 5y ago[deleted]
- pbiggar 5y ago> It may not look active from the outside, but I'm sure that the companies that used it still use it, while Rescript is still very young. I think I might not have been clear when I said that reason is dead. Let me try again: ReasonML was a sort of collaboration between bucklescript (the ocaml->js compiler) and the Reason syntax. They recently parted ways, with the bukclescript part being renamed to ReScript (as well as using their own syntax). That leaves not much to be under the name "Reason", which is basically just a syntax. The companies that use it (such as mine) are moving to ReScript. Or, to put it more accurately, they have always been using ReScript just people referred to it as Reason at the time. > > ReScript continues to have a lot of momentum > Rescript has 4k weekly downloads on npm I meant relative to Reason. (fyi: rescript used to be called bs-platform, and that continues to have 8k downloads, so it's more like 12k for rescript)
- throwaway894345 5y ago> What are the tradeoffs comapred to JS, OCaml and Rust? JS: Static types OCaml: Readable, familiar syntax, presumably none of the "many standard libraries" problems. Hopefully the community is significantly less toxic. Rust: Garbage collected. Yeah, I know that the borrow checker gives you more than just memory management, but having to deal with the borrow checker really slows most people down a lot (even if they're experienced) and most applications can't trade that much developer velocity for an extra bit of safety and performance. > What's your pitch for developers that see new languages every 6 months, with usually more features Presumably "fewer features"?
- Zababa 5y agoThat's a great overview, and I think Grain would benefit from a page like this. "X for Y programmers" is a useful pattern. > OCaml: [...] Hopefully the community is significantly less toxic. What do you mean by this?
- throwaway894345 5y agoOCaml's community has always struck me as really toxic and hostile to newbies. If a newbie asks a question however politely, they're frequently berated as though asking for help is cheating and everyone should learn things the hard way as they did. Alternatively, if the community doesn't have a good answer (e.g., "How do I do X in OCaml?"), they often respond with some variation of "You're stupid for trying to do X" or "If Jane Street can make millions without X, then your company doesn't need it either!". Of course, every community has some toxic members, but in my experience they are so pervasive in the OCaml community that it virtually characterizes the entire community. And I've heard every justification including "Everyone is mean to the OCaml community, so the OCaml community is mean to everyone else". Anyway, I don't care to get into an argument about whether or not OCaml's community is toxic, I'm happy to agree to disagree.
- Mikeb85 5y agoAnd Americans often expect a ton of hand-holding. OCaml is a mature language with lots of relatively mature projects, tends to have a ton of documentation, etc... Here's one of my favourite blog posts ever concerning open source and some expectations: https://www.catuhe.com/le-syndrome-du-puppy/ https://www.catuhe.com/le-syndrome-du-puppy/
- azakai 5y agoI think an interesting advantage of Grain is that it not only compiles to wasm but is wasm-first. Bringing existing languages to wasm is incredibly important, and probably that is 99% of wasm today. But a new wasm-first language that is designed specifically for wasm can do some things better. For example, it is much easier to get tiny wasm files from a wasm-first language if it was designed for that. Another example is wasm GC. The current proposal is making good progress but the type system will never be "perfect" for all languages (there will be extra casts, for example). A wasm-first language could (once wasm GC stabilizes) tailor itself to that for optimal results.
- Zababa 5y agoI honestly don't know enough about WASM to know how important being WASM-first is. That could be a nice thing to add to the website. About the GC, that's true, but that also means that they may have to rethink significant parts of the language once the GC proposal is accepted. Considering they talk about academic features, I could imagine something like linear types.