7 ms·
It should really be named as 'web bytecode' or 'web assembly'.
by Stranger2013 13y ago
It should really be named as 'web bytecode' or 'web assembly'.
- MasterScrat 13y agoWhat is this "web bytecode" you are referring to?
- okamiueru 13y agoI have no idea what people are talking about here (web bytecode and web assembly doesn't make any sense to me... thought the latter probably is intended to mean asm.js which is just a subset of js that allows for optimization based on the limitation of this subset). They compiled C/C++-code using Clang (or possible gcc w/dragonegg, but my guess is Clang 3.2 as that's the supported compiler for emscripten) to LLVM bytecode and then to JS/HTML5 using emscripten, which is aware of asm.js and optimizes for it. Mozilla (which Kripken is also highly involved with) are behind asm.js and is supported in the latest nightly of firefox (supposedly giving speeds to within 2x of native code, which is damn impressive), and the guy behind emscripten (again, Kripken) works for Mozilla. I'm don't know to what extend emscripten is part of Mozilla or his own personal project. ---- Slides by Kripken on emscripten (http://kripken.github.io/mloc_emscripten_talk http://kripken.github.io/mloc_emscripten_talk)
- mschuster91 13y agoThe "web bytecode" refers to the fact that the two script files are bytecode and not readable js. Download them with: 1) curl "http://cdn.unrealengine.com/html5-4c0913f/UDKGame-Browser-Shipping.js http://cdn.unrealengine.com/html5-4c0913f/UDKGame-Browser-Sh... -H "Referer: http://www.unrealengine.com/html5/ http://www.unrealengine.com/html5/ > UDKGame-Browser-Shipping.js 2) curl "http://cdn.unrealengine.com/html5-4c0913f/UDKGame_Data.js http://cdn.unrealengine.com/html5-4c0913f/UDKGame_Data.js -H "Referer: http://www.unrealengine.com/html5/ http://www.unrealengine.com/html5/ > UDKGame_Data.js And all you get is 5.4M / 4K of unreadable bytecode.
- kalleboo 13y ago> And all you get is 5.4M / 4K of unreadable bytecode. It's just gzipped. ungzip the files (turns 5 MB into 50 MB) and you can read them as plain text javascript.
- mschuster91 13y agoAh, that helps. I wonder why the gzip is not done automatically by curl/wget...
- kalleboo 13y agoYeah, it confused me at first as well, but I ran `file` to see what was going on and that clued me in.
- deno 13y agoIt will if you pass in --compressed flag, e.g.: curl --compressed "http://cdn.unrealengine.com/html5-4c0913f/UDKGame_Data.js" -H "Referer: http://www.unrealengine.com/html5/" -O
- jerf 13y agoYes and no... once you hit the // EMSCRIPTEN_START_ASM it becomes if((d|0)!=36620|(d|0)!=0&(c[b+4>>2]|0)!=0) {c[1779323]=6}b=c[1312365]|0;d=7084512; c[d>>2]=c[1312364]|0;c[d+4>>2]=b;b=7084520; d=c[b>>2]|0;if((d|0)!=36620|(d|0)!=0&(c[b+4>>2]|0)!=0) {c[1779323]=7}b=c[1312363]|0;d=7084520; c[d>>2]=c[1312362]|0; all on one line for nearly the rest of the file. It might as well be bytecode. Actually many bytecodes are more understandable.
- MasterScrat 13y agoNo, it's still JavaScript. The fact that it's compressed or not human-readable doesn't make it bytecode.
- jerf 13y ago
- weego 13y agoShould they? Both terms appear to not make much sense even in context, and also appear from a quick google search to have no provenance at all.
- arethuza 13y agoTo be fair, the idea of distributing executable bytecode to be run by some kind of VM in browsers has been around for almost as long as the web has (predating even Java), even if there never was a standard name for it.
- MasterScrat 13y agoSure, but that's just not what's being used here.