Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.09 KB

README.md

File metadata and controls

46 lines (34 loc) · 1.09 KB

fJS

A static type programming language implemented in Haskell.

Installation

ghc Main.hs
./Main

These commands compile the interpreter and execute the program in "test/lambda.js"

Features

  • JavaScript-like sytax (without "return");
  • Automatic currying;
  • Purely functional;
  • Statically typed;
  • Hindley–Milner type system

Syntax

This language adpots a JavaScript-like syntax that looks like:

function fix(f) {
    var x = f(x);
    x
}
function main(argument) {
    fix
}

This code segment (at toplevel) will be compiled to the intermediate representation:

let rec fix = function (f) 
                let rec x = f(x)
                in x
in fix

Every file has to contain a "main" function that is same with the C language.

This language supports several types (function, list, Number, Bool, String) and the operations on those types (head, tail, cons on lists; +, -, *, , ==, !=, <, >, <=, >= ... on Number, if else on Bool).

TODO

  • Polymorphism

Author

  • Fei Peng

Copyright

Copyright (c) 2015 Fei Peng