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.

Compiling to WebAssembly: It’s Happening

306 pointsby mnemonikover 9 years ago

25 comments

c0nfusedover 9 years ago
Web assembly always makes me a little sad. It feels like we are going back to flash only it won&#x27;t be bad this time, I promise, no really.<p>I always feel like the most obvious use for it is to start writing truly hateful and abusive code.<p>I&#x27;m sure this is because I&#x27;m getting old.
评论 #10754324 未加载
评论 #10754209 未加载
评论 #10754157 未加载
评论 #10754751 未加载
评论 #10754164 未加载
评论 #10754770 未加载
评论 #10757684 未加载
评论 #10754741 未加载
评论 #10754186 未加载
评论 #10757780 未加载
评论 #10754461 未加载
klodolphover 9 years ago
This seems like the modern trend, and I like it. I&#x27;m going to compare this to the recent developments with OpenGL and Vulkan. With OpenGL, you ship textual source code for your shaders written in GLSL, and you have to hope that the compiler on your client&#x27;s machine does the right thing! With Vulkan and SPIR-V, the compiler is taken out of the equation, and you can use whatever language you want to write shaders, validate them ahead of time, and ship the validated binary blobs to the client. Incidentally, I&#x27;m looking forward to WebGL 2. I really miss being able to use texture arrays, integers, and instancing.
andrewchambersover 9 years ago
Web browsers are turning into giant, poorly designed operating systems. My current operating system can already run binaries, this is reinventing the wheel in a massively over engineered way.
评论 #10756582 未加载
评论 #10756349 未加载
评论 #10756079 未加载
wilgover 9 years ago
In the recent press tour about Swift, Apple seems to be really gung-ho about people using Swift everywhere.<p>Since Swift is built on LLVM and there&#x27;s direct LLVM support for WebAssembly, I wonder if Apple will get behind WebAssembly so they can get Swift in the browser.
评论 #10755578 未加载
jacobolusover 9 years ago
Is there (or are there any plans to add) a WebAssembly -&gt; asm.js compiler, so that I can write some code by hand in WebAssembly and still get it to run fast in old browsers? Or are there features of WebAssembly that would be impossible to add in asm.js?<p>The reason I ask is that asm.js is really painful and cumbersome to write by hand and wasm seems substantially nicer, but I only have small bits of numerical hot loops which I want to use wasm&#x2F;asm.js for, and I have no desire to bring a bunch of code written in C into my little project.
评论 #10754187 未加载
评论 #10754536 未加载
kalskover 9 years ago
This sounds like an odd question, but I honestly need somebody to explain this to me...what is the motivation behind the modern trend to put <i>everything</i> on the web? Is there something you get by running your program from a browser that you don&#x27;t get from downloading and running an elf or a text file, or is this entire trend based around appealing to users who don&#x27;t actually know how to use their computers?
评论 #10755076 未加载
评论 #10755035 未加载
评论 #10755474 未加载
评论 #10755001 未加载
评论 #10755029 未加载
评论 #10755034 未加载
评论 #10755014 未加载
vvandersover 9 years ago
Exciting stuff. Just further solidifies in my mind that C&#x2F;C++ is one of the few languages that will run <i>everywhere</i>.
wilgover 9 years ago
Does code written in WebAssembly have access to the DOM somehow? How will that work?
评论 #10754380 未加载
评论 #10754397 未加载
eecksover 9 years ago
WebAssembly lets people write in C++, Ruby, Python, etc and for that code to work in the browser like Javascript does at the moment. Am I correct?
评论 #10754421 未加载
评论 #10754408 未加载
评论 #10754289 未加载
saosebastiaoover 9 years ago
Does anybody know if there are plans for an API for garbage collection? The WASM spec as it currently exists seems to be only useful for non-GC languages, and it would be a shame if we ended up shipping a new GC implementation for every page that we load. Perhaps something that would allow compilers to tap into the native JS GC?
评论 #10754232 未加载
评论 #10754339 未加载
评论 #10755167 未加载
jokoonover 9 years ago
So does it just do what NaCL was already doing, or at least is the objective the same?<p>I&#x27;m more worried about more specific things like hardware access (GPU, mouse inputs, networking, windowing)<p>It seems wasm runs at native speeds and take full advantage of optimization, but can it really be a solution fits all? There must be some things wasm can&#x27;t do. And so far, since JS did almost everything, I don&#x27;t see the point of wasm if it can&#x27;t do what other language can.
评论 #10754429 未加载
tevlon84over 9 years ago
Hi Alon,<p>thank you for sharing. I am a Computer Science Master student and i would like to contribute to the development. The git looks really full and i don`t know where to start.
评论 #10755334 未加载
n00b101over 9 years ago
So the current toolchain involves using emscripten to generate asm.js and then using binaryen to convert asm.js to WebAssembly. Unfortunately emscripten depends on a fork of LLVM (FastComp), with no plans for a proper LLVM asm.js backend.<p>Are there plans for a properly WebAssembly LLVM backend that does not depend on forking LLVM (like emscripten)?
评论 #10755105 未加载
评论 #10754860 未加载
geonover 9 years ago
Is there any progress on making the compilers utilize the js gc instead of including their own entire runtime?
评论 #10754874 未加载
tuyguntnover 9 years ago
Does this mean anyone can write Python to wasm converter then run it on browser, looks like LLVM backend?
评论 #10754336 未加载
评论 #10754105 未加载
shurcooLover 9 years ago
I&#x27;m very interested in compiling Go to WebAssembly. Based on what I read, it seems that so far you can primarily try it with C&#x2F;C++ code.<p>If one were to build a Go -&gt; WebAssembly compiler, what are good routes to take? I can see there&#x27;s going to be multiple possibilities.
评论 #10756087 未加载
exabrialover 9 years ago
Cool, but why not just use, you know, Java bytecode? Existing toolchains, compilers, runtimes, virtual machines could all be reused I&#x27;m sure. Actually there are a hundred different great virtual machines that could be used... Why, yet, another?
评论 #10756141 未加载
hDerajover 9 years ago
I see WebAssembly this way:<p>WebAssembly is to JavaScript what WebGL is to Canvas
iandanforthover 9 years ago
My experience is that the barrier to entry for JavaScript is not that it&#x27;s a new language, but that you have to learn async thinking and are restricted to a single thread.<p>Does WebAssembly address either of those points?
评论 #10755159 未加载
currentoorover 9 years ago
I&#x27;m hoping for a day where I get two threads in my JS runtime. Now that would be nice...
ajarmstover 9 years ago
I&#x27;m sorry, but I&#x27;m not following. What&#x27;s the problem this is supposed to solve?
al2o3crover 9 years ago
WebAssembly sounds interesting, you could use it to write little apps that embed into a page.<p>And call them &quot;applets&quot;. Nobody&#x27;s ever done that before, right? :trollface:
mei0Ieshover 9 years ago
Finally! Maybe now someone can build a web app that enhances the reading and discover of documents. Each browser could be a repository of text files, each with an address, so you can have words in the text pointing to another document&#x27;s address.
yoavmover 9 years ago
I suspect too many web applications are going use WebAssembly to obscure their code and the way they work, thus making it impossible to learn by studying their code. As someone who learned programming mostly by looking at other people&#x27;s code, I&#x27;m afraid the web will change in a way that would make it a lot harder to do so.
评论 #10754623 未加载
评论 #10754584 未加载
评论 #10754630 未加载
评论 #10755230 未加载
评论 #10755074 未加载
etieneover 9 years ago
YES YES YES!!! OMG! THANK YOU &lt;3 &lt;3 &lt;3 I&#x27;ve been waiting so long for this! Maybe my dream of running native Lua on the browser will come true? Will I already be able to run Lua&#x27;s interpreter now? :D :D Gonna look deeper into this as soon as I have time, omg so excited &lt;3
评论 #10755643 未加载