bi-05 step 01 — A toy binding layer
Goal
Build the boundary, not the engine. The point is to feel the four costs of crossing, and to make wrapper identity a thing you implemented rather than read about.
Tasks
- A tiny IDL-like schema: interface name, attributes with types, methods with argument types, plus
[ForcesLayout]and[CrossOrigin]markers. - A generator emitting JS accessors from the schema.
- A "C++ side" (plain objects standing in) with a wrapper map enforcing identity.
- Type coercion per your schema, including throwing on invalid input.
[ForcesLayout]getters callflush()— reuse the dirty-marking scheme frombi-04.- Two worlds: two wrapper maps over the same backing objects.
Done when
-
obj.x === obj.xholds, and expandos survive a round trip - An expando set in world A is invisible in world B
-
A
[ForcesLayout]read in a write loop shows the complexity change