Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 1, 2026

Summary

Reorganizes plotnik-lib into a professional compiler structure with clear phase boundaries:

  • analyze/ - Semantic analysis (symbol_table, dependencies, type_check, validation)
  • compile/ - Thompson NFA construction (AST → IR)
  • emit/ - Bytecode emission (IR → binary)
  • typegen/ - Type declaration extraction (bytecode → .d.ts)

Pipeline

parser/ → analyze/ → compile/ → emit/ → bytecode binary
                                              ↓
                                        typegen/ → .d.ts

Changes

  • Move semantic analysis from query/ to analyze/
  • Promote query/compile/ to top-level compile/
  • Create emit/ from query/codegen.rs + bytecode/layout.rs
  • Rename codegen/typegen/ (clarifies it extracts types from bytecode, not codegen in the traditional compiler sense)
  • Update AGENTS.md with new project structure
  • Delete completed docs/wip/big-bang-refactor.md

Test plan

  • All 660 tests pass
  • No clippy warnings
  • Module documentation updated

@zharinov zharinov changed the title refactor: reorganize compiler into analyze/, compile/, emit/, typegen/ refactor: reorganize compiler Jan 1, 2026
@zharinov zharinov merged commit 4839148 into master Jan 1, 2026
4 checks passed
@zharinov zharinov deleted the refactor/compiler-reorganization branch January 1, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants