Earlier quoted context omitted.
> because the DOM and JS (meaning the GC) are very coupled. This wasn't the intention when the script tag was introduced. It's interesting that the web standardized on one programming language.
It's interesting that the web standardized on one programming language. In hindsight I feel like this isn't surprising. How many platforms (that aren't themselves operating systems) support scripting in more than one language? Vim/Neovim is the only one I can think of off the top of my head.
WebAssembly becomes a W3C Recommendation
191–200 of 248 posts
Re: WebAssembly becomes a W3C Recommendation
#192Earlier quoted context omitted.
Honest question, in what sense is python a so much better choice for web development? syntax? subjective, and it would also mean all C-likes belong in the dustbin. performance? Why would python, as a language, be significantly more performant? It's just as dynamic. ecosystem? JS community is huge, JS package managers are huge (even though not flawless, but nothing their python counterparts do better) I mean I can sur…
Was going to ask in the main thread but perhaps here is a better place. For someone just starting with programming, but targetting WASM, which would be a good first programming language? Java? In my particular case, I've been learning Python for Data Analysis for about one year, and a few months of Haskell (love Haskell so far, but my interest/job is related to data analysis and web dev). I've heard bad things about…
The one I've been looking to the most is Rust, as it compiles to a smaller size, doesn't have a GC to ship (by default), and is not C/C++. C/C++ seem to be the other common WASM languages.
Edit: Just saw you're a beginner programmer, I probably would not suggest Rust as a first language. Web Assembly in general may not be a good starting point, but if you're set C++ might be slightly better. (I tend to suggest Python as a starting language)
Re: WebAssembly becomes a W3C Recommendation
#193Earlier quoted context omitted.
Was going to ask in the main thread but perhaps here is a better place. For someone just starting with programming, but targetting WASM, which would be a good first programming language? Java? In my particular case, I've been learning Python for Data Analysis for about one year, and a few months of Haskell (love Haskell so far, but my interest/job is related to data analysis and web dev). I've heard bad things about…
Since Java relies on the JVM I think I'd avoid it, and any other languages that'd require running another VM on top of the WASM VM. Seems like useless stacking of technology that serves basically the same purpose. Not saying it wouldn't work and that it won't be done, but just seems kinda gross and missing-the-point. Personally I'd also avoid anything with a fatter runtime than maybe Go or C#. If it doesn't already,…
Re: WebAssembly becomes a W3C Recommendation
#194i wonder what are the security implications. how many new vulnerabilities will be uncovered, machines infected, and viruses implemented in wasm. the concept of wasm doesn't really fly with zero-trust internet
Can you elaborate? I would think the sandbox nature of wasm would be a better fit than other models, and presumably no worse than JavaScript?
Re: WebAssembly becomes a W3C Recommendation
#195Ten years ago browsers were capable to do pretty much the same but with Java on board that they all had at those times.
WebAssembly is conceptually close to JavaVM (JITed bytecodes) but due to its architecture Java allowed as a) reflection (JS to Java calls) as b) exposure of DOM model into Java execution space - DOM API even now is defined in terms of Java interfaces by the way.
WebAssembly is a step in right direction but the evolution looks as Waltz - two steps forward two steps back with the twist.
Now we are able to run ray tracers compiled to WA on browser side but we've lost an option to apply the results to DOM elements directly.
To say in CSS:
my-component {
behavior: my-native-event-handler url(controllers/my-controller.class);
flow: my-native-layout-manager;
}Re: WebAssembly becomes a W3C Recommendation
#196Earlier quoted context omitted.
I think that's underselling the talk. Apart from the very enjoyable presentation, it makes valuable insights. The talk isn't trying to sell itself as 100% original. It makes reference to asm.js and a game demo that already existed at the time of the talk as well as repl.it. Despite that, I do think it makes a unique insight that even though JavaScript is ubiquitous, it will NOT be the language that future languages c…
> Moreover this bytecode has the potential to entirely supplant native code and can do so with equal or better performance. I interpreted that part of the talk as hyperbole and sarcasm. It was saying that programmers will be so far removed from how computers work that they'll happily program against a model that has five layers of abstraction that simply serve to provide the original interface of the bottom layer. By…
About speed, JIT optimized bytecode can be faster than what is possible to static binaries. The JIT has more information than the compiler to optimize your code. Currently I don't know of any that is that fast, but there is no inherent limitation here.
Re: WebAssembly becomes a W3C Recommendation
#197Does anyone have any good success stories with WebAssembly in the actual context of using it on the web? That list of testimonials doesn't seem very inspiring as to whether or not the standard has seen actual production usage to justify being a recommended standard...
Re: WebAssembly becomes a W3C Recommendation
#198Earlier quoted context omitted.
I use it in a web worker to compile, assemble, and link C programs into 8-bit ROMs: https://8bitworkshop.com/ I was using asm.js in the past, but WASM gives a noticeable and necessary performance boost.
This looks awesome, great project! Which specific CPUs or applications that you emulate really take advantage of the performance boost that WASM provides?
Right now the emulators are all in JavaScript (except for MAME) which makes integrating with the IDE's debugging tools a little easier. It's performant enough for now, since we only have 8-bit platforms at low clock speeds.
Integrating a C emulation library like https://github.com/floooh/chips should be doable, since it doesn't have any dependencies.
Re: WebAssembly becomes a W3C Recommendation
#199Earlier quoted context omitted.
Don't you mean JavaScript? This will have 0 effect on Java at this point since it isn't used in the browser anymore.
For me Java is legacy. A good runtime for the web will have a lot of developers worldwide. I am betting on it not just for the web, but to replace legacy apps as soon as we get a good runtime not just for the web. Probably Electron can be one of such new runtimes
Can you explain a bit more in what way you see it as legacy?
Because the JVM has some of the best GCs, and JIT + AOT compilation of any VM around. And its portability story is quite impressive.
You can argue Java as a language has some legacy hanging around, though they've made great progress there with the latest versions. But the JVM has support for other languages as well, such as Ruby, Python, Scala, Kotlin, Clojure, Common Lisp, JavaScript, Fantom, etc.
Now WASM isn't a runtime. WASM is more akin to Java Bytecode or LLVM bitcode.
Each browser vendor will implement their own WASM VM. Currently, there is no standard for Garbage Collection, which means GCed languages won't be good candidates for WASM. If you want to use Python, Java, C#, Kotlin, TypeScript, Haskell, etc. your resulting program will need to bundle a full runtime for your language compiled to WASM as well. In all cases, this will end up having slower performance, and on the web will cause bigger download sizes.
Hopefully, this gets addressed in the future.
The flip side is portability. For example, Go compiled to WASM could run on all WASM non-web compliant VMs. But it'll run slower than GO compiled for the target machine directly.
That's why a good use case for WASM right now is to allow JavaScript to make use of C/C++ libraries in the browser. As well as Node.js to do the same in non-browser contexts.
This will often mean an HTML/CSS/JS UX with certain section of it in C/C++/Rust.
It does mean that Electron apps will be able to make use of portable C/C++ libraries more easily, as they get compiled to WASM and the V8 runtime will be able to run that WASM and eventually offer interop with the DOM and JS. Though that's not yet supported, as the boundary between GCed JS/DOM and WASM hasn't been fully figured out yet.
Also, WASI is the standard library for WASM, and that'll need to grow as well. Progress is being made there too, but its goal is to remain minimal, and delend more on libraries.
Conclusion, let's say you have WASM, Java Bytecode and LLVM bitcode, and maybe even .net IR. All of them are a form of virtual assembly which need a VM to run them. Any language could build a compiler to any of these. But they have different trade offs.
Java Bytecode is pretty simple, and the VM has a standard memory model and GC with a large accompanying library, and a state of the art JIT. Making it a great target for higher level languages.
.net IR is pretty similar, though the bytecode can be a bit more difficult in its handling of reified generics. That can make it a bit harder to target for higher level languages. Its JIT isn't as sophisticated, same as its GC, but it comes real close, and has good tooling around it and an excellent standard library.
LLVM will remain king for high performance, as it is designed to handle all kind of optimizations, and support multiple's language feature set efficiently. That said, it isn't as portable and isn't optimized for small binaries and fast parse times. It too, is best for low level languages as it doesn't enforce a memory model.
WASM also doesn't enforce a memory model, making it a great target for low level languages. It is optimized for safety and portability. Which means it'll most likely always be slower than LLVM. But it also tries to be as fast as it can, and theoritically could beat out Java Bytecode or .net IR given it can avoid GC overhead. It also is optimized to be streamed over the wire, that means small binaries that can be quickly parsed. So ideal for code that you can't predict where it is going to run, like the web.
The VM landscape overall is looking pretty healthy. But I think there's misconceptions out there, especially around the JVM and .net Core, and also about people's hype for WASM. Specifically, the JVM and .net Core are almost impossible to beat for what they do. So don't expect better from WASM. Similarly, JS is almost impossible to beat for what it does, and WASM doesn't plan to replace it, but enhance it.
Re: WebAssembly becomes a W3C Recommendation
#200Does anyone have any good success stories with WebAssembly in the actual context of using it on the web? That list of testimonials doesn't seem very inspiring as to whether or not the standard has seen actual production usage to justify being a recommended standard...