GithubHelp home page GithubHelp logo

hhy5277 / grain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grain-lang/grain

0.0 2.0 0.0 2.23 MB

Compiler for Grain, the functional programming language. A modern web staple. ๐ŸŒพ

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

License: GNU Lesser General Public License v3.0

Emacs Lisp 0.21% Makefile 0.06% JavaScript 3.14% OCaml 95.58% HTML 0.06% CSS 0.37% Standard ML 0.46% WebAssembly 0.02% Shell 0.09%

grain's Introduction

License: LGPL v3 GitHub version

The Grain Compiler

Grain is a strongly-typed functional programming language built for the modern web by leveraging the brilliant work done by the WebAssembly project.

This language is still a work in progress, but be sure to stay tuned, or even contribute!

For more information about the language, visit grain-lang.org.

Building

Compiler

To build the compiler, have ocaml (version >= 4.02.3), opam, and jbuilder installed and on your PATH. Then, running make will install any needed OCaml dependencies and build the compiler. Running make install will symlink grainc onto your PATH. You can run the tests with make tests.

Runtime

To build the runtime, have node (version >= 9) and npm (version >= 5) installed. Then,

cd runtime
npm install
npm run build

CLI

To make the CLI available on your path, have node (version >= 9) and npm (version >= 5) installed. Then,

cd cli
npm install
npm link --global

Running

To create a .wasm file, run the following:

grainc /path/to/file.gr -o /path/to/output.wasm

For an example of how to run the file in JavaScript, look at the files under script. You'll need to create a symlink from script/public/javascripts/grain-runtime.js to the built file in runtime/dist/grain-runtime.js, or you'll have to just copy it over to run the example.

Alternatively, you can use the CLI to run your program on Node:

grain test.gr

Copyright ยฉ๏ธ 2017-2018 Philip Blair and Oscar Spencer.

grain's People

Contributors

ospencer avatar peblair avatar

Watchers

 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.