TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Is there any compiler/interpreter that is compiled to web assembly?

1 pointsby mofosynealmost 9 years ago
tl;dr: A caech-able method for including other programming language sourcecode which is then interpreted or compiled clientside.<p>--------------<p>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.<p>Take for instance the humble<p><pre><code> &lt;script type=&quot;text&#x2F;javascript&quot;&gt;&lt;&#x2F;script&gt; </code></pre> The issue with including other standards would be the need to bake support for the language into it.<p>## External Link to Interpreter&#x2F;Compiler in script tag<p>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?<p><pre><code> &lt;script interpreter=&quot;dartlang.org&#x2F;compiler.wasm&quot; type=&quot;text&#x2F;dart&quot;&gt;&lt;&#x2F;script&gt; &lt;script compiler=&quot;tcc.org&#x2F;tcc.wasm&quot; type=&quot;text&#x2F;C&quot;&gt;&lt;&#x2F;script&gt; </code></pre> The compiler reference runs a bit like a &#x27;preprocessor&#x27; 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&#x2F;interpreter for future usage (Which is a good thing if its a popular language).<p>## Package Repository approach to Interpreter&#x2F;Compiler<p>The other approach besides linking to an external compiler&#x2F;interpreter. Is to maybe have a &quot;package manager&quot; approach this code. Which means all the major browser would link to a common package repository of such interpreter&#x2F;compiler, along with various versioning. This would also allow for implicit imports based on the `type` field of the script.<p><pre><code> &lt;script type=&quot;text&#x2F;javascript&quot;&gt;&lt;&#x2F;script&gt; &lt;script language=&quot;python_V3.x&quot; type=&quot;text&#x2F;python&quot;&gt;&lt;&#x2F;script&gt;</code></pre>

no comments

no comments