Interesting, I'm assuming Browsix must have been rewritten in Typescript significantly later; TS must have been much more niche in 2016 (though wikipedia tells me it may be as old as 2012)
(one of the authors here) it was written in Typescript from the start! Typescript eliminated a bunch of type confusion errors when developing the kernel, although the need to marshal data across a MessagePort means we have to do some casting and lose some safety.
Since it is written in Typescript, can parts of Browsix get compiled to Wasm instead of JS via AssemblyScript? Then at some point Browsix could run inside of any compatible wasm env and not just a browser tab?
I wouldn't say it's less compile-time type safety assuming you assert the type of the data as soon as you obtain it. Typescript doesn't give you runtime safety anyway, so I can't really imagine any better way short of adding types to the actual runtime and making the browser assert them across MessageEvent.
Thanks for the response! I don't know what the MessagePort is, but have dealt with the pains of marshaling/unmarshaling in a browser caching library I wrote that stores app data in localStorage (which is string-only)