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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?