# 05 — GML 5.3a Virtual Machine

## Architecture

- **Lightweight stack-based VM** embedded in Delphi runner.
- Active interpreter — instructions executed sequentially at runtime.
- No JIT, no native compilation.
- Contrast with modern **YYC** (transcompiles GML → C++ → LLVM/MSVC native).

## Performance characteristics

Interpreter overhead is high enough to be observable. Documented pain points:

- Heavy alpha blending → frame-rate drops.
- Continuous alpha-reduction logic → degradation.
- Dense particle systems → degradation.
- Heavy floating-point math → noticeable slowdown.

If decompiled code shows manual frame-skipping, sprite caching, or `room_speed` adjustments around graphical sections, this is why.

## Implications for re-injection

- Modern GML syntax (e.g. `var x = 0;` C-style array decl) **will fault** in the 5.3a interpreter. See [06-gml-syntax-5x](06-gml-syntax-5x.md).
- No native socket support — multiplayer goes through 39dll. See [08-39dll-networking](08-39dll-networking.md).
- No native 3D — any 3D effects are GML trigonometric pseudo-3D (vertex pipeline introduced in GM6+). Don't assume Direct3D usage.
- DLL bridge available via `external_define()`. See [07-gml-core-functions](07-gml-core-functions.md).

## See also

- [06-gml-syntax-5x](06-gml-syntax-5x.md)
- [07-gml-core-functions](07-gml-core-functions.md)
- [08-39dll-networking](08-39dll-networking.md)
