There was a discussion about this in the original topic thread. I shall pull everything that jumps out at me and post them here.
The discussion didn't talk about possible issues with running in a shell. The only problem mentioned was wanting to get rid of the rednet coroutine due to interference. All of the ideas could be implemented without the top level coroutine override. At this point it seems like colloquial wisdom that isn't grounded with any technical basis.
it allows you to run other functions/programs in parallel with the shell
Lua coroutines all run parallel regardless of which point in the call stack they were started. It isn't true threading, just "green" threads, which means they all share the same CPU/VM and must behave nicely by giving up control regularly. CC has something in the java layer that will kill a coroutine if it has gone too long without yielding, but this isn't from the bios.lua, so you are still under it's control.
it is perfect for a rednet networking system. every single wireless turtle/PC can perform its usual functions while also forwarding messages onwards
This is possible without the coroutine override. You can pull modem_message and relay messages just as well at any level.
if you use this injection you can easly replace shell functions and os functions without replacing stuff twice.
Shell and os functions can be replaced without the coroutine override.
This was actually for an Adhoc network api I was writing, and RedNet was getting in the way at the time, so I needed a way to get rid of it :P/>/>
This is the only reason I can see for doing it, but even then if the shell and rednet routine both get all messages, it shouldn't have interfered. I'd be interested to see what the interference actually was and if it was real or perceived.
Spoiler
Also I didn't want people using a shell on my Mainframe computers.
I will likely use it in my operating system, just to get rid of Rednet and the Shell running in the background. Free up some stuff and make sure they don't interfere. I tend to do things outside of the book so the less other things running the better.
This kills all the current coroutines, and then starts the ones you tell it.
So this code is running at the VERY top of all the coroutines, It is above shell, it's above rednet.
It just gives you more control. For instance you could filter off certain events or manipulate them, and have complete control.
Also if you parallel a shell, it becomes a sub-shell, not a parent. This runs the parent shell.
"correct me if i'm wrong , but i could essentialy create a program(fake bios?) to run multiple programs ( interfaces / sensors ) and not use the normal shell at all? … so somthing like this , where fakebios controlls everything from the background"
Yes you could certainly do something like that!
And there would be no shell instance running at all.
The rest refer to getting rid of the shell so it isn't running in the "background". If you have a single startup file, the shell will give you control inside of a pcall until you error, so technically nothing else is "running in the background." If you end your program by exiting the shell, then no one can use the shell. So none of those reasons or ideas are really dependent on having an override. Filtering and manipulating events can be done by overriding os.pullEvent, again without the need for an override.
My question about the call stacks still stands. Any thoughts?