so an update on my AI psychosis, in the last 5 days, I've picked up work on
@artichokeruby. I have completely removed its mruby backend. At this point I have:
* Full lowering from source to AST via Prism
* Lowering from AST to a Ruby specific IR
* IR optimization passes (dead store elimination, constant folding, guarded specialization for privileged class method dispatch, data structure capacity hints, ivar fast paths, DCE, DBE, basic block and frame elimination)
* Several effect analyses in IR passes (tracking privileged class type hinting, identifying noexcept basic blocks, etc)
* Code generation with a register based VM
* LTO, whole program optimization
* Large swaths of the Core classes fully implemented
* Heap, GC (Immix), ivar storage, method lookup and caching machinery
* CLI, including IR and bytecode dumpers to guide optimization work
* A full Rust reimplementation of the Onigmo regex engine and 36 of its encodings
* A "ruby semantic layer" that handles callbacks, rooting, invalidation, coercion policy, and recursion independent of any concrete interpreter; because it is generic, there are test harnesses that run it with a randomizing heap and GC after every yield point
* A whole swath of data structures representing Ruby Core classes
* A parallel impl of rust std and alloc that has zero infallibly allocating pathways
* Native implementations of `File`, `IO`, `Dir`, and `Socket` using rustix and windows-sys
* support for custom eh personalities and unwinding using C++ exception handling
* "ABI skins" to project Artichoke into arbitrary ABIs, partial implementation of MRI ABI which can link the sqlite C extension
The whole "Ruby" is generic over core interpreter intrinsics which means everything is replaceable (heap, object model, GC, value repr).
The interpreter was also built to be embedded so it is actually a machine that must be polled with an instruction budget to run. The GC also has a configurable work budget.
I expect within a day or so I'll be able to run optcarrot correctly and then will set the token machine to optimize. It is currently pretty slow, but that is, as they say, a reward signal.
I've identified nearly 400 MRI errata in this process.