rob_w has joined #picolisp
<
tankf33der>
hi all
<
Regenaxer>
Hi tankf33der
<
tankf33der>
i ve create co.l file for all coroutines i have.
<
Regenaxer>
Very good
<
tankf33der>
pil64 passed extended code base under gc+, coroutines too.
<
Regenaxer>
Perfect
<
Regenaxer>
pil21 coroutines don't work yet though
<
Regenaxer>
Needs major re-constructions
<
Regenaxer>
I have only a proof of concept so far
<
Regenaxer>
the basic mechanism
<
Regenaxer>
But variable bindings/unbindings, I/O etc dont work
<
Regenaxer>
When done, needs good testing indeed
<
Regenaxer>
it is complicated
<
tankf33der>
pil64 and pil21 passed tests under fresh released linux kernel 5.8.1
aw- has joined #picolisp
mtsd has joined #picolisp
rob_w has quit [Quit: Leaving]
orivej has joined #picolisp
mtsd_ has joined #picolisp
mtsd has quit [Read error: Connection reset by peer]
mtsd__ has joined #picolisp
mtsd__ has quit [Remote host closed the connection]
mtsd_ has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 240 seconds]
rob_w has joined #picolisp
orivej has joined #picolisp
mtsd has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
mtsd has quit [Quit: Leaving]
orivej has joined #picolisp
aw- has quit [Quit: Leaving.]
rob_w has quit [Ping timeout: 256 seconds]
rob_w has joined #picolisp
rob_w has quit [Quit: Leaving]
orivej has quit [Ping timeout: 246 seconds]
<
Regenaxer>
First version of coroutines/pil21 seems to work
<
Regenaxer>
Error handling is not complete
<
Regenaxer>
must stop all coroutines after error, and also the stack limits are not checked yet
<
Regenaxer>
But I first want to know if it works
<
Regenaxer>
Implementation of coroutines in pil21 is a lot simpler than in pil64
<
Regenaxer>
I hope I did not forget something
<
tankf33der>
i will test today.
orivej has joined #picolisp
<
Regenaxer>
Include your tests calls to (stack)?
<
Regenaxer>
The return value looks a little different
<
Regenaxer>
cause it includes always T for the Main coroutine
<
Regenaxer>
(or better Main "program"?)
<
tankf33der>
i dont have tests for stack
<
tankf33der>
i will play with.
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
<
Regenaxer>
Correction to what I said above: Will
*not* automatically stop all coroutines after error. No reason.
<
tankf33der>
what is error in this context?
<
tankf33der>
==========
<
tankf33der>
$ pil21 co.l
<
tankf33der>
Segmentation fault (core dumped)
<
tankf33der>
==========
<
tankf33der>
crash code here:
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #picolisp
<
Regenaxer>
What is this link to irccloud?
<
tankf33der>
just wrong snippet paste code
<
tankf33der>
i just show pil21 crashed
<
tankf33der>
check code.
<
Regenaxer>
With "error" I mean any error
<
Regenaxer>
catch/trow frames are cleaned up
<
Regenaxer>
upon unwind
<
Regenaxer>
but for coroutines it makes no sense
<
Regenaxer>
frames may be gone from the stack already
<
Regenaxer>
So in pil21 I create no coFrames at all
<
Regenaxer>
all run independently
<
Regenaxer>
Will debug powers+filters later. I'm out atm
<
Regenaxer>
filtered I mean
<
Regenaxer>
BTW, (for (I 0 (inc 'I)) increments twice, right?
<
Regenaxer>
giving steps of two
<
Regenaxer>
the inc is in the condition
<
Regenaxer>
Hmm, but I must probably stop
*that* coroutine where the error occurred, unless it is not Main
<
Regenaxer>
*unless it is Main
<
Regenaxer>
Or, maybe not. The user can stop it manually
<
Regenaxer>
It is better not to do too much behind the scenes
orivej has quit [Ping timeout: 256 seconds]
<
Regenaxer>
Maybe I must think more about it
<
Regenaxer>
error or throw might leave too many zombie routines
<
Regenaxer>
Also not done is the stack management
<
Regenaxer>
freeing stack for finished coroutines
<
Regenaxer>
I think I need a doubly linked list
<
Regenaxer>
The problem is, if I do that stopping of coroutines exited by throw or error, I cannot guarantee to close all files
<
Regenaxer>
so there may be a file descriptor leak
<
Regenaxer>
But this problem is in pil64 too
<
tankf33der>
freedom and responsibility.
<
Regenaxer>
indeed :)
<
Regenaxer>
back at home
<
Regenaxer>
I'm boiling down the test case
<
Regenaxer>
This crashes:
<
Regenaxer>
(de powers ()
<
Regenaxer>
(co 'powers (yield 1)) )
<
Regenaxer>
(co 'filtered
<
Regenaxer>
(powers)
<
Regenaxer>
(yield 2) )
<
Regenaxer>
But this does not:
<
Regenaxer>
(co 'filtered
<
Regenaxer>
(co 'powers (yield 1))
<
Regenaxer>
(yield 2) )
mtsd has joined #picolisp
<
Regenaxer>
I will check tomorrow morning. Can't do such things in evenings
orivej has joined #picolisp
mtsd has quit [Quit: mtsd]
patrixl has quit [Read error: Connection reset by peer]
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #picolisp
patrixl has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
jibanes has quit [Ping timeout: 264 seconds]
jibanes has joined #picolisp
orivej has quit [Ping timeout: 260 seconds]
jibanes has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
jibanes has joined #picolisp