At a quick glance, it looks like OCaml-without-objects (or labels, or polymorphic variants, or GADTs), with better printing. In my books, that's a pretty sweet spot to be:
- stronger typing than TypeScript/AssemblyScript, while being similarly flexible;
- simpler and more gc-ed than Rust.
Of course, no ecosystem yet afaict.
Next time I start a project that targets wasm, I'll definitely look at Grain.
Because every language and tool is part of a wider software ecosystem, and it's reasonable to ask how any given language compares to the other options that you have.
Usually I pick languages based on the ecosystem and not the other way around.
One thing that Grain has going for itself is the toolchain, just like AssemblyScript.
Most languages targeting WebAssembly, instead of directly generating wasm files, use a klundge of Python, JS and Java tools, with Emscripten being the most notorious in that regard.
I see it says it has a type checker or inference from OCaml. I’m guessing this means it doesn’t natively support higher kinded types.
Don’t get me wrong - I love new languages and I commend the author(s)! But I would like to know where it stands between Rust, Haskell and Ocaml.