|
I had a similar reaction, and I'm not sure that it's a "damn kids, get off my lawn" reaction. Specifying an unambiguous grammar may be difficult - which implies parsing may become a problem. An implementation exists, so the author has something working, but I'm wondering how robust the parsing is. I haven't seen many code examples (only short fragments on the page), so I don't know what potential issues, if any, there are. But, this is the sort of thing that could significantly complicate adding new language features that requires additional syntax. edit: I'm perusing the source for the compiler, which is of course written in Zinc. This code from the main driver of the compiler perhaps gives a better feel for how it may look in practice: while i < argc
def arg = argv[i]
if is equal (arg, "-debug")
debug = true
elsif is equal (arg, "-v")
version = true
elsif is equal (arg, "-u")
unicode = true
elsif is equal (arg, "-o") && i < argc-1
out filename = new string (bundle, argv[++i])
to OS name (out filename)
elsif is equal (arg, "-I") && i < argc-1
append (include path, new string (bundle, argv[++i]))
else
filename = new string (bundle, arg)
end
++i
end
From an aesthetic point of view, it doesn't look that bad. In this example, I think "is equal", "out filename", "to OS name" and "include path" are all identifiers. But I'm still wondering what kind of parsing and lexing issues that may arise. |
For example I was wondering if "new" is a keyword. If it is, then "new string ()" might be something interesting, otherwise it's just a function call.
Similarly this raises a question of whether I can write the following code:
This might or might not be permitted because "end" is a keyword. If it is permitted, then the result looks pretty damn ambiguous to me. If it's not then I have to name my identifier differently, like so: But then I'm skrewing up the style of my code...