proj-oot-ootSyntax

The lexical syntax is defined by regular expressions. The parse syntax is LL(1).

Almost everything which affects parsing or grouping is punctuation.

Almost all punctuation defined in Oot the language (e.g. not counting punctuation operators in the std library) is either:

Arithmetic operators are doubled, e.g. ++ is +, is /, etc; single character ops are reserved for other stuff

Punctuation operators may only be defined by first defining an alphanumeric function or macro to bind to them, and then setting the punctuation operator equal to that.

More than one letter, all uppercase, is a label.

Differences in capitalization after the first letter have no effect (and are removed by jfmt).

Oot syntax design todos

use of {}s? kernel if? dict as switch with closure incld. mutate in outer scope? how to indicate which builtins might be overridden in a module? to separate modular compilation step and whole program analysis? ruby-style blocks that can inject e.g. 'return' into caller?


todo move much of ootSyntaxThoughts here.

heed Pratt's advice for precedence levels:

---

lowercase and capitalized names (which includes uppercase single letters) are almost identical, except:

capitalized names can optionally break through hygenicity of macros. But how to encourage ppl not to use metaprogramming tricks like ruby's method_missing to do the same thing for lowercase names? perhaps a version of method_missing that only works on capitalized names should be provided, and use of the full (original) method_missing that works on all names should be discouraged (at a higher level of the metaprogramming hierarchy).

however, excepting all caps, differences in capitalization after the first letter have no effect; e.g.

xoXo and xoxo are the same

XoXo? and Xoxo are the same

hmm, potential problem though: if you replace and API implementation with another one using methodMissing, you make the client change to capitalized method names. so would have to provide a way to 'break thru' this. Just using the unsafeMethodMissing is dirty. Perhaps provide a way to use normal methodMissing but for the implementor (not the client) to statically assert that certain methods are provided? Or, even better, to allow macros to generate these assertions at compile-time? The latter would allow the implementation of generic methodMissings that can target multiple APIs at compile-time, and which still generate the appropriate assertions so that the client can use lower-case method names. It would not allow you to replace compile-time genericity with run-time, though.

But if we also allow the required assertions to be added by a third-party, then since someone has to give the generic module the necessary parameters to choose or specify the particular API that is being generated in this case, that same party can also attach the required assertions.

So i think the problem is/must be solved in this way, unless we change the capitalization.

And if we do do that, then as a bonus we could simply not require typechecking the method names for capitalized names, on the assumption that if the API was going to prove that it serves these names, it would allow lowercase ones anyhow.

---