3 ms·
This language looks super promising. With the exceptions of 'no type inference' and 'no arithmetic precedence', I really like its anti-features list. With reg
by mrkeen 3y ago
This language looks super promising. With the exceptions of 'no type inference' and 'no arithmetic precedence', I really like its anti-features list.
With regard to 'no arithmetic precedence', I tried
printLn((1 + 2) + 3);
and
printLn(1 + 2 + 3);
Sure enough, the first one compiles, but the second doesn't.
Also, (n-1) is a parse error unless you put a space after the minus.
I got curious if recursion was properly handled, given it wasn't in the anti-features list, but no luck:
module body Foo is
function go(acc: Nat64, n: Nat64): Nat64 is
if n = 0 then
return acc;
else
return go(acc + n, n - 1);
end if;
end;
function main(): ExitCode is
printLn(go(0, 135000));
return ExitSuccess();
end;
end module body.
yields
Segmentation fault (core dumped)
- joshmarlow 3y agoThat's curious - one of the example programs computes the fibonacci sequence. The language is clearly still a work in progress. I wonder what the difference is in your recursion and what's listed? https://austral-lang.org/examples/fib https://austral-lang.org/examples/fib
- mrkeen 3y ago> I wonder what the difference is in your recursion and what's listed? How deep you recurse :D
- Scarbutt 3y agoI would add 'no macros' being a no no too.
- colanderman 3y agoI prefer the rule in my own languages of "no arithmetic expressions whose meaning can be changed by adding parentheses". So `x + y - z` is allowed but `x - y + z` is not.
- gpm 3y agoIf operators are over-loadable, you support floats (in a non ffast-math mode), or you treat overflow in most non-modular-arithmetic ways, (x + y) - z and x + (y - z) are different. Maybe it's worth saying "they're close enough to the same that parentheses should be optional", but I can definitely see the argument for just requiring them regardless.
- colanderman 3y agoValid point, though my current language supports neither overloading, floats, nor non-modular integer overflow, and parentheses are permissible where not required (for extra-semantical cases where order does matter) :)
- danaugrs 3y agoThis is a cool idea that I hadn't heard or thought of before.
- zetalyrae 3y agoI wouldn't rely on TCO being available, the bootstrapping compiler right now just emits very simple C (though GCC/LLVM might eliminate the recursion if they can). Ideally I'd like stack overflow to be a clean abort rather than a stack overflow (just to make the error message more explicit) but I haven't got around to adding that.
- saghm 3y agoFor a language that seems to market itself based on being secure, this is pretty troubling
- verdagon 3y agoAustral is still alpha, so this kind of thing is expected. It's heading in a good direction, give it some time.
- olodus 3y agoI disagree with you about 'no type inference'. I understand why some swear by type inference, but personally I prefer the complete clarity it provides to avoid it. If writing those characters annoys you, have tooling help you with avoiding that.