Hacker News new | ask | show | jobs
by jkoudys 2363 days ago
Might see that flip in the coming years, if you consider web assembly (wasm) to be assembly. I do.
3 comments

WebAssembly is not assembly in the ways that the article talks about. Like, writing it directly doesn’t give you any special control or guarantees over timing.
It's assembly against a virtual machine, not a physical one. You're right it's not appropriate for an embedded system or some other RTS, but assembly doesn't stop being assembly when you target a virtual machine.
It kinda does in this case. Don’t kid yourself. In real assembly, the really interesting part is how to use a finite register file. WebAssembly has an infinite slab of variables available, in the sense that you get to say how big it is. That fundamentally changes the game.
There are real CPUs that are just like that.

In fact, most mainframes have always made use of microcoded CPUs, with Assembly being referred as bytecode on the programming manuals.

You just need to dive into IBM and Xerox PARC manuals, for starters.

Yep. I feel like most of HN's readership's asm education begins and ends with their 6502 class at uni.
Sounds like you’re saying those machines executed bytecode.

Otherwise there isn’t a great limiting principle to your logic. Just because someone once built hardware that executes such a high level assembly that the manual referred to it as bytecode doesn’t mean that all bytecode formats are assembly.

Indeed I am, the interpreter is the microcoded CPU.

Even modern 80x86 Assembly is a low level form of bytecode, given that the micro-ops that are processed by the microcoded CPU are completly unrelated to 80x86 Assembly opcodes.

Wasm is different than assembly, so I don't think so.
It targets a virtual machine, not a physical one, but other than that it's "assembly-like" enough that learning some core ASM coding practices will help you.
Not sure why you are sticking to your guns here. First, it's highly unlikely anyone would ever write wasm by hand. Second, the article rambles a bit but the most compelling argument for assembly is writing fast code for constrained hardware. At a high level, that's not what wasm is solving.
WebAssembly is a bytecode format.
Bytecode is just the instructions, which is actually a level lower than asm, but for a virtual machine instead of a physical one. It's a direct enough abstraction that you can predict the bytecode you'd build from the asm you write.