A statically typed functional language
for the Erlang VM
staff software engineer
Latest version is v0.1, so everything is still a WIP!
let rec fib_aux n b a =
if n <= 0 then a
else fib_aux (n-1) (a+b) b
let fib n = fib_aux n 1 0
let main _ =
let fib_nth = [
(10, fib 10);
(1000, fib 1000);
(100000, fib 10000)
]
in Io.format "~p\n" [numbers](* action can be one of these 2 *)
type action = Login | Logout
(* this is opaque and can't be inspected! *)
type id
(* session must have both of these fields *)
type session = {
logged_in_at: DateTime.t;
user_id: id;
}
let handle_action next state =
match next with
| Login -> (* begin session *)
| Logout -> (* end session *)module Hello = struct
(* print a name! *)
let say ?(name="Joe") =
Io.format "Hello, ~p!\n" [name]
end
let rec run ~args:(name :: args) =
Hello.say ~name;
run ~args
let main () =
un ~args:["Joe";"Robert";"Mike"]Zero-cost Interop
module Logger = struct
external info : string -> unit = ""
end
let main () = info "hello world"-module(presentation).
-export([main/0]).
% Calls the actual logger module directly!
main() -> logger:info(<<"hello world">>).