5 ms·
nothing in Javascript fundamentally forces IO libraries to be asynchronous, it's just that the domain in which JS is used (Node or Browsers) tend to have a lot
by rtpg 12y ago
nothing in Javascript fundamentally forces IO libraries to be asynchronous, it's just that the domain in which JS is used (Node or Browsers) tend to have a lot of async IO due to networks.
- wyager 12y ago> nothing in Javascript fundamentally forces IO libraries to be asynchronous Javascript inherently relies on highly non-deterministic heap allocation, deallocation, and garbage collection. None of these are conducive to real-time IO. You can not make strong guarantees about javascript execution time. They probably partially get around this by having all the important IO stuff done in C, but then that's not really a javascript microcontroller, is it?
- mtdewcmu 12y agoIt's not clear to me exactly how it came about that javascript is asynchronous. My suspicion is that in the earliest days, javascript was single-threaded simply because that made the implementation simpler.