3 ms·
I doubt that WASM is good as an embedded language, unless performance requirements outweigh the inconvenience. Dynamic languages are great for experimentation
by rapidlua 6y ago
I doubt that WASM is good as an embedded language, unless performance requirements outweigh the inconvenience.
Dynamic languages are great for experimentation and exploring the system, e.g. a console in the browser is the fantastic tool and web dev people tend to try things there first. By embedding wasm, you are making tinkering with the system you provide less enjoyable for your users.
One could argue that since many languages compile to wasm, you can pick whichever suites you best. But in reality, you are probably limited to languages with thin runtimes, e.g. Rust or C. Otherwise you will end up with a huge wasm blob. Imagine, there are 2 Java extensions, a C# one and something in Python, all running simultaneously. It means 3 different runtimes with a footprint by far exceeding that of the application logic in an extension.
Another burden is the bridging between the host and an extension. Unlike lua or js you can’t pass and inspect objects, the only option is to marshal data as a byte blob. So if you were to pick up a language no one used to write extensions for the particular application before, the very first think you have to do is writing marshalers.
Last but not least, I disagree with the article calling S-expressions ugly and strongly believe in the opposite.
- flohofwoe 6y agoIMHO WASM is the perfect replacement for native plugin DLLs for DCC tools like Maya or Photoshop (but not a replacement for a scripting interface which such applications usually offer too in addition to DLL plugins). Instead of having to distribute a multitude of DLLs for each OS/CPU combination, you only distribute a single WASM module, and the WASM runtime that's integrated into the DCC tool takes care of the platform-specific details. And WASM is also easier to sandbox than DLLs, so a crash in the WASM plugin can't take down the entire application.
- eggsnbacon1 6y agoIMO in this regard WASM is pretty much the same as Java/C# except slower and less mature. In Java, distributing libraries as cross-platform "jars" is very common.