4 ms·
Anyone looked at WASM, especially its text code format? I feel like it so badly wants to look something like forth but they couldn't make themselves do it. It
by LAC-Tech 3y ago
Anyone looked at WASM, especially its text code format?
I feel like it so badly wants to look something like forth but they couldn't make themselves do it. It would be so much more concise.
- jasonwatkinspdx 3y agoThey wanted to make it low friction to learn for their audience who are largely javascript programmers. I think it's a reasonable tradeoff even if I personally would prefer a more combinator style syntax.
- runlaszlorun 3y agoWas that really the intent? I made a longer rant elsewhere in this thread but I sure got the impression it was really for compiler implementers and not for anyone really writing in it at all. It’s sort of a false Lisp and a false Forth when I really should have not been afraid of the ARM vs x86 split and brushed up on a real assembly. :)
- jasonwatkinspdx 3y agoWASM grew out of the earlier asm.js, which was explicitly designed as a subset of javascript: http://asmjs.org/spec/latest/ http://asmjs.org/spec/latest/ The core idea there was to identify a subset of JS that was high performance on browsers and could be used as a compile target. WASM appeared because once asm.js got some momentum, people naturally asked "hey if browsers could implement just a couple extra things how much better could we make this?"
- kragen 3y agowasm isn't compatible with asm.js or with js tho they could have totally made it forthier if they thought that was a good idea, but their objective was rapid generation of efficient, secure code
- jasonwatkinspdx 3y agoExcept that would be strongly against the familiarity of the community momentum already built.
- kragen 3y agowhat they actually came up with was just as strongly against the familiarity of the community momentum already built, wasn't it? what features do you have in mind of the current wasm spec that are (1) in common with asm.js and (2) not in common with a hypothetical more-forth-like spec for efficient secure execution in browsers?
- LAC-Tech 3y agoIs the pool of JS programmers who are just going to casually learn in assembly language - and are totally cool with s-expressions - really that large? Seems like a waste of time to make your text format 3 times longer than it should be to cater to these unicorns.
- eternityforest 3y agoI think the target audience probably has no choice. They need performance, but their background might be web.
- LAC-Tech 3y agoI guess my point is there minds are going to be melted anyway by 1. low level details 2. a stack machine and 3. s-expressions. might as well use a text format that at least fits the domain.
- abecedarius 3y agoThere was a wasm predecessor (by, well, me) with a bit more of the Forth flavor: https://github.com/darius/idel https://github.com/darius/idel From >20 years ago and my main regret is a failure to carry it through to be more than a demo.