New Release! Grain v0.3.0 - Barley
After 6 months in development, we’re excited to announce the release of Grain v0.3.0, Barley.
Last week, we released Grain v0.3.0, codenamed Barley, to coincide with WebAssembly Summit 2021. Not only that, but Grain co-creator Oscar presented a talk titled “Grain: Your WebAssembly-First Programming Language”—check it out!
This release is a double-feature release because we decided to push back our December release and batch it with the work in preparation for the Summit. As such, that means we have double the amount of awesome to share with you. 🎉
Our entire changelog is available in the tagged release on GitHub, but we wanted to highlight some of the most hype features and changes.
Since 2018, we’ve known that statically linked programs were going to be an important piece of the puzzle, but we were hoping to leverage ecosystem tools. Since none really appeared that fit our needs, Oscar decided to take the matter into his own hands and build a static linking phase directly into the Grain compiler.
toString, the memory allocator and garbage collector, exception handling, and much more.
To pull this off, we had to implement compiler infrastructure to work with low-level WebAssembly types directly within Grain programs, which also will be helpful for library authors who need access to WebAssembly instructions directly.
All that being said, we believe users shouldn’t need to build the compiler from source before they can start writing Grain code. With this release, you can now download all the tools to get started with Grain as a single binary! Check out Getting Grain to download binaries for Windows, Mac, or Linux. This binary contains the Grain compiler, standard library, and a Node.js-based WebAssembly runner.
Of course, no release is complete without improvements to the language. We have:
- Added an explicit
- Introduced pattern matching on arrays
- Added a Char type and literal syntax
- Changed assignment semantics to always typecheck to
Voidfor better interop with loops and single-sided
- Removed the
unboxoperator and added Bitwise operators, which use
^as bitwise XOR
- Added support to
throwGrain exceptions, with custom exception printers
One of our hopes for Grain is to provide a full-featured standard library, and this release added a ton! We’ve updated our standard library docs on the website to include all the new modules, added functions, and updated signatures. So please check them out and suggest or contribute anything you think might be missing.
Finally, Oscar, Philip, and I want to wish a warm welcome to Marcus, our newest Core Team member! Marcus has been absolutely instrumental in building and improving the Grain Language Server Protocol, which is provided by our compiler and supplies compilation errors and other useful code information to code editors. You can take advantage of this information using our vscode extension. Additionally, Marcus has been working to get Grain building on Apple’s M1 architecture and an ARM Windows computer. We are very excited to have him as part of Grain core. 😁
We have lots on our roadmap, but most importantly, we now have the infrastructure in place to make releases far more often! Expect to hear from us much more frequently. As always, please leave us feedback and request features on GitHub or Discord—our roadmap is driven by how you use Grain.