:camel: 使用 Go 和 LLVM 实现静态类型化的函数式编程语言
GoCaml:camel: ================ [![Linux and macOS Build Status][]][Travis CI] [![Windows Build Status][]][Appveyor] [![Coverage Status][]][Codecov] GoCaml 是基于 [MinCaml][] 使用 [LLVM][] 的 Go 中的 OCaml 的子集。GoCaml 为原始 MinCaml 添加了许多功能。 MinCaml 是一种用于教育目的的 OCaml 最小子集。它是静态类型的,并编译为二进制文件。 本项目旨在为自己的编程语言进行增量编译器开发。已实现类型推断、闭包转换和中级 IR。 - 日语演示文稿 (Go Conference Tokyo 2017 Spring) - 日语演示文稿 (builderscon 2017) 示例: ``` …
In above program, expressions are evaluated in order of e1 -> e2 -> e3 -> e4 and the sequenced
expression is evaluated to the value of e4.
Program must be evaluated to unit type, so the e4 expression must be evaluated to () (unit value).
There is a block comment syntax. It starts with (* and ends with *). Any comment must be closed
with *), otherwise it falls into syntax error.
ml
(* 这是注释。*)
There are unit, integer, boolean, float and string constants.
ml
(* 整数 *)
42;
(* 浮点数 *)
3.0;
3.14e+10;
3.14e-10;
1.;
(* 布尔值 *)
true;
false;
(* 字符串 *)
"hello, world";
"contains\tescapes\n";
(* 只有一个被类型为单位的常量 *)
()
print_* and println_* built-in functions are available to output values to stdout.
ml
print_int 42;
println_bool true
1暂无开放 Issues,或尚未同步最近议题。