> > I think the same thing applies to scheduling coroutines: we want the Scheduler to take over the "null fiber", >
Yes, you have quite accurately described a possible implementation. When a programmer loads the initial index.php, its code is already running inside a coroutine. We can call it the main coroutine or the root coroutine. When the index.php script reaches its last instruction, the coroutine finishes, execution is handed over to the Scheduler, and then everything proceeds as usual. Accordingly, if the Scheduler has more coroutines in the queue, reaching the last line of index.php does not mean the script terminates. Instead, it continues executing the queue until... there is nothing left to execute. > > At that point, the relationship to a block syntax perhaps becomes clearer: > Thanks to the extensive discussion, I realized that the implementation with startScheduler raises too many questions, and it's better to sacrifice a bit of backward compatibility for the sake of language elegance. After all, Fiber is unlikely to be used by ordinary programmers.