bruto-pascal
A Mini-Pascal IDE with LLVM backend and lldb debugger, built with Turbo Vision for Rust
- Active · last change 10-16-2026
- ★ 8 on GitHub
README
Bruto Pascal
A TUI-based Mini-Pascal IDE and compiler. The IDE side is built with bruto-ide; the language side with bruto-pascal-lang. Both ride on LLVM 18 (via inkwell) for codegen with full DWARF debug info, and embed lldb for stepping.
What it speaks
Most of Wirth's 1973 Pascal Report plus parts of ISO 7185 (conformant array
parameters) and a useful slice of Turbo Pascal (string ops, type casts,
{$R+} / {$Q+} / {$I+} directives, forward).
See bruto-pascal-lang/GRAMMAR.md for the BNF and bruto-pascal-lang/README.md for the feature list. LANGUAGE-TODO.md tracks what's still missing (units, OO, exceptions).
A demo
examples/writer is Bruto Writer, a small word
processor in Free Vision: menus, an editor, dialogs and file dialogs,
with document logic that uses classes, interfaces, generics, Variants,
Currency, run-time type information and component streaming. Its
command-line twin, writercheck.pas, prints the same output and writes
the same files with Bruto Pascal as with FPC 3.2.2.
Free Vision comes from FPC's sources, an optional submodule: run
git submodule update --init --checkout -- third_party/fpc to fetch
it, and see the demo's README for the brutop -Fu ... command.
Features
- Syntax-highlighted editor for Pascal
- Click-to-toggle breakpoint gutter
- LLVM IR + DWARF; on macOS we run
dsymutilto make lldb happy - Integrated lldb: step over (F8), step into (F7), continue (F5)
- Variable watch panel (decodes set bitmasks into Pascal literal form)
- Compile (Alt+F9), Build (F9), Run (Ctrl+F9), Debug (F5); Compile checks the focused file without linking, a unit on its own
- A primary file, as in Turbo Pascal (Build › Primary file…): the program Build, Run, Debug and Profile work on, whichever window you are editing. Without one, a unit's window builds a program that uses it (an open one, else one in the unit's folder)
- Output panel for compiler + program console output
Prerequisites
brew install llvm@18Build & Run
IDE:
LLVM_SYS_181_PREFIX=/opt/homebrew/opt/llvm@18 cargo runCLI compiler:
LLVM_SYS_181_PREFIX=/opt/homebrew/opt/llvm@18 cargo run -- -r SAMPLE.PASTests (must run serially because they share a capture file):
LLVM_SYS_181_PREFIX=/opt/homebrew/opt/llvm@18 cargo test --workspace -- --test-threads=1Architecture
| Crate | Purpose |
|---|---|
| bruto-ide | Pluggable TUI IDE framework with Language trait |
| bruto-pascal-lang | Mini-Pascal parser, LLVM codegen, syntax highlighter |
| bruto-lang | Shared LLVM runtime (printf wrappers, file I/O, capture) |
| bruto-pascal (this repo) | Binary combining the three |
License
MIT

