This file defines the goals, scope, and architectural rules for the Marina repository. Any generated code, refactoring, or suggestions MUST follow these rules.
Marina is a Rust-based compiler and virtual machine for the Clipper / xBase-family language (often referred to in the docs as “Clipper-2025”).
Core traits today:
- Tokenizer + parser that build an AST
- Compiler that emits stack-based bytecode
- VM that executes that bytecode
- CLI-first developer workflow (examples + tests)
Important: this repo currently supports command-style Clipper syntax (e.g. IF/ENDIF, FOR/NEXT, LOCAL, USE, etc.) and built-in functions (e.g. OutStd, SetPos, Inkey).
- Compatibility and stability over introducing new syntax
- Small, targeted changes that match existing architecture and style
- Test-backed behavior (update or add tests in
tests/when changing semantics)
- Lexer, parser, AST
- Bytecode + stack VM execution
- Diagnostics and clear runtime errors
- Maintain and extend existing supported features (see
README.mdfor the canonical list) - Keep built-in function behavior consistent with docs/examples
- Main CLI:
clipper - Formatter:
marina-fmt(also exposed viaclipper fmt ...) - LSP:
marina-lsp(feature-gated via--features lsp) - DAP:
marina-dap(currently a stub)
The module/import system is explicitly deferred to a future phase (see the project roadmap; this work is tracked under Phase 5 / Ecosystem in docs/LANGUAGE_FEATURES_CHECKLIST.md).
There is a module system spec in docs/guides/writing_modules.md, but import "..." is not implemented in the Rust compiler/VM yet.
Copilot MUST NOT:
- Add
importsyntax to examples/tests as if it works - Implement a module loader/dylib system as drive-by scope creep
Database commands exist as stubs/placeholders (e.g. USE, DBSKIP, DBSEEK, REPLACE).
Copilot MUST NOT claim database functionality is implemented unless it actually is.
Avoid introducing (unless explicitly requested):
- Networking stacks, HTTP clients, web frameworks
- Async runtimes or concurrency models
- Full DBF/RDD engines, ORMs
- GUI frameworks
- Keep the phase separation:
- Parsing in
src/parser/ - Compilation in
src/compiler/ - VM execution in
src/vm/
- Parsing in
- Add/modify syntax by updating all layers consistently:
- Tokens/keywords:
src/token.rs,src/lexer.rs - AST:
src/ast.rs - Parser:
src/parser/* - Compiler:
src/compiler/* - VM/bytecode:
src/bytecode.rs,src/vm/*
- Tokens/keywords:
- Prefer diagnostics over
panic!for user-facing errors
- Run tests:
cargo test - If you change formatting behavior: ensure formatter tests still pass
Ask one clarifying question, or default to the smallest change that matches existing behavior.