Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 1.1 KB

README.md

File metadata and controls

51 lines (39 loc) · 1.1 KB

Func compiler

A compiler for Func, a high-level, general-purpose, statically typed, garbage collected, purely functional programming language with type inference.

The language is mostly based on ML, Haskell, and JavaScript.

How to try it out

It's best to check out the demo and tutorial available at https://sodic.github.io/func.

The thesis is available at https://sodic.github.io/func-thesis.pdf.

Using the compiler locally

Clone the repository, position yourself in the root directory:

git clone https://github.com/sodic/func
cd func

Install dependecies and build the compiler:

npm install
npm run build

Create a source file. For example, create the file test.func with the following contents:

func double(x) = 2 * x

func square(x) = x * x

squareAndDouble = double . square

eighteen = squareAndDouble(3)

Compile the source file:

npm run compile test.func

The compiler will write the output to test.js.

Running tests

Build the project and run tests:

npm run build-and-test

Run the tests without building the project:

npm run test