JSConf JP

Oseo: An SBCL-Style Ahead-of-Time Compiler for JavaScript and TypeScript

SessionTrack CJapanese

Dynamic languages such as Common Lisp and Scheme can be compiled ahead of time into native code—SBCL and Chez Scheme have been used in production for decades. JavaScript, meanwhile, is still commonly viewed as requiring an interpreter, multiple JIT tiers, and deoptimization. Oseo began with the question of why these worlds differ.

Oseo compiles every function twice: a generic path implements the language’s full semantics, while specialized paths add inexpensive runtime guards for values or shapes whose types are known. If a guard fails, execution jumps to the already-compiled generic path; it neither falls back to an interpreter nor deoptimizes. TypeScript annotations and JSDoc provide hints for specialization but are never trusted blindly. Oseo guards possibilities introduced by any, assertions, or interoperability with plain JavaScript. The talk demonstrates native execution, generated MIR and C, and the remaining work needed for native I/O, garbage collection, and self-hosting.