4 ms·
Reading some comments here and it does confuse me Promises, async and await in javascript, coroutines and threads in kotlin, fibers in some language runtime (i
by VMtest 5y ago
Reading some comments here and it does confuse me
Promises, async and await in javascript, coroutines and threads in kotlin, fibers in some language runtime (including this php 8.1 [0]), single process (nodejs), multi-process(php-fpm worker), single-thread, multi-thread, goroutines in go, multi-core coroutines
Googling the definitions and x vs y situation helps a little, the main confusion to me is why some people want this xyz feature in a language runtime and not the other, the pros and cons are seriously so confusing
I have probably used several, like promises, async, await, like others said async would be implement on fibers [1] (is php 8.1 implementation same as V8,spidermonkey,javascriptcore? or any other language runtime). And I have tried to understand kotlin coroutines as well
modern times to run php, people would use php-fpm with nginx, it is running multiple worker (single) process, so why would anyone [2], [3] wants multi-core coroutines in it? What does it even mean?
Writing this out ease my mind a bit yea, need to be able to communicate the confusion instead of just saying "programming is difficult"
[0]: https://news.ycombinator.com/item?id=29343773 https://news.ycombinator.com/item?id=29343773
[1]: https://news.ycombinator.com/item?id=29344427 https://news.ycombinator.com/item?id=29344427
[2]: https://news.ycombinator.com/item?id=29344704 https://news.ycombinator.com/item?id=29344704
[3]: https://news.ycombinator.com/item?id=29345986 https://news.ycombinator.com/item?id=29345986
- francislavoie 5y ago> modern times to run php, people would use php-fpm with nginx, it is running multiple worker (single) process, so why would anyone [2], [3] wants multi-core coroutines in it? What does it even mean? Not everyone does. There's also https://reactphp.org https://reactphp.org (which is an event loop runtime, similar to Node), and https://amphp.org https://amphp.org (also event loops), and Swoole https://github.com/swoole/swoole-src https://github.com/swoole/swoole-src (coroutine runtime, similar to Go). Fibers are basically an API that event-loop runtime libs can use so that userland code doesn't need to use promises or generators to run non-blocking operations. Fibers are not useful for php-fpm or swoole users.
- conradfr 5y agoNot all PHP is behind a web server. Think long running workers, queue consumers, daemons etc.