5 ms·
Is there any compiler/interpreter that is compiled to web assembly?
tl;dr: A caech-able method for including other programming language sourcecode which is then interpreted or compiled clientside.
--------------
One thing that would be interesting about the concept of web assembly, is if this allows for running websites where the source code is in a textual format that is interpreted or compiled from any arbitrary language.
Take for instance the humble
<script type="text/javascript"></script>
The issue with including other standards would be the need to bake support for the language into it.
## External Link to Interpreter/Compiler in script tag
What if the script tag also supports a reference to a web assembly binary that is tasked with reading the source code and compiling it to web assembly?
<script interpreter="dartlang.org/compiler.wasm" type="text/dart"></script>
<script compiler="tcc.org/tcc.wasm" type="text/C"></script>
The compiler reference runs a bit like a 'preprocessor' converting C code into wasm. While the interpreter mode, would run the interpreter on top of the web assembly virtual machine. Having it be a separate referenced link, would provide opportunity for informing the browser to cache the compiler/interpreter for future usage (Which is a good thing if its a popular language).
## Package Repository approach to Interpreter/Compiler
The other approach besides linking to an external compiler/interpreter. Is to maybe have a "package manager" approach this code. Which means all the major browser would link to a common package repository of such interpreter/compiler, along with various versioning. This would also allow for implicit imports based on the `type` field of the script.
<script type="text/javascript"></script>
<script language="python_V3.x" type="text/python"></script>