zig0

my attempts at zig bootstrapping in C
Log | Files | Refs | README | LICENSE

README.md (970B) - Raw


      1 # About
      2 
      3 zig0 aspires to be an interpreter of zig 0.15.1 written in C.
      4 
      5 This is written with help from LLM:
      6 
      7 - Lexer:
      8   - Datastructures 100% human.
      9   - Helper functions 100% human.
     10   - Lexing functions 50/50 human/bot.
     11 - Parser:
     12   - Datastructures 100% human.
     13   - Helper functions 50/50.
     14   - Parser functions 5/95 human/bot.
     15 - AstGen: TBD.
     16 
     17 # Testing
     18 
     19 Quick test:
     20 
     21     zig build fmt test
     22 
     23 Full test and static analysis with all supported compilers and valgrind (run
     24 before commit, takes a while):
     25 
     26     zig build -Dvalgrind
     27 
     28 # Debugging tips
     29 
     30 Test runs infinitely? Build the test program executable:
     31 
     32     $ zig build test -Dno-exec
     33 
     34 And then run it, capturing the stack trace:
     35 
     36 ```
     37 gdb -batch \
     38     -ex "python import threading; threading.Timer(1.0, lambda: gdb.post_event(lambda: gdb.execute('interrupt'))).start()" \
     39     -ex run \
     40     -ex "bt full" \
     41     -ex quit \
     42     zig-out/bin/test
     43 ```
     44 
     45 You are welcome to replace `-ex "bt full"` with anything other of interest.