On Sun, 2007-10-21 at 19:48 -0700, Erick Tryzelaar wrote:
> Right now schannel's read is a proc which means you have to explicitly 
> pass in a variable that is assigned the value read from the channel. 
> I think this was how things were done before generators. 

Yes, you can try an experiment with read in a generator.
It should be lifted out and inlined away.

If the generator remains as a closure it may fail,
because the closure of a generator is still a functional
closure, not a procedural closures, so it cannot yield
and thus can't issue a service call.

HOWEVER this does raise an interesting point (thanks!!).

IF I manage to get the new garbage collector stuff working,
with a conservative stack scan, it may be possible to enter
the 'user space operating system' (the driver) with a callback
instead of a yield. The only constraint is that the current
fthread has to be continued, because the suspension is
INSIDE a call and there is no way to swap machine stacks.

This means that a call to do a garbage collection would
be 'callbackable' to invent a mouthful. However channel
I/O cannot be: you can't 'unschedule' an fthread which
is going to continue to execute when the callback returns.

However we DO have code in the compiler to completely
eliminate functions now, replacing them all with procedures.
So, EXCEPT for callbacks driven from C code, it should
be possible to even do channel I/O in functions,
by procedurizing them.

the trick is to procedurize functions that have to be and
not others, because the machine stack remains much faster
than the heap for allocations.

A procedurized version of Ackermann's function runs marginally
slower than C. (The functional version using the stack is
almost twice as fast as C).


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to