matu3ba/zig-reduce

clarify 3 blocker issues to render non-deleted parts and check for unused references

matu3ba opened this issue · 1 comments

  • render non-deleted parts:
    • render.zig is not referenced from std.zig
    • methods in render.zig dont accept skipping parts
    • or there is no method in render.zig which can skip parts
  • check for unused references
    • checkUsed is in AstGen.zig and not public
    • AstGen.zig is in src/, which is not available to libstd => could be hacked around.
  • get result type of function run to replace the fn calls with the result code.
    • Note: This may be errorneous, because fn calls may have relevant side-effects on the environment the code runs in. Think of the OS that may close file descriptors. Other codepaths might access the same file and wait, which would lead to a dead-lock.
    • similar strategy holds for arithmetic stuff etc, where we want to rewrite the AST entry with the result.

workaround the first by copying and adjusting libstd parts until something to show is finished
and upstream changes can be discussed.

the second is much more annoying, because it requires vendoring compiler stuff, which has frequent breaking changes.

I dont even know how to do the third part without hacking up something like codegen.