0.2.2 • Published 11 years ago

roy v0.2.2

Weekly downloads
30
License
-
Repository
-
Last release
11 years ago

Roy

Roy is a small functional language that compiles to JavaScript. It has a few main features:

  • Damas-Hindley-Milner type inference
  • Whitespace significant syntax
  • Compile-time meta-programming
  • Simple tagged unions
  • Pattern matching
  • Structural typing
  • Monad syntax
  • Not-horrible JS output

Usage

To compile:

make deps
make

To enter a REPL:

./roy

To compile and run a .roy file:

./roy -r examples/helloworld.roy

To compile a .roy file to .js:

./roy examples/helloworld.roy
cat examples/helloworld.js

Example

Input (test.roy):

let addTwo n =
    n + 2

console.log (addTwo 40)

Output (test.js):

var addTwo = function(n) {
return n + 2;
}
console.log(addTwo(40))

Calling addTwo "test" will result in a compile-time error.

See the examples directory for more.

TODO

  • Mutable types
  • Types across modules
  • Allow explicit types that have type parameters
  • Standard libary
  • Tail recursion
0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.5

12 years ago

0.1.4

12 years ago

0.1.3

12 years ago

0.1.2

12 years ago