One thing I'm looking at is "block" syntax. The existing modifiers like public, virtual, static, compile/runtime would be condensed into a "block definition", which would define attributes for all following definitions- and in addition, I might want to add an "attribute" keyword to that.
type t {
public static runtime attribute(Const) {
ohai() {}
}
public virtual compiletime {
some_func() {}
}
}
This would significantly reduce the syntactic overhead of static, compiletime definitions, as well as any class where many functions/variables share the same basic attributes. Once I add this (and cut the old stuff), I need to add something to distinguish functions, I need to crack up Lambda expressions, unnamed type literals. These are already parsed but have no associated AST and the parser takes no action upon finding them, and I'll probably also discover a few corner cases where this is true. I also need to cut the ability to put access specifiers at global scope, because that's just wrong, and look again at saving the use of . as a compile-time access notation.
After that, run a few test harnesses on the parser and make sure that it works as advertised, then I'm on to semantic analysis.
The first step of semantic analysis is going to be to find all structures that *must* exist. By that, I mean all functions, all namespaces, and all types which are defined in-place and not metaprogrammed into existence, and add them to the symbol table. Then start from Main() and determine the compile-time program that will yield the program of the next phase- repeat until we get to Main()'s runtime, which will be the final phase.
Once that's done, generate the code, execute it, repeatedly, and then we're done diddly done bun.
I keep having something I intend to post, and I always forget what it is after I remember it. :( In addition, I'm very sick (again!) right now, so expect fewer postings whilst I scream in pain.
No comments:
Post a Comment