I've come to realize that the best, sweetest, most readable syntax would be homogenous. That is, every line must have the same structure: either the meaning-defining token must always be at the front of the line, or at the back. And the first case is the best. That way you can always tell what is going on in a line of code by looking at just the first token. No more bullshit like that:
int main() { // But it's not an int, it's a definition of a procedure!
double scores[3]; // But we're not doubling anything, we're defining something!
scores[0] = 1.5; // But we're not scoring anything, we're performing an assignment!
scores[1] = 2.5; // And we're not assigning to scores, we're assigning to its elements!
scores[2] = 3.5; // Same error as above;
// We're not couting anything! In fact it's hard to make out visually what is going on
// as we are calling array accesses, listing literals and calling the <<. This is
// an absolutely unreadable line.
cout << scores[0] << '\t' << scores[1] << '\t' << scores[2] << endl;
// Finally, an easily readable, well-syntaxed line!
return 0;
}
And no more bullshit like that too: alloca $ \erroffset -> do
-- "pcre_ptr" is not what this line does, it shouldn't be up front!
pcre_ptr <- c_pcre_compile pattern (combineOptions flags) errptr
erroffset nullPtr -- This one's OK.
if pcre_ptr == nullPtr
then do
-- This is a clusterfuck! Not only is "err" unworthy of being at the front,
-- but also the order of calls is reversed the first call is "peek"
-- which comes almost last but not the last in the line! Absolutely unreadable!
err <- peekCString =<< peek errptr
return (Left err)
else do
reg <- newForeignPtr finalizerFree pcre_ptr
return (Right (Regex reg str))
No, I want a language in which every line conforms to the most eye-soothing rule of all: explain yourself up front so I don't have to go on a missing persons searching expedition just to find out what you're doing.
Are there any languages with a syntax like that, /porg/?
Name:
Anonymous2014-03-30 14:54
hax my anus
Name:
Anonymous2014-03-30 15:06
Lisp?
Name:
Anonymous2014-03-30 15:25
shenlanguage.org maybe?
Honestly, I don't know if it's even possible at the moment. We'd have to understand all which is possible with programming within the foreseeable future to create such a language. So, the truth is programming at the core is still an art form. Standardizing syntax often fail to evolve as new ideas and constraints are introduced.
This especially convinces me that visual languages will remain cumbersome in the long run. Nothing is as concise as a textual language. Only your lack knowledge hinders the clarity. Although visual languages certainly aid learning such knowledge, I fail to see a way for such a language to evolve with ideas when most textual language cannot. The probable result is writing visual comments in the same way text books have diagrams.