Hacker News new | ask | show | jobs
by inglor 3560 days ago
In general, mixing synchronous and asynchronous I/O typically brings you the worst in both worlds.

This has been a nightmare in C# which pioneered async/await - a lot of developers are struggling with footguns from mixing sync and async code.

Ryan Dhal said that he picked JavaScript for Node because he was afraid of this and wanted a language without synchronous APIs already built in.

I think Python 3.5+ async/await is fantastic don't get me wrong - but if you want to mix and match I'd recommend getting a second server that runs the synchronous framework and then communicating over network (REST HTTP for example) between the completely asynchronous server and the one running the thread pool.

1 comments

> This has been a nightmare in C# which pioneered async/await - a lot of developers are struggling with footguns from mixing sync and async code.

The big difference is that C# supports both multithreading and parallelism out of the box. Python has multithreading but with a GIL, nodejs has none of the 2.