| ▲ | paulddraper 9 hours ago | ||||||||||||||||
> When someone says "write it in POSIX shell for portability," they mean well. > POSIX is a specification. Not a program. The thing that actually runs your script is bash, dash, ash, ksh, yash, or one of a dozen others. “When someone says ‘write it in ECMAScript,’ they mean well. “ECMAScript is specification. Not a program. The thing that actually runs your script is Node.js, Bun, Deno, Rhino, or one of a dozen others.” See how silly that sounds? | |||||||||||||||||
| ▲ | dzaima an hour ago | parent | next [-] | ||||||||||||||||
ECMAScript has a pretty massive amount of fully-specified behavior though; the things that differ between those implementations is nearly-entirely limited to fresh additions like `require` or whatever. The echo thing would be like if ECMAScript allowed stuff like `"123" == 123` to give either 0 or 1; and then indeed many things would probably break if moved across implementations. C is the closer comparison, and indeed much software that could easily be portable (and might claim it is) often depends on implementation-specific things like 8-bit bytes, 32-bit int, assuming int8_t/etc in stdint.h exist, twos complement (before C23 at least), arithmetic shift right, etc. | |||||||||||||||||
| ▲ | gaigalas 8 hours ago | parent | prev [-] | ||||||||||||||||
No one says "Let's write ECMAScript for portability". If someone did, I would probably be writing about that too. | |||||||||||||||||
| |||||||||||||||||