First an introduction. Foundry is meant to be a general purpose programming language that targets the CLR. I call it Foundry because there will be a heavy emphasis on making intelligent data objects. Building data objects tends to be very tedious. I especially when you start looking at wiring in update events for WPF, creating immutable variants of each class, tagging everything for serialization, etc.
The construction of blocks is vital for most programming languages. Popular options include keywords, braces, and whitespace. In order to test the options, I am looking at a hello world program. Using three block we see the program name, the list of assemblies that the program references, and the main function.
I’m discarding this option because every time I try to copy and paste it the white spaces gets messed up.
Braces and Parens
There are three commonly used format for braces and parens.
Variant 1 – Suffix
Variant 1 is in the running for now.
Variant 2 – Suffix on new line
Burning two lines for each block header just seems stupid to me, so this one it out.
Variant 3 – Prefix
Placing the braces before the the block keyword makes it obvious that they pretty redundant. So how about a fourth variant instead.
Variant 4 – Closing only
Very succinct, though perhaps a different closing character is in order. Definitely in the running.
Variant 1 – End keyword with block identifier
This is redundant, but it does allow for a smarter compiler. If you see “end program” before “end references”, then you can tell the user what’s going on. Or you could even implicitly end the previous block. So this one is in the running.
Variant 2 – End keyword
This isn’t quite as clear as the other one, but it is nice and terse.