Skip to content
/ fJS Public

A statically typing programming language implemented in Haskell.

License

Notifications You must be signed in to change notification settings

fiigii/fJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A statically typing programming language implemented in Haskell.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published