A live coding session building a deterministic bindings generator for Moscow ML (Standard ML) targeting the raylib C library. The author modifies raylib's existing C parser tool to output SML bindings instead of JSON/XML, implementing C-to-SML type mappings, handling FFI constraints like the 5-argument limit, generating both the SML signature file and the corresponding C wrapper file. Key challenges include translating C types to SML equivalents, handling pointers, dealing with ML's 31-bit integer quirk, and using GNU nested functions as a local helper. The session contrasts this deterministic approach against using LLMs for boilerplate generation.

2h 44m watch time

Sort: