Repository navigation
feat!: target GocciaScript 0.14.0 and bind the complete raylib API - #11
Conversation
GocciaScript 0.11 to 0.14 lifted the FFI limits the 0.10.0 bindings worked
around, and 0.14 replaced the script loader and the unsafe-ffi switch with
GocciaRunner and a deny-by-default permission model.
- Generate all 600 raylib functions: mixed float arguments, more than eight
arguments and variadic calls now bind natively.
- Replace the seven Raw raw-pointer variants with FFI.nullable("utf8string")
and keep AudioStream.buffer under its native name.
- Move both goccia.json files to a permissions block and run every lane
through GocciaRunner 0.14.0.
- Make the package importable by name through an exports map.
- Drop the example workarounds: Bunnymark uses GenMeshPlane and direct
imports, DOOM scales with DrawTextureEx. Frames are byte-identical.
BREAKING CHANGE: requires GocciaScript 0.14.0. The Raw exports and
RAYLIB_FIELD_ALIASES are removed, and AudioStream.nativeBuffer is now
AudioStream.buffer.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (31)
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthroughChangesGocciaScript 0.14.0 upgrade
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~60 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant CI
participant GocciaRunner
participant RaylibBindings
participant FFI
participant Validation
CI->>GocciaRunner: launch tests with permission flags
GocciaRunner->>RaylibBindings: load generated bindings
RaylibBindings->>FFI: bind Raylib functions
FFI-->>Validation: execute native calls and metadata checks
Validation-->>CI: report test status
Merge Risk: ⚪ Minimal · up to The upgrade appears mergeable after normal checks. No actionable incompatibility remains established in the bindings, permission configuration, package exports, or migrated examples. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 17 files. (14 skipped: 14 unsupported.)
Comment |
The bindings were pinned to GocciaScript 0.10.0, whose FFI could not bind 112 of raylib's 600 functions and forced several workarounds. GocciaScript 0.11–0.14 removed those limits, and 0.14 replaced
GocciaScriptLoaderand"unsafe-ffi"withGocciaRunnerand a deny-by-default permission model, so the 0.10.0 setup no longer runs at all on the current release.This moves the repository to GocciaScript 0.14.0 and replaces each workaround with the native capability.
What changes for users
floatarguments, more than eight arguments, and variadic calls bind natively;SKIPPED.mdis empty.TraceLogandTextFormattake one typed tail:TextFormat("%s %03d", FFI.varargs(["utf8string", "i32"], ["raylib", 7])).LoadShader,LoadShaderFromMemory,LoadAutomationEventListand the four text-replacement functions acceptstring | null. The seven*Rawduplicates are removed.AudioStream.bufferis raylib's field again;nativeBufferandRAYLIB_FIELD_ALIASESare removed.FFI.metadata(value)returns the backing store.goccia.jsonfiles requestffiin apermissionsblock. RunGocciaRunner --trust goccia.jsononce, or pass-Pper run. Without the grant the bindings throw aTypeErrorthat names it.package.jsongains anexportsmap, so an installed copy isimport … from "@frostney/gocciascript-raylib"withallow-import: ["node_modules=."]. Other packaged files stay reachable by subpath.Breaking
Requires GocciaScript 0.14.0. The
*Rawexports,RAYLIB_FIELD_ALIASESandAudioStream.nativeBufferare gone.GOCCIA_LOADERis nowGOCCIA_RUNNER. The package is unpublished and untagged, so the version stays0.1.0.Example workarounds removed
GenMeshHeightmapon a throwaway 2x2 image, both buffers replacedGenMeshPlane, positions replacedCamera2DDrawTextureExRendering is unchanged: the Bunnymark instanced and
DrawTextureVframes are still byte-identical (e22537b0…, the Linux hash already recorded inbenchmarks/bunnymark-instancing.md), and DOOM frame 8 is byte-identical before and after on both display paths (2fdda7ef…).The aliases existed because an imported-binding read cost about 9 µs on 0.10.0; on 0.14.0 it costs about 0.1 µs more than a local read.
benchmarks/import-binding-aliases.mdrecords the measurements.Bunnymark, 10,000 sprites, uncapped, mean of three interleaved 25-frame runs on one machine (Ryzen 9 6900HX, Radeon RX 6600M, Linux). Each side runs its own revision of the example, so this is engine and example together:
mainon 0.10.0DrawMeshInstancedDrawTextureVDeliberately kept
Goccia.gc()every 10 frames in DOOM: automatic collection is off during bytecode execution, and the heap otherwise grows about 1.7 MB per frame until the memory ceiling..mjsadapters:GocciaRunnerhas no host process or hashing API.for...ofin the examples.For the reviewer
test:goccia:interpreterwas silently running bytecode, because the root config sets"mode": "bytecode". Both scripts now pass--mode.goccia.json, which makes it its own project root, so it also requests read access tobindings/raylib.ts.tests/types/consumer.ts), an assertion on the package entry point, andmake test-palettein CI and the Dockerfile.