roy

Small functional language that compiles to JavaScript.

  • 所有者: puffnfresh/roy
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Roy Build Status

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

  • Damas-Hindley-Milner type inference
  • Whitespace significant syntax
  • 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 (addTwo can only take a Number).

See the examples directory for more.

License

MIT

Editor Support

Resources

主要指标

概览
名称与所有者puffnfresh/roy
主编程语言JavaScript
编程语言Python (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2011-11-24 21:56:31
推送于2014-03-16 20:22:09
最后一次提交2013-12-22 12:12:37
发布数7
最新版本名称v0.2.2 (发布于 2013-06-29 18:54:46)
第一版名称v0.1.2 (发布于 )
用户参与
星数840
关注者数46
派生数69
提交数508
已启用问题?
问题数146
打开的问题数62
拉请求数48
打开的拉请求数2
关闭的拉请求数10
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?