MaxGraey / grain

The Grain compiler toolchain and CLI. Home of the modern web staple. 🌾

Home Page:https://grain-lang.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grain

Grain CI Workflow License: LGPL v3 GitHub version


Grain is a new programming language that compiles to WebAssembly via Binaryen. For more information about the language, check out grain-lang.org.

If it's your first time here, we recommended that you follow the Grain guide to get up and running.

Contributing

There are tons of ways to contribute to Grain. Check out our contributing guide for more info and come chat with us on Discord! All contributors are held to our contributor code of conduct.

Building

To build Grain, you'll need Node.js v14, Yarn, and CMake. To get everything set up, run:

yarn
yarn setup
yarn compiler build

This will set up the Grain runtime, standard library, and CLI.

If running tests is your kind of thing, run

yarn compiler test

If you are using vscode as your editor, we recommend you run:

yarn vscode

This will create local settings that point OCaml LSP to our compiler directory. Then, you should be able to use the OCaml Platform extension!

Other Commands

To build the standard library:

yarn stdlib build

To build the runtime:

yarn runtime build

To link the CLI:

yarn cli link

To reset your compiler build:

yarn compiler clean

To navigate tasks available in the system:

yarn run

This will display an interactive session where you can select the project and command you want.

Running Grain Programs

You can run programs using the Grain CLI:

echo "print('Hello world')" > hello.gr
grain hello.gr

Alternatively, you can invoke the compiler directly:

grainc hello.gr

Copyright ©️ 2017-2020 Philip Blair, Oscar Spencer, & contributors.

About

The Grain compiler toolchain and CLI. Home of the modern web staple. 🌾

https://grain-lang.org/

License:GNU Lesser General Public License v3.0


Languages

Language:Reason 89.6%Language:JavaScript 5.8%Language:TypeScript 3.9%Language:OCaml 0.5%Language:Shell 0.2%Language:WebAssembly 0.0%