I love this talk, but I am having a lot of trouble with the byte code on the right at 20:57. How is the byte code at 20:57 interpreted? I can find 0x43 as the f3.const opcode. But 42 in ieee754 (according to converters and not by hand) should be 0x42280000. Why is the code here 0xcdccb841? Also how does the call function work? In the x86 asm I have seen, you would load params into registers, and then call a function reference. But it seems like you are calling a reference at 0 which would be odd. Is that where the console.log function is imported? Does the const operation actually load the value into a register so the called function can use it?
WebAssembly was designed as a _compilation target_ from any language, including Java. That means WASM doesn't have to know anything about Java, but rather vice versa: Java (or whatever language you're writing in) just has to know about the WASM format, and output code in that format. Any modern browser will know how to run the WASM code your compiler outputs.
In my opinion, no. The WASM developers have focused almost entirely on C/C++. Although it is theoretically possible to compile anything to anything else, the results will inevitably be sort of lackluster for Java if you don't add proper support for garbage collection, multi-threading, and fast dynamic dispatch into the compilation target itself.
@@my2iu That's just... not true. Java bytecode is always translated to native machine code eventually. Translating java bytecode into Wasm is not any more difficult than that.
@@dasten123 JavaScript is a security nightmare because it's so dynamic and had no module system at it's conception. There's a laundry list of other security problems too.
"Creating a (simple) compiler isn't that hard" That's because what you've built is basically a glorified tree walking interpreter. Not to discourage, but I don't think this can be classified as even a simple compiler.
This is what a compiler is; a program that converts its instructions to machine-code (such as WASM or Assembly). Here it converts the instructions from his own language into WASM instructions. Like a compiler. It is then executed by the browser, by passing the code to the browser's WebAssembly executor through an API.
Brilliant talk, went into depth fast, unlike most talks that rehash the same adder type webassembly program for most of the talk.
I started learning web assembly this year may someone explain to me what's going on
@@subschallenge-nh4xp - en.wikipedia.org/wiki/WebAssembly could you be more explicit in your question. What part do you find unclear?
Fantastic talk! Good pace and good depth.
Just finished, I love that.
Very cool.
I love this talk, but I am having a lot of trouble with the byte code on the right at 20:57.
How is the byte code at 20:57 interpreted?
I can find 0x43 as the f3.const opcode. But 42 in ieee754 (according to converters and not by hand) should be 0x42280000. Why is the code here 0xcdccb841?
Also how does the call function work? In the x86 asm I have seen, you would load params into registers, and then call a function reference. But it seems like you are calling a reference at 0 which would be odd. Is that where the console.log function is imported?
Does the const operation actually load the value into a register so the called function can use it?
Stack vm?
Really, really awesome talk! I love it!!
awesome talk! what did you use to make the web editor for your language?
inspect element tells me it's "CodeMirror"
There's something poetic about the fact that you can now compile Java to WebAssembly. Java has finally come full circle.
If only browsers supported Lua instead of JavaScript, we'd probably just be using the Lua register-based bytecode.
so embarrassed at 08:19
WASM was designed for compiling Java too?
WebAssembly was designed as a _compilation target_ from any language, including Java. That means WASM doesn't have to know anything about Java, but rather vice versa: Java (or whatever language you're writing in) just has to know about the WASM format, and output code in that format. Any modern browser will know how to run the WASM code your compiler outputs.
Java uses LLVM. That means Java can be compiled to Wasm. Which also means that Kotlin can be compiled to wasm. Funnily enough.
In my opinion, no. The WASM developers have focused almost entirely on C/C++. Although it is theoretically possible to compile anything to anything else, the results will inevitably be sort of lackluster for Java if you don't add proper support for garbage collection, multi-threading, and fast dynamic dispatch into the compilation target itself.
@@my2iu That's just... not true. Java bytecode is always translated to native machine code eventually. Translating java bytecode into Wasm is not any more difficult than that.
@@kitpeddler wasm is higher level and more restrictive than a true native assembly. It imposes extra overhead due to security checks.
javascript was a mistake. I hope this WebAssemply brings us better web.
What do you mean with better web? I can only think of performance reasons. Anything else?
@@dasten123 JavaScript is a security nightmare because it's so dynamic and had no module system at it's conception. There's a laundry list of other security problems too.
Subtitles for foreigns, please. :)
Subtitles are available for this video. Is there a language you're missing?
@@pictureus Auto-generated subtitles are unreliable.
@@elziolima8014 Yes, but still. If someone were to translate for you; they must know your language in advance.
@@pictureus I think a reliable English subtitle would help a lot.
"Creating a (simple) compiler isn't that hard"
That's because what you've built is basically a glorified tree walking interpreter. Not to discourage, but I don't think this can be classified as even a simple compiler.
What would a "simple compiler" constitute, if anything more than a program that generates code for a _compilation target_?
This is what a compiler is; a program that converts its instructions to machine-code (such as WASM or Assembly). Here it converts the instructions from his own language into WASM instructions. Like a compiler. It is then executed by the browser, by passing the code to the browser's WebAssembly executor through an API.
@FichDich InDemArsch no u