module
Lapis::Docs::I_ARCHITECTURE_AND_EXTENSIONS::A_DUAL_PARADIGM_MODEL
Overview
The Dual-Paradigm Execution Model
Comprehensive architectural deep dive into Lapis's dual execution paradigms, comparing in-editor GDExtension dynamic loading with standalone LibGodot host execution.
Executive Summary & Key Topics
| Topic | Method / Anchor | Description |
|---|---|---|
| Comparative Architectural Matrix | .topic_00_paradigm_comparison |
Host binary, loading mechanics, GC init, and primary use cases. |
| Mode A: GDExtension Dynamic Loading | .topic_01_mode_a_mechanics |
How Godot loads crystal_bridge.dll and bootstraps Crystal's runtime. |
| Mode B: Standalone LibGodot Host | .topic_02_mode_b_mechanics |
Crystal executable hosting the Godot engine directly. |
Related Guides & Source References
- Architecture Spec:
AGENTS.md - Bridge Source:
src/bridge/crystal_bridge.cpp
Defined in:
libgodot/docs/i_architecture_and_extensions/a_dual_paradigm_model.crClass Method Summary
-
.topic_00_paradigm_comparison : Nil
Comparative Architectural Matrix: Host binary, loading mechanics, GC init, and primary use cases.
-
.topic_01_mode_a_mechanics : Nil
Mode A: GDExtension Dynamic Loading: How Godot loads crystal_bridge.dll and bootstraps Crystal's runtime.
-
.topic_02_mode_b_mechanics : Nil
Mode B: Standalone LibGodot Host: Crystal executable hosting the Godot engine directly.
Class Method Detail
Comparative Architectural Matrix: Host binary, loading mechanics, GC init, and primary use cases.
Key Topics & Information
- Mode A: Host is godot.exe, dynamic DLL loading via GDExtension bridge
- Mode B: Host is game.exe, statically or dynamically linked LibGodot host
- Mode A features instant F5 hot reloading via shadow copies
- Mode B provides minimal memory footprint and zero GDExtension loader overhead
Mode A: GDExtension Dynamic Loading: How Godot loads crystal_bridge.dll and bootstraps Crystal's runtime.
In Mode A (Development & Editor):
- Godot boots and parses
addons/crystal_integration/crystal.gdextension. - Godot calls
crystal_library_initincrystal_bridge.dll. - The bridge initializes Boehm GC (
GC_init()) and CRT hooks. - The bridge loads
bin/game.dll(via shadow copy on Windows). - The bridge passes function pointers to
crystal_godot_init. - Custom Crystal nodes register with Godot's
ClassDB.
Mode B: Standalone LibGodot Host: Crystal executable hosting the Godot engine directly.
In Mode B (Production Shipping & Headless Runners):
- The OS executes
bin/game.exe(a native Crystal binary). - The Crystal CRT initializes Boehm GC natively.
- The Crystal executable dynamically links
bin/libgodot.dll. - Crystal invokes
libgodot_create_godot_instanceand drives the engine main loop. - Provides a self-contained, high-performance runtime for dedicated servers and production exports.