Earlier quoted context omitted.
Yes, that's correct.
What about opengl and hardware inputs for instance? What kind of standard libraries will be available ?
Compiling to WebAssembly: It’s Happening
21–30 of 225 posts
Re: Compiling to WebAssembly: It’s Happening
#22Re: Compiling to WebAssembly: It’s Happening
#23Earlier quoted context omitted.
The important use case is to allow people to write web applications with their language of choice, instead of horrible javascript. And get near full performance.
I think this is important. Probably because I have the "worse is better" article from 1991 open in another tab, and if you s/Lisp/Javascript/g then many of the criticisms ring true. Some of what made Unix, Windows, and Mac OS healthy environments for development was the fact that all developers were equally well off, you didn't have to pay a tax for writing something in a language other than Lisp. You could keep your…
There's a reason that C became the dominant language during the 80s and early 90s: it's because Win32, UNIX, and MacOS >=7 were all written in it. That's a large part of what Worse is Better was about. Richard Gabriel founded a company to write software for Lisp Machines, pivoted it to run Lisp on commodity hardware, found that all of his customers would rather just write in C, pivoted it again to do a C++ dev environment, and eventually went out of business.
The renaissance for other languages was really during the web era, when everything just spit out HTML and it didn't matter what the server was written in. Once customers started demanding rich interactivity on the client, there was a strong incentive to write everything in Javascript, and then a strong incentive to write the servers in Javascript too, and then a strong incentive to use Javascript for other things like native apps and IoT devices too.
Re: Compiling to WebAssembly: It’s Happening
#24Does code written in WebAssembly have access to the DOM somehow? How will that work?
Basically you will need to drop back down into javascript and handle that there (basically how asm.js does it now).
But there is a proposal to eventually integrate direct DOM access into Web Assembly, but that's for after they get it up and running.
Re: Compiling to WebAssembly: It’s Happening
#25Does code written in WebAssembly have access to the DOM somehow? How will that work?
Re: Compiling to WebAssembly: It’s Happening
#26WebAssembly 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?
In its first version, it will not be able to access any/most web APIs directly (so you won't be writing a web app in 100% C++ any time soon).
The goal is to allow "Computationally intensive" bits of code to be compiled, while leaving JS to act as the glue for it all.
Re: Compiling to WebAssembly: It’s Happening
#27I'm more worried about more specific things like hardware access (GPU, mouse inputs, networking, windowing)
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't do. And so far, since JS did almost everything, I don't see the point of wasm if it can't do what other language can.
Re: Compiling to WebAssembly: It’s Happening
#28Re: Compiling to WebAssembly: It’s Happening
#29WebAssembly 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?
You can also run Ruby and Python in the browser by just compiling their C or C++ VMs. But that won't still work "like JavaScript" - their objects won't be native VM objects in the browser, it won't use the browser's GC, they won't be observable in the browser's debugger, etc.
So far all of that was already possible, and done, with asm.js.
In the future, it is a goal to work to do GC object integration, so that something like Ruby or Python could actually compile down to something with native VM objects, and that would also allow calling DOM APIs directly. (This will likely still require a compiled VM, though.)
Re: Compiling to WebAssembly: It’s Happening
#30So does it just do what NaCL was already doing, or at least is the objective the same? I'm more worried about more specific things like hardware access (GPU, mouse inputs, networking, windowing) 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't do. And so far, since JS did almost everything, I don't see the point…
The main point of wasm, from my perspective, is startup speed. wasm will allow much smaller downloads of large codebases, and much faster parsing (due to the binary format). For small programs this might not matter, but for big ones, it's a huge deal.