Coder Social home page Coder Social logo

romgrk / grain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grain-lang/grain

0.0 2.0 0.0 6.52 MB

The Grain compiler toolchain and CLI. Home of the modern web staple. ๐ŸŒพ

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

License: GNU Lesser General Public License v3.0

OCaml 0.53% JavaScript 3.05% WebAssembly 0.01% Reason 96.17% Dockerfile 0.23%

grain's Introduction

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

Grain currently only works on Mac and Linux. We are hard at work trying to integrate Binaryen and OCaml on Windows, but this is uncharted territory! Please let us know if you have this low-level expertise. ๐Ÿ™‡

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

yarn
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:

grain compile hello.gr

and then to run the compiled program:

grain run hello.gr.wasm

Copyright ยฉ๏ธ 2017-2020 Philip Blair, Oscar Spencer, & contributors.

grain's People

Contributors

ospencer avatar phated avatar peblair avatar jacobginsparg avatar jozanza avatar ng-marcus avatar bmakuh avatar designsbysm avatar ohana54 avatar dony477 avatar clovis1122 avatar dependabot[bot] avatar miguelcarvalho13 avatar johnnyridout avatar zweimach avatar fa7ad avatar mscheibel avatar saulecabrera avatar tyreldenison avatar github-actions[bot] avatar tatchi avatar marcusroberts avatar torch2424 avatar ashutoshvarma avatar maxgraey avatar c0d3d avatar 0xtmphey avatar conaclos avatar z0w0 avatar nickbreaton avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.