11 ms·
> could still write an async/callback library that looked just as natural as sequential code You can do that in any language with AST transforms powerful enoug
by quotemstr 10y ago
> could still write an async/callback library that looked just as natural as sequential code
You can do that in any language with AST transforms powerful enough to transform code into CPS. That functions are "automatically callbackified" is an implementation detail and not one particularly germane to high-level code.
- rtpg 10y agowell that's kind of the point isn't it? That Python doesn't offer this, and that Haskell is one of the few production-ready tools that offer this in a clean way?
- quotemstr 10y agoWho cares how it's implemented? Python lets you write straight-line code that does more than one IO-bound thing at a time. So does Haskell. That one is using a CPS transform under the hood and the other stack-switching via OS threads is irrelevant.
- rtpg 10y agoit's not exactly the same. Python lets you write straight-line code, but you still have to be explicit about the sync/async nature of each call. You can abstract this away in Haskell, thanks to some interesting tooling around `do` notation. Some people prefer the explicit nature though.