r/delphi • u/PlusPilot4384 • 17h ago
Project I measured 879 Delphi 13 builds and documented 89 compiler directives so AI agents stop hallucinating Delphi & Win64 semantics (free demo on GitHub)
Hi r/delphi,
(Transparency: this is a commercial reference/tooling kit I built, with a free < 1 MB evaluation demo on GitHub.)
Whenever I watch AI coding agents work on real Delphi codebases — especially upgrading legacy Delphi 7/2007 32-bit projects to Delphi 12–13 & Win64, auditing compiler directives, or porting modules to C#/C++/Java — the same failure pattern shows up: the generated code looks plausible and compiles cleanly, yet breaks actual Delphi runtime behavior.
So I built Delphi Behavior Contracts (Universal Suite v1.0.0), measured directly against Delphi 13 Community Edition (879 build observations and 650 executable runs across Win32, Win64, and compile-only Android ARM).
What's inside
- 74 bilingual chapters (EN & RU) + full single-file books (EN & RU), analyzing each operation across 9 behavior contract dimensions (parameter modes & aliasing, hidden state, receiver dispatch, preconditions, evaluation order, arithmetic width & rounding, unwind cleanup, ownership, and external DFM/DB/DLL contracts).
- 89 compiler directive cards separating syntax the parser silently accepts from options that genuinely change generated code on Win32, Win64, and Android ARM — plus an explicit named register of 30 documentation vs. compiler ambiguities.
Concrete compiler-verified traps:
- All 6 physical models of
B := Aacross 13 type families (dynamic arrays share a mutable buffer without copy-on-write, long strings share with copy-on-write, static arrays/records copy by value). ExtendedWin32 (10-byte 80-bit x87) vs. Win64 (8-byte 53-bitDouble), including{$EXTENDEDCOMPATIBILITY ON}(SizeOf = 10, yet 53-bit arithmetic).- Banker's rounding in
System.Round(plususesshadowing), logicalshron signed integers, and eager evaluation ofVariant/ overloaded operators even under{$B-}.
- All 6 physical models of
- 100% offline cross-platform setup (
install.py, zero dependencies, zero symlinks): ships 8 native plugins (Claude Code, Codex, Cursor, GitHub Copilot/VS Code, Gemini CLI, Antigravity), pure skills for 13+ platforms (Windsurf, Cline/Roo/Kilo, JetBrains Junie, Kiro, web chats), and an offline Python/Docker MCP server (also in the official MCP Registry asio.github.DIIIUA/delphi-behavior-contracts) + Cloudflare Worker MCP and 14 client configs. Proprietary source never leaves your machine.
Free Demo & Honest Boundaries
The free < 1 MB demo includes the complete 74-chapter and 89-directive Table of Contents, 6 multi-difficulty excerpts, 4 full directive cards, 8 authentic compiler receipts, 6 .dpr probes, and working plugins/skills/MCP:
- Free Demo (GitHub): https://github.com/DIIIUA/delphi-behavior-contracts
- Full Edition (one-time purchase, from $99 launch / $149 individual): https://silentfish.dev/delphi
Honest scope limits: this is strictly a Delphi / Object Pascal language, behavior-contract, and directive reference — not a VCL, FMX, or FireDAC component API encyclopedia. It does not claim 100% coverage of the language or any ABI; unresolved questions are listed explicitly by name. Independent product, not affiliated with Embarcadero Technologies.
If you're maintaining or upgrading legacy Delphi to Win64, I'd love to hear which compiler or directive traps still bite your team or AI tools most often.






