This document captures the current working agreement for Skunk development.
Skunk language behavior should be derived from these sources:
src/grammar.pestfor syntax- Parser, interpreter, and type-checker tests in
src/ast.rs,src/interpreter.rs, andsrc/type_checker.rsfor executable behavior README.mdfor language-facing examples and intent- Focused design notes in
docs/for agreed future language directions such as pointers and allocators
If these disagree:
- Grammar and tests win over prose
- README should be updated to match implemented behavior
- New language decisions should add or update tests
- The user is the language designer
- The implementation agent owns development, refactoring, testing, and architecture decisions
The preferred input format for new features is:
- syntax
- semantics
- 1-2 valid example programs
- expected invalid cases or errors
We are keeping this repository and evolving it in place rather than restarting from scratch.
Why:
- The repo already has a parser, AST, type checker, interpreter, and initial LLVM compiler path
- The language is still evolving, so preserving iteration speed is more valuable than a clean-slate rewrite
- Existing tests provide a growing language contract
Aggressive refactoring is allowed when it improves the long-term language implementation.
Skunk should move toward a clearer compiler pipeline over time:
- Parse source into syntax-level AST
- Perform semantic analysis and type checking
- Lower into a simpler typed IR
- Execute either through an interpreter/runtime path or LLVM code generation
- Keep tests covering syntax, typing, and runtime behavior at each layer
The current interpreter remains valuable as a reference implementation while the compiler backend grows.
- Separate language front-end concerns from runtime concerns
- Reduce coupling between parsing, type checking, evaluation, and codegen
- Continue expanding LLVM support feature by feature
- Prefer adding targeted tests before or alongside new language features
- Keep unsupported compiler features failing clearly rather than silently degrading behavior