logoalt Hacker News

usrnmtoday at 9:12 AM2 repliesview on HN

Are you sure that latency-sensitive parts are written in async JS instead of having a separate UI thread (pool)? I have no idea myself, but without knowing the details it's hard to argue. Note, that browsers themselves, are usually written in languages like C++ or Rust. They run JS, but aren't written in it


Replies

pjmlptoday at 10:30 AM

Yes they are, the UI layer is mostly JS, outside the rendering and layout engines.

spwa4today at 9:33 AM

If you implement threads and code that reacts to an input queue (e.g. PostMessage, queue_push, mq_send, ...), you've implemented (probably a bad version of) async threads. And yes, that's exactly what Windows 1.0 did and what made it great.

But God help you if you have to change the code. Async threads are a way to organize it and make it workable for humans.