nimskull
nimskull copied to clipboard
Experiement: Data Oriented Design AST Sketch
First pass attempt at drafting a DOD AST based on this discussion: https://github.com/nim-works/nimskull/discussions/139
Breaks/Issues:
ast.transitionXprocs now return a new node- no more nil means have to use a sentinel value
signature change for transition procs mean we're creating new node this could well break assumptions that pervade the compiler. Worst case will need to supprot the mutability for now to get the first port, then figure out how to start changing up the compiler based on fork/join/mutation observations.
Blocker(s): The VM takes address of nodes, but now transitions might mean those are no longer valid. Even if we rely on id as address, this is likely not the right semantics, as we want to point to the AST "position", for example when we're doing constant expression evaluation incrementally
Reviewers:
- meant as an example and discussion point for now in the discussion thread
- It doesn't compile because of VM breakages elaborated above
- ast.nim contains all the real content
- other changes are to satisfy the compiler
- do not merge
resurrected, this was far less painful, it's getting very close to allow for some discussion, just a few clean-up items but that can be somewhat concurrent.
Immediate Items:
- [ ] test fixes
- [ ] tcompilerapi
- [ ] tcan_compile_nim
- [ ] results
- [ ] ic category
- [ ] it's pretty slow right now
- [ ] clean-up type and report storage, tables are super slow
Big thanks to @zerbina their VM rework has been a huge unblocker.