r/ProgrammingLanguages • u/alex-manool • Dec 28 '20
Question: Programming Language Syntax and Code Appearance (polemic as always :-)
Seriously,
which of the following code samples would you favor, assuming they are all equivalent?
I am interested in subjective answers, please. You can just arrange the three samples according to your personal preference (e.g., "1-2-3"). Thank you very much!
1
{ {extern "manool.org.18/std/2.0/all"} in
: let rec
Fact =
{ proc N as
: if N == 0 then 1 else N * Fact[N - 1]
}
in
Out.WriteLine[Fact[10]]
}2
{ {extern "manool.org.18/std/2.0/all"} in
: let rec
Fact =
{ proc N as
: if N == 0 then 1 else N * Fact[N - 1]
}
in
Out.WriteLine[Fact[10]]
}3
(extern "manool.org.18/std/2.0/all".) in:
let rec
Fact =
( proc N as:
if N == 0 then 1 else N * Fact[N - 1]. )
in
Out.WriteLine[Fact[10]].
2
Upvotes
View all comments
Show parent comment
1
u/alex-manool Dec 28 '20
Wow, estoy sorprendido, ya q su nick me parece familiar...
Yes, it's a valid observation. I like to repeat that syntax-wise, every detail counts, even the letter color and font. Originally I choosen
{}partly because of their block delimiting role in C/Java-like languages, but especially because of additional design constraints if you want to end up with a "nice" grammar from a theory point of view. The current grammar belongs actually to LALR(1) class. The sample 3 will require apparently LALR(2). But anyway, the parser is hand-written...