v0.2.3-dev #2052
splanck
announced in
Announcements
v0.2.3-dev
#2052
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Viper Compiler Platform - Release Notes
Version 0.2.3 - Pre-Alpha (March 25, 2026)
Release Overview
Version 0.2.3 is a major hardening, tooling, and infrastructure release. Highlights:
zia-serverfor editors and AI assistants.viper replfor both Zia and BASIC with tab completion, persistent history, and meta-commands.examples/, devdocs merged intodocs/, 900+ doc fixes.By the Numbers
New Features
Interactive REPL
A full-featured interactive REPL accessible via
viper repl,zia(no args), orvbasic(no args).Built on the TUI framework's TerminalSession/InputDecoder for raw-mode terminal I/O — zero external
dependencies.
.help,.quit,.clear,.vars,.funcs,.binds,.type,.il,.time,.load,.save~/.viper/repl_history_{lang}), double Ctrl-C exit_pipe/_dup/_dup2/_readstdout captureNative Assembler and Linker
A complete in-process assembler and linker that eliminates all external tool dependencies (
as,ld,link.exe) from the native compilation pipeline. Viper can now go from source to executable usingonly its own code — zero external dependencies, true to the project philosophy.
Assembler (MIR → .o)
and AArch64 (70+ opcodes, branch resolution, FP literal materialization)
--native-asm/--system-asmCLI flags to choose pipelineLinker (.o + archives → executable)
ObjFileAPIdynamic section), and PE (import tables, DOS stub)
CS_LINKER_SIGNEDflag (arm64 macOS)--native-link/--system-linkCLI flagsOptimizations
DeadStripPass) — ~53% binary size reductionDebug Info & Advanced Linker Features
.debug_linesection encoding viaDebugLineTable— maps machine instructions backto source file, line, and column for debugger integration
ELF (
SHT_PROGBITSwithoutSHF_ALLOC, emitted afterPT_LOADsegments),Mach-O (
__DWARFsegment withvmaddr=0, no VM permissions),PE (
IMAGE_SCN_MEM_DISCARDABLE, excluded fromSizeOfImage).textcontent andmatching relocations, reducing binary size for template-heavy or copy-heavy codegen output
when branch targets exceed architecture-specific displacement limits (±128MB on AArch64,
±2GB on x86-64)
OutputSection.allocflag distinguishes loadable sections from debug/metadata sectionsMach-O Two-Level Namespace
MH_TWOLEVELflag to Mach-O header, replacing flat namespace resolution. Required formacOS ARM64 — without it, CoreAnimation PAC pointer authentication traps fire ~1 second after
window creation
BIND_OPCODE_SET_DYLIB_ORDINAL_IMM/ULEBinstead of flat lookupOBJC_CLASS_$/OBJC_METACLASS_$symbols whose definingframework can't be determined by prefix alone
_objc_empty_cache,__CFConstantStringClassReference)Hardening
isCStringSectionflag prevents string dedup from corrupting binary data sectionsAssembler & Linker Layer Review (15 items)
Systematic review and refactoring of the native assembler/linker infrastructure:
findOutputLocation(O(S×C) → O(1) lookup)RelocConstants.hpp) replacing magic numbersObjFileWriterUtil.hppdeduplicating 3×appendLE/alignUp/padToimplementationsNameMangling.hpp)RelocClassify.hpp, 189 LOC)classifySections,computeSegmentSpan)RelocApplierMachOExeWriter(1,029 → 670 LOC) intoMachOCodeSign+MachOBindRebasemoduleskFrameworkRules[]table replacing ad-hoc prefix checks)All 11 demos build and run with the native pipeline. 13 new assembler tests, 6 string dedup tests,
11 debug line tests, 9 debug section tests, 10 ELF exe writer tests, 7 linker integration tests,
plus ICF, branch trampoline, symbol resolver, and relocation edge-case test suites.
Zia Language Server (zia-server)
A dual-protocol language server supporting both MCP (for AI assistants) and LSP (for editors):
CompilerBridgefacade wrapping Zia compiler APIs, including entity field hoverzia-serverbinaryZia Language Features
Enum Types
Enumeration types for both Zia and BASIC frontends:
enumdeclaration, explicit/auto-increment values,exposevisibility, match exhaustivenesschecking, variant access via dot notation
ENUM...END ENUMblocks, explicit/negative values, keyword-as-name collision handlingMatch OR Patterns
New
Pattern::Kind::Orsupports pipe-separated alternatives in match arms. Lowered as a waterfallof test blocks — each subpattern's success jumps to the arm body, failure falls through to the next.
Typed Catch with List Shorthand
Exception handlers can now specify a type for the caught error, with list-literal shorthand syntax.
Say/Print Auto-Dispatch
Say(42),Say(3.14),Say(true)now work without explicit.ToString()conversion via typedruntime variants (
SayInt,SayNum,SayBool,PrintBool)..Len → .Length Rename
Collection
.Lenproperty renamed to.Lengthacross List, Map, and Set for consistency with thelanguage specification.
.Lenremains as an alias for backward compatibility.Bible Audit Remediation
Three missing platform features identified by the comprehensive documentation audit:
Http.Put(),PutBytes(),Delete(),DeleteBytes()completing the fullREST verb set
.rev()for reverse iteration and.step(n)for stepped iteration infor i in rangeloopsColor.REDthroughColor.ORANGE(10 named constants) as static propertiesPlus 900+ documentation fixes across the Bible reference manual.
Language Audit
Comprehensive end-to-end verification of all documented Zia and BASIC language features against the
live compiler and runtime. Validated every feature claimed in the reference documentation, filed a
structured bug report (
docs/bugs/language_audit_2026_03_25.md) with 13 findings:Confirmed Fixed (6)
.Trim(),.Replace(),.Split())EXPORTkeywordOpen Bugs Filed (7)
returnafter=>catch (e: Error)) not yet supportedinit()with different argsFOR EACHloop off-by-one on collection iterationReference Documentation Corrections
added limitation notes for properties and tuples, removed stale enum bug note
EXPORTkeyword documentationNew Runtime Test Programs (6)
33_enum_runtime.zia— enum declaration, variant access, match exhaustiveness34_async_functions.zia— async/await with Future.Get runtime calls35_optional_primitive_narrowing.zia— guard clause narrowing forInteger?36_entity_properties.zia— getter/setter property declarations37_string_instance_methods.zia—.Trim(),.Replace(),.Split(),.Contains()38_deinit_bindings.zia— destructor field binding propagationIL Optimizer — Three New Passes
EH Optimization (eh-opt)
Removes redundant
eh.push/eh.poppairs when the protected region contains nopotentially-throwing instructions (calls, traps, checked operations). Dead handler blocks are
cleaned up by subsequent DCE/SimplifyCFG. Registered in the O2 pipeline after check-opt.
Loop Rotation (loop-rotate)
Converts while-style loops into do-while form by duplicating the header condition into the latch
block and inserting a guard for the initial check. Eliminates one branch per iteration and improves
LICM/unrolling opportunities. Conservative: only rotates single-latch, single-exit loops with pure
headers. Registered in the O2 pipeline after loop-simplify.
Reassociation (reassociate)
Canonicalizes operand order for commutative+associative integer ops (Add/Mul/And/Or/Xor). Placed
before EarlyCSE in the O2 pipeline to expose more common subexpression elimination opportunities.
IL Optimizer — Pass Improvements
BasicAA::isNonEscapingAlloca()accessormaterializations in EarlyCSE/GVN
for proper dominance verification of SSA uses
cost model tuning (
maxCodeGrowth=2000) and O1 pipeline integrationcompatibility
requires signed arithmetic to use
.ovfvariants); overflow constant folding deferred toConstFold pass
predEdgesmap invalidation after instruction removal (vector pointer stability)O1 Optimizer Correctness & Performance
Major O1 optimization pipeline audit fixing multiple correctness bugs discovered through native
demo testing. All 11 demos now compile at O1; 9 of 11 run correctly at native -O1.
Correctness Fixes
parser. The inliner's escaped value analysis now resolves actual return types from the module's
function lookup table instead of using the Void instruction type — fixes paint app O1 crash
_il{id}suffix to cloned block params andinstruction results to prevent name collisions between caller and callee scopes
to prevent late-defined allocas from overwriting earlier observation marks. Added observation
checks for store-value operands, return operands, and branch arguments
entry block — external callers pass a fixed argument count matching the function signature.
Uses positional ABI prefix preservation with funcParamId fast-path
canonicalizeParamsAndArgsin SimplifyCFG's parameter canonicalization pass
definitions) as compatible with any parameter type, since the register allocator tracks
liveness independently of IL types
hoistLoopConstantspeephole pass incorrectly identifiednon-loop control flow (if/else merges, function exits) as loops, removing MovRI instructions
from mutually exclusive code paths — caused black ghosts in pacman and crashes in paint
blockBudget=1limits inlining to single-block calleesuntil multi-block continuation value threading is hardened. Single-block functions (getters,
setters, simple helpers) are the highest-value inline targets
replaceAllcreates cross-block SSAviolations when DCE's block param compaction runs afterward. SCCP already handles constant
folding; the AArch64 codegen peephole handles machine-level optimizations
loop contains mutating memory operations
Compilation Performance
Verifier::verify()calls insideSimplifyCFG verified the entire module per function per iteration (up to 40 full-module
verifications for a single SimplifyCFG invocation). Replaced with no-ops — the PassManager's
-verify-eachflag provides equivalent functionality when needed. 27x speedup formedium-sized modules (viperide: 4 minutes → 8.5 seconds)
entirely to avoid O(n^2) behavior in SimplifyCFG and other passes. The AArch64 codegen
peephole still runs. Reduces sqldb compilation from 8+ minutes to 11 seconds
Alloca Escape Verification
New Pass 4 in FunctionVerifier warns when a
retinstruction directly returns an alloca-derivedpointer, catching dangerous stack-pointer escapes at verification time.
Zia Lowering Optimizations
SwitchI32for multi-implementationmethod dispatch
SwitchI32fast path for integer-only match arms without guards,falling back to generic lowering otherwise
Async/Await Syntax
New
async/awaitkeywords with AST nodes, parser support, semantic checking, and lowering toFuture.Getruntime calls:Multi-Language Benchmark Suite
Cross-language benchmark programs for performance comparison across C, C#, Java, Lua, Python, and
Rust. Covers arithmetic stress, branch stress, call stress, fibonacci, inline stress, mixed stress,
redundant stress, string stress, and unsigned division stress. Matching IL benchmark programs for
direct Viper performance measurement.
AArch64 Exception Handling
Full EH opcode support for the AArch64 backend:
EhPush,EhPop,EhEntry,TrapDiv,TrapOvf,TrapIdx,TrapNull,TrapCast,ErrGetMsg,ErrGetCode,Resume.SipHash-2-4 Hash Function
Replace FNV-1a with keyed SipHash-2-4 using per-process random seed from OS CSPRNG for HashDoS
resistance in all runtime hash maps.
GC Epoch Tagging
Per-entry survival counter skips promoted objects in trial-deletion, with periodic full scans to
catch new cycles. Reduces GC overhead for long-lived objects.
AArch64 PassManager
Wire existing pass infrastructure into AArch64
CodegenPipeline, replacing monolithic per-functionloop. Brings the ARM64 backend architecture in line with x86-64.
AArch64 Performance Optimizations
Major performance work across the AArch64 backend, adding several new optimization passes:
Post-RA Instruction Scheduler
List scheduler running after register allocation with latency-based priority ordering and
anti-dependency tracking. Reorders instructions within basic blocks to improve pipeline utilization
while respecting data dependencies and register constraints.
Register Coalescer
Pre-regalloc
MovRR/FMovRRelimination via live interval interference analysis (~270 LOC).Reduces unnecessary register-to-register moves by merging compatible live ranges before linear scan
allocation. Integrated into the pipeline before the register allocator pass.
MIR Loop-Invariant Constant Hoisting
Hoists
MovRI(move-immediate) instructions from loop bodies into preheader blocks when theregister is callee-saved (x19-x28) and defined only by
MovRIwith the same immediate valuethroughout the loop. Uses natural loop body computation via reverse-reachability BFS from the latch
through predecessors, correctly handling non-contiguous loop bodies (blocks placed after the latch in
layout order).
Cross-Block Store-Load Forwarding
Peephole optimization that forwards stores to loads across basic block boundaries when the layout
predecessor has a single successor and the store/load access the same FP-relative offset. Includes
reachability verification to ensure the predecessor actually reaches the successor (unconditional
branch, conditional branch target, or fallthrough).
Division/Modulo Strength Reduction
Peephole pass that replaces expensive SDIV/UDIV/SREM/UREM instructions with cheaper sequences:
SDIVby power-of-2: sign-corrected arithmetic shift (22 cycles → 4 cycles)SDIVby arbitrary constant: magic number multiply-high (22 cycles → 6-8 cycles)UREMby power-of-2: AND mask (26 cycles → 1 cycle)SREMby power-of-2: sign-corrected AND+SUB (26 cycles → 5 cycles)Full O2 Pipeline Restoration
Restored 10 missing IL optimization passes to the native codegen O2 pipeline: loop-simplify,
loop-rotate, indvars, loop-unroll, check-opt, eh-opt, sibling-recursion, constfold, licm,
reassociate. The codegen pipeline was running a stripped-down O1-level optimizer despite requesting
-O2. Also fixed x86-64 codegen O2 gating threshold.Benchmark Results (Apple M4 Max, native -O2 vs previous baseline):
Additional Peephole Optimizations
conditional sequences
functions that don't need callee-saved save/restore
AND/ORR/EORimmediate operandsPeephole Decomposition
Split the monolithic 2,750-line AArch64
Peephole.cppinto 6 focused sub-passes underpeephole/:IdentityElim,StrengthReduce,CopyPropDCE,BranchOpt,MemoryOpt,LoopOpt. Sharedpeephole templates (
PeepholeDCE.hpp,PeepholeCopyProp.hpp) parameterized on target traits areused by both AArch64 and x86-64 backends.
x86-64 Backend Improvements
Comprehensive Backend Codegen Review — 20-item systematic review of both backends with
improvements across modularity, shared infrastructure, and test coverage:
x86-64 Peephole Decomposition
Split the 1,470-line monolithic
Peephole.cppinto 4 focused sub-passes underpeephole/:ArithSimplify(MOV-zero→XOR, CMP-zero→TEST, strength reduction),MovFolding(redundant MOVelimination),
DCE(dead code elimination with implicit register tracking),BranchOpt(branchoptimization and cold block reordering). Peephole iteration now bounded by
kMaxIterations=100.CFG-Aware Register Allocation Liveness
Replaced the conservative "unconditional spill" hack (which force-spilled ALL cross-block vregs)
with proper backward dataflow liveness analysis. The new
LivenessAnalysisclass computes per-blockliveIn/liveOutsets using the standard fixed-point iteration, so only vregs that are truly liveacross block boundaries get spill slots. This is the same algorithm used by production compilers.
Shared Dataflow Solver
Extracted the backward dataflow liveness algorithm into a shared template
(
common/ra/DataflowLiveness.hpp) used by both x86-64 and AArch64 backends. The AArch64 allocator'sinline liveness code was extracted into a separate
Livenessclass (matching x86-64's pattern),both now delegating to the shared solver. Also includes a shared
buildPredecessors()utility.Shared Linker Utilities
Common encoding utilities (
ExeWriterUtil.hpp) shared between Mach-O and PE executable writers:writeLE16/32/64,writeBE32/64,writeULEB128,writePad,padTo, andresolveMainAddress().ObjC dynamic stub generation extracted from the native linker into
DynStubGen.hpp/cpp.Additional Improvements
LoweringRuleTable.hppdeclarations moved to.cppfor faster incremental compile timeslowerDivisionChk)OpcodeDispatchrefactored with handler table replacing 1K-line switchAsmEmitterconsolidated withemit2Op/emit3OpprimitivesSchedulerPasshash maps replaced withvector<optional<>>for O(1) cache-friendly lookupCopyPropDCEMovRR/FMovRRlogic parameterized (90% duplication eliminated)FrameCodegen.hpp) eliminates callee-savedregister save/restore duplication between AsmEmitter and BinaryEncoder
kMaxIterations=100boundGame Engine Framework (10-Item Improvement Plan)
A comprehensive game development infrastructure built as pure Zia libraries and C runtime additions:
GameBase + IScene (Zia library) — Reusable game loop framework.
GameBaseentity handles canvascreation, frame pacing, DeltaTime clamping, and scene management.
ISceneinterface definesupdate/draw/onEnter/onExitlifecycle. Eliminates ~100 lines of boilerplate per game.Screen Transitions —
transitionTo()on GameBase orchestrates fade-out → scene switch → fade-inusing ScreenFX. Also adds
shake()andflash()for screen effects.Action Presets (C runtime) —
Action.LoadPreset("platformer")loads standard input bindings inone call. Four presets:
standard_movement,menu_navigation,platformer,topdown.Canvas Frame Helpers (C runtime) —
BeginFrame()combines Poll + ShouldClose check.SetDTMax()auto-clamps DeltaTime. Text layout:TextCentered,TextRight,TextCenteredScaled.SaveData (C runtime) — Cross-platform key-value persistence. JSON storage in platform-appropriate
directories (macOS Application Support, Linux XDG, Windows AppData).
DebugOverlay (C runtime) — Real-time FPS/dt/watch variable overlay with color-coded FPS,
16-frame rolling average, and up to 16 custom watch entries.
SoundBank + Synth (C runtime) — Named sound registry maps string names to Sound objects.
Procedural synth generates tones, sweeps, noise, and 6 preset game SFX (jump/coin/hit/explosion/
powerup/laser) without WAV files. Uses Bhaskara I sine approximation and in-memory WAV generation.
Platformer Showcase Demo — ~600 LOC across 6 files demonstrating 11+ runtime APIs in one
cohesive game: Tilemap, Camera, CollisionRect, StateMachine, SpriteAnimation, ObjectPool,
PathFollower, ButtonGroup, DebugOverlay, ScreenFX, and Action presets.
Demo Refactoring — Sidescroller demo refactored to use StateMachine (replacing manual integer
state tracking) and ButtonGroup (replacing manual selection management).
New Runtime APIs
AnimStateMachine — Combined state machine and animation playback controller. Maps each
state to an animation clip (frame range, duration, loop flag). Transitions automatically
reconfigure the internal animation. Surfaces
CurrentFrame,IsAnimFinished,Progress,JustEntered/JustExitededge flags, andFramesInState. Eliminates the boilerplate ofmanually wiring
StateMachineandSpriteAnimationtogether in every character controller.TextureAtlas — Named-region 2D sprite sheet atlas. Maps string names to rectangular sub-regions
of a Pixels buffer, enabling content pipelines where frames are referenced by name instead of raw
pixel coordinates. Supports grid-based auto-slicing (
LoadGrid) and manual region definition (Add).Integrates with SpriteBatch via
DrawAtlas,DrawAtlasScaled, andDrawAtlasExmethods.Canvas.DeltaTime — Milliseconds elapsed since the last frame, available as a property. Combined
with
Canvas.SetDTMax()for automatic delta-time clamping, this enables frame-rate-independentphysics without manual timer management.
ParticleEmitter Rendering —
ParticleEmitter.Draw(),DrawAt(), andDrawToPixels()methodsfor rendering particle systems directly, eliminating the need for manual particle array iteration in
game loops.
Camera Parallax Layers —
Camera.AddParallaxLayer(),RemoveLayer(),ClearLayers(), andDrawParallax()for multi-layer parallax scrolling backgrounds with configurable scroll speeds.Camera.SnapTo — Instant camera repositioning for level transitions and respawn events, bypassing
the normal smooth-follow interpolation.
3D Graphics Engine (Graphics3D)
A complete 3D graphics engine built as a zero-dependency C runtime module with pluggable GPU backends.
Core Architecture
Scene3D,SceneNode3D)Transform3D)Material3D)Camera3D)Light3D)Rendering
RenderTarget3D)PostFX3D)CubeMap3D)InstanceBatch3D)Decal3D), terrain rendering (Terrain3D), water simulation (Water3D)Animation & Physics
Skeleton3D,Animation3D,AnimBlend3D,AnimPlayer3D)MorphTarget3D)Character3D)Physics3DBody,Physics3DWorld,Trigger3D)Navigation & Loading
NavMesh3D)Path3D)FBX)RayHit3D)Particles3D)28 classes total. Documented in Graphics3D Guide and Graphics3D Architecture.
Comprehensive Safety Audits
The bulk of this release is a multi-phase safety audit touching every layer of the platform.
VM Execution Loop (8 fixes)
prepareTraphandlerfr.func->namenull checks in trap diagnosticsx86-64 Codegen (9 fixes)
(silent miscompilation for
selectwith falseVal=0)EdgeArgwithargValuesto carry full ILValue data for constantblock arguments; materialize constants into fresh vregs via MOVri/MOVSDmr before PX_COPY
— DCE was incorrectly eliminating dividend loads
uint32_tcounters with per-functionnextLocalLabelId(), reset to 0 per function for output determinismfor topological sort and cycle-breaking (fixes crash in multi-param entity init calls)
.note.GNU-stacksection to ELF output for non-executable stack.rdatasection and ELF.type @functionin AsmEmitter-pieflag for Linux linkerAArch64 Codegen (5 fixes)
Dominators.cpp intersect()for release buildsresolveBaseOffset()helper from four duplicated base+offsetload/store functions
the header for BASIC two-header for-loop patterns, causing compilation crashes (SIGBUS)
forwarding to prevent incorrect forwarding when the layout predecessor diverges
fast path, fixing uninitialized stack reads in
lowerCallWithArgsRuntime — Resource Lifecycle (10 fixes)
uint8→uint32(rt_gc.c)static_assertRuntime — Capacity Overflow Guards (16 files)
Integer overflow guards before capacity doubling in seq, deque, map, set, bag, bimap, countmap,
defaultmap, frozenmap, frozenset, intmap, multimap, sortedset, sparsearray, treemap, and weakmap.
Prevents undefined behavior when capacity approaches
INT64_MAX/2orSIZE_MAX/2.Runtime — String Operations (12 sites)
Replace
strlen()withrt_string_len_bytes()/rt_str_len()in 5 case-conversion functions,2 LIKE functions, box hash, bloomfilter, bimap/bag helpers, and playlist operations.
Runtime — File Operations (8 fixes)
ftell/fseekoverflow on Windows → 64-bit equivalents (linereader, PNG loader)fclose()return in HTTP download, remove partial file on failureSerializer::writeArWriter::finishToFileRuntime — Allocation Failure Handling
Replace silent data-dropping on allocation failure with
rt_trapinrt_list_push,rt_map_new,rt_map_set,rt_set_add. Replaceassert-only bounds checks inrt_arr_strandrt_arr_objget/put with
rt_trap+rt_arr_oob_panic.Runtime — Type System (5 fixes)
lowerAs()missing numeric conversion instructionsfptosi(CastFpToSiRteChk) with NaN/overflow guardsCastFpToSiRteChkfromFptosiin lowering pipelineNetwork & TLS Security (8 findings)
_addcarry_u64,_subborrow_u64,_umul128replacing__uint128_t)kMaxTomlDepth=128)peek()distance limit (kMaxPeekDistance=1000)atoi()withstrtol()+ range validation in WebSocket port parsingNetwork Audit & New Classes
Comprehensive file-by-file security and correctness review of all 11 C source files (14,427 lines)
in the network runtime, plus 10 new networking classes.
Security Fixes
New Network Classes (10)
HttpRouter— path pattern matching with parameter extractionHttpServer— multi-client event-loop HTTP serverConnectionPool— connection reuse with idle timeout and health checksMultipartParser— multipart/form-data streaming parserNetUtils— DNS resolution, interface enumeration, port checkingWebSocketServer— multi-client WebSocket server with broadcastSSEClient— Server-Sent Events client with auto-reconnectHttpClient— high-level HTTP client with cookie jar and redirectsSmtpClient— SMTP email sending with AUTH and TLSAsyncSocket— non-blocking socket with completion callbacksCrypto Additions
3D Graphics Hardening
Post-audit fixes across the 3D graphics subsystem:
Concurrency Hardening (TSan-verified)
block->nextpointer uses atomic load/store to prevent ARM64 memory orderingcorruption in lock-free freelist
rt_siphash_seeded_fast-path check causing stale seed reads on ARM64weak memory model
g_shutdown_registeredcausing potential doubleatexitregistrationPTHREAD_MUTEX_INITIALIZER/InitOnceExecuteOncefor all global init paths__dmb(_ARM64_BARRIER_ISH)in rt_platform.h + rt_pool.cZia Compiler Fixes
Static Property Resolution
get_prefix convention when resolving static properties through alias bindings. Previously,Color.REDerrored with "Module has no exported symbol 'RED'" because the getter wasregistered as
Viper.Graphics.Color.get_REDbut the lookup triedViper.Graphics.Color.RED. This fix applies to ALL static properties on ALL runtime classes,not just Color.
P0 Bugs
Optional<String>mapping corrected (Str → Ptr for nullable boxing)P1 Bugs
Zext1beforeICmpEqP2-P3 Bugs
call.indirectparser/serializer support
Entity & Inheritance Fixes
init()methods now correctly match parameter countand types against the call site. Previously, entities with inherited init from a parent
would fail with "no init overload matching the provided arguments"
override expose funcon entity methods now works for methoddispatch. Child entities can override parent methods with the
overridekeywordthe inheritance chain
Destructor & Property Fixes
deinit) blocks can now access entity fieldsthrough
selfbindings — previously, field accesses insidedeinithit lowering errorsbecause the binding context wasn't propagated to the destructor scope
__dtor_TypeNameIL function calls throughentity inheritance chains
declarations and validates return types against the backing field type
Async Improvements
ThreadsRuntimeimproved for async function handling,supporting
Future.Getcontinuation semantics forawaitexpressionsthrough the full pipeline (parser → sema → IL → VM execution)
Sema Fixes
Optional<String>maps to IL Str type (not Ptr) matching runtime externsImportResolverto prevent redundant module loadsSidescroller Demo — "Nova Run" (Full Game)
The sidescroller demo evolved from a single-level tech demo into a complete 5-level platformer
("Nova Run") across 8 phases of development:
Content
Sprite Art Overhaul
All entities redrawn using
DrawTriangle,DrawEllipse,DrawBezier,DrawThickLine,Blur,and
Tint— replacing the original rectangles-only rendering. Includes 4-frame player run cycle(was 2), 4-frame slime animation (was 2), and boss attack wind-up frame.
Physics & Systems
Action.BindPadButtonwith integer button constantsVisual Effects
Landing dust, wall-slide sparks, jetpack flame, ambient lava glow, crystal shimmer, speed trail,
and level intro splash screens.
Bug Fixes
TILE_BRIDGEmissing fromisSolid()— players fell through bridges into spike pitsPS_HURTstate stuck permanently — allow state transitions once iframes expireetimercorruption: hurt handler and AI timer cancelled each other out,leaving enemies stuck in permanent hurt state. Added hurt-state guards to turret and boss AI
positions (4-tile radius despawn)
Dungeon of Viper — 3D FPS Demo
A first-person dungeon crawler built on the Graphics3D engine, demonstrating 3D game development
in Zia:
Located at
examples/games/dungeon/. Built withviper buildand the native ARM64 codegen.Codebase Reorganization
Directory Consolidation
All demos and examples consolidated under a unified
examples/root:~80 trivial/redundant/dead demo files removed. 5 entire directories deleted (gfx_centipede,
gui_test, particles, classes, vedit). 7 broken/redundant scripts removed.
Documentation Consolidation
devdocs/directory: 28 files merged intodocs/treedocs/README.mdrebuilt as clean navigation hubdocs/bugs/bug_testing/Frontend Decomposition
Systematic 10-item improvement across BASIC, Zia, and shared frontend infrastructure:
Shared Infrastructure (fe_common/)
EscapeSequences.hpp(shared by both frontends)DiagnosticFormatter.hppZia File Splits
Parser_Expr.cpp(1,804 LOC → 3 files)Lowerer_Decl.cpp(1,690 LOC → 3 files)Lowerer_Expr_Complex.cpp(1,386 LOC → 3 files)computeEntityFieldLayout,buildEntityVtable,inheritEntityMembers) from monolithicregisterEntityLayoutBASIC Improvements
MemberArrayResolverLexerBaseCRTP (shared cursor management with Zia)Header Decomposition
LowererTypes.hpp(-195 LOC from header)sema/SemaTypes.hpp(-159 LOC)require*()methods tolowerer/LowererRuntimeRequirements.hppType Coercion Unification
Large File Splits
Readability refactoring of the largest source files:
BytecodeVM.cppBytecodeVM_threaded.cpprt_graphics.crt_canvas.c+rt_drawing.c+rt_drawing_advanced.c+rt_graphics_stubs.crt_network_http.crt_http_url.crt_tls.crt_tls_verify.c+rt_tls_internal.hvg_ide_widgets.hPeephole.cpp(AArch64)peephole/directoryPeephole.cpp(x86-64)peephole/directoryRegAllocLinear.cppra/directoryLowerer.hppLowererTypes.hpp+LowererSymbolTable.hpp+LowererTypeLayout.hppCross-Platform Improvements
RTNetworkHardenTests,RTNetworkTimeoutTests) ported to Windows viasock_t/SOCK_CLOSE/SOCK_INVALIDabstractions + WinSock2Zia Review Cleanup
Removed
zia-review/directory (review complete). All findings resolved and tracked in mainissue tracker.
Testing
New Test Coverage
Determinism Stress Test
8 scenarios with 407 total compilations verify byte-identical assembly output:
Runtime Consistency Audit
Systematic audit across all runtime C headers,
runtime.defregistrations, and viperlib documentationto enforce naming, behavioral, and type-safety consistency.
C Function Naming (Phase 1)
Renamed 40+ C functions to follow
rt_<type>_<verb>naming convention. Affected collections: List,Set, Map, Stack, Queue, Deque, Ring, Heap, Seq, Bag, Bytes. Key renames include
Contains→Has,Count→Length,Size→Length,IsEmptyproperty additions, andTryPop/TryPeeksafe-accessvariants for Stack, Queue, Deque, and Heap.
runtime.def Registration (Phase 2)
Aligned all IL-level method names and signatures with their C implementations. Added missing
RT_METHOD/RT_PROP/RT_ALIASentries for newly renamed functions and ensured everyRT_FUNChas corresponding class registrations.
Collection Behavioral Consistency (Phase 3)
Added missing operations to bring all collections to feature parity where semantically appropriate:
Clone()for Stack, Queue, Set, Map;First()/Last()/Reverse()for Ring;TryPopFront()/TryPopBack()for Deque;Items()alias for Heap'sToSeq().Enum Adoption (Phase 4)
Converted 12
#defineconstant groups totypedef enum { ... } rt_xxx_t;enums for compile-timetype safety. Affected: screen effect types, path-follow modes, easing types, string builder status,
input grow results, JSON token types, and XML node types.
Enum Naming Unification (Phase 5)
Normalized 7 existing enum types from mixed naming styles (Style A tagged enums, PascalCase names)
to a consistent Style B convention: anonymous
typedef enum { ... } rt_xxx_t;with_tsuffix.Boolean Return Type Consistency (Phase 6)
Fixed 15 runtime functions that returned
boolorintfor boolean results to consistently returnint8_t, matching the ILi1type. Affected:rt_string_is_handle,rt_output_is_batch_mode,rt_is_main_thread,rt_type_is_a,rt_type_implements,rt_box_equal, sprite overlap/containsfunctions, and GUI shortcut checks.
Documentation Alignment (Phase 7)
Updated viperlib collection documentation to reflect all API additions from Phases 1-3. Added
missing methods to sequential, maps-sets, and specialized collection docs. Updated
runtime.deftable of contents to cover all 80+ sections.
Codegen Bug Fixes
(missing
MH_TWOLEVEL), causing CoreAnimation PAC pointer authentication traps on macOS ARM64~1 second after window creation. Fixed with proper two-level namespace support and per-symbol
dylib ordinal assignment
TrapKindenum alignment acrossVM and codegen layers for consistent exception handling semantics
MOVNfor simple negative immediates (e.g., -1 through-65536) instead of a multi-instruction
MOVZ/MOVKsequence, reducing code sizeisCStringSectionflag prevents string deduplication from corruptingbinary data sections (rodata containing non-string data)
executables, preventing false undefined-symbol errors at link time
Runtime Bug Fixes
scale/colorparameters inrt_canvas_text_centered_scaledthat caused enormous near-black rectangles covering the screen during level intro overlays
batches. Covers bounds checking, null guards, integer overflow, format string safety,
memory leak prevention, and error handling across graphics, network, collections, and core
subsystems
character range checks, GUI widget input handling fixes, navmesh boundary validation,
FBX loader robustness improvements, scene graph cleanup
Graphics
vgfx_updateto present the frame before polling events,fixing visual glitches on rapid input during scene transitions
preventing transparent flicker artifacts on macOS
XMatchVisualInfo; add RGBA→BGRA swizzle inpresentation buffer for correct color rendering
-lX11for graphics demos#if defined(__APPLE__)in AArch64 backendGUI Improvements
IL Pass Infrastructure
Project Statistics
Breaking Changes
demos/consolidated intoexamples/. Update any hardcoded paths.docs/.rt_<type>_<verb>convention. Key changes:Contains→Has,Count→Length,Size→Length, plusIsEmptyproperty additions.runtime.defregistrations updated accordingly..Lenproperty renamed to.Lengthacross List, Map,and Set.
.Lenretained as alias for backward compatibility.bool/inttoint8_t(matchingIL
i1). Affects C FFI callers using these functions directly.Architecture
Feature Comparison
v0.2.x Roadmap
Remaining v0.2.x focus areas:
Viper Compiler Platform v0.2.3 (Pre-Alpha) — DRAFT
Target: March 2026
Note: This is an early development release. Future milestones will define supported releases when appropriate.
This discussion was created from the release v0.2.3-dev.
Beta Was this translation helpful? Give feedback.
All reactions