Austral
Introducing Austral: A Systems Language with Linear Types and Capabilities
型クラス
Safe Arithmetic
代数的データ型
以下のものは含まない
No garbage collection.
No destructors.
No exceptions (and no surprise control flow).
No implicit function calls.
No implicit type conversions.
No implicit copies.
No global state.
No subtyping.
No macros.
No reflection.
No Java-style @Annotations.
No type inference, type information flows in one direction.
No uninitialized variables.
No pre/post increment/decrement (x++ in C).
No first-class async.
No function overloading (except through typeclasses, where it is bounded).
No arithmetic precedence.
No variable shadowing.
例
code:austral(ocaml)
module body Fib is
function fib(n: Nat64): Nat64 is
if n < 2 then
return n;
else
return fib(n - 1) + fib(n - 2);
end if;
end;
function main(): ExitCode is
print("fib(10) = ");
printLn(fib(10));
return ExitSuccess();
end;
end module body.