On Sat, Nov 04, 2023 at 06:57:54AM -0400, dick wrote: > EZ> ... fetching a URL with our built-in primitives is too slow. > > Quite the contrary. Last I checked `url-retrieve` was several times > faster than ELPA request.el (and presumably any other package that > crudely spawns a curl instance). The problem is that "slow" means many things for different situations. Most of the time it just means "blocking", i.e. Emacs becomes unresponsive while some network thing is twiddling its thumbs. Whereas non-blocking read and write are more or less (but see below) straightforward, a non-blocking network open (connect(2) and friends) is surprisingly hard to get right portably [1]. Same with the resolver (is gethostbyname going out to query DNS? Is local info sufficient? The only non-blocking way I know of is cheaping out and punting it to another process/thread which blocks for us (if anyone knows better I'd like to learn :) And, of course, if you are doing it all in one process, you've to get used to that continuation passing style "do this request and, on success, call that function, on failure that other". I don't mind that, and Javascript programmers would feel right at home, but not everyone likes that :-) Cheers [1] https://cr.yp.to/docs/connect.html -- tomás