This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Coroutines
- From: Mike Stump <mrs at apple dot com>
- To: Dustin Laurence <dustin at laurences dot net>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Fri, 16 Jun 2006 14:05:13 -0700
- Subject: Re: Coroutines
- References: <20060616204157.GD23539@alice.wonderland.caltech.edu>
On Jun 16, 2006, at 1:41 PM, Dustin Laurence wrote:
I'm pretty sure this is stepping into deep quicksand
No, just hard work. It is only quicksand, if you start, but never
finish.
The mechanism I might favor would be to handle all the fun inside the
language front end. Objective-C does this for example for method
calls and just passes the backend a normal C call with certain data,
that calls into a run time library to do the heavy lifting. This
way, you preserve the notion of the backend and all its semantics,
this saves you from having to fight against them, but it does have
limitations (no full and complete interoperability with C).
You can just add a language runtime library (well established idea)
to handle the harder bits. The runtime library can be as complex as C
++'s or Ada's without any sense of violation of the model gcc uses.
If every language were going to have the feature, then, moving it
down into the mid-end or back-end might make sense, but I don't think
it does in this case.
I wouldn't start with pthreads I don't think.