4 ms·
The simple C-style linear memory model is the most important one IMHO, since this preserves the explicit control over the entire memory layout of an application
by flohofwoe 7y ago
The simple C-style linear memory model is the most important one IMHO, since this preserves the explicit control over the entire memory layout of an application which languages like C, C++ or Rust allow. Optimizations for efficient use of CPU caches carry over into WASM. AFAIK both CLR and JVM use a much higher level model which is built around fine-grained allocations managed by a GC.
- pjmlp 7y agoCLR supports C++ since version 1.0. In fact it had two versions of it, Managed C++ released in version 1.0, replaced by C++/CLI with version 2.0. JVM has support for C-style linear memory model on its unsafe interfaces (the non-public ones), and is being improved via Graal (which understands LLVM bitcode) and Projects Panama/Valhalla.
- flohofwoe 7y agoAh alright, thanks for the clarification. Pre-WASM emscripten actually shows that it's possible to compile C to any language or virtual machine that has simple linear arrays to use as C's heap, it's just not as efficient.