I'm reminded of PG's quote that "there have been two really clean, consistent models of programming so far: the C model and the Lisp model." While the Lisp model may be better for a programming language, the C model is arguably better as a universal substrate. WebAssembly is a C machine model for the web, complete with sbrk(). It's worth perusing the design docs, it looks very sensibly designed:
https://github.com/WebAssembly/design.