<singa>
But there is a lot of work to port http stack with coroutines
<singa>
maybe someone interested in such things
<Regenaxer>
What exactly is the difference to the internal select() calls?
<singa>
select doesn't have async mode
<Regenaxer>
I've never looked at epoll
<singa>
means we can't process remaining job untill data available in any of listening descriptors
<Regenaxer>
well, we can poll with select() too
<Regenaxer>
(doc 'poll)
<Regenaxer>
Seems that epoll() just supports *more* file descriptors
<Regenaxer>
select is limited to 1024 by default
<singa>
yup, it's much like enchanced poll
<Regenaxer>
yeah
<Regenaxer>
So it would make sense to replace the internal select
<Regenaxer>
But with more FDs we run into other problems
<Regenaxer>
in a typical pil setup
<Regenaxer>
as the parent process schedules the messages, so there is a performance bottleneck
<Regenaxer>
Your code looks very good
<yunfan[Cr2]>
i am reading the chapter about run script from any places
<singa>
Tanks!
<yunfan[Cr2]>
and thinking why not act like python does
<yunfan[Cr2]>
you just treat every file as a module and use a powerful load instead of so many rules
<Regenaxer>
yunfan[Cr2], which rules do you mean?
<yunfan[Cr2]>
Regenaxer: the whole chapter talk about
<Regenaxer>
are you talking about epoll, or *Run / task's ?
<yunfan[Cr2]>
nope, i am talking about (load "@app/blah.l")
<yunfan[Cr2]>
such things from that tutorial
<Regenaxer>
Ah, ok
<yunfan[Cr2]>
also , that commandline options implmentation were so cool
singa_ has joined #picolisp
singa has quit [Quit: Page closed]
singa_ has left #picolisp [#picolisp]
singa has joined #picolisp
<aw->
singa: awesome!
<aw->
singa: you can do a single (setq *Key value *Key2 value2) rather than multiple (setq)
<yunfan[Cr2]>
so epoll could allow rising edge trigger?
<singa>
sorry, what it means?
<beneroth>
hi
<singa>
You mean timer?
<Regenaxer>
Hi beneroth
<yunfan[Cr2]>
no, rising edge
<yunfan[Cr2]>
when you have a sequences of binary number, which change from 0 to 1, its called rising edge, isnt that?
<singa>
the man says: "The epoll API can be used either as an edge-triggered or a level-triggered interface.."
<Regenaxer>
I think singa referred to the setq
<yunfan[Cr2]>
and 0/1 could be mappting to file handle's close/open status
<beneroth>
so its just a bit-table?
<beneroth>
I'm interested in epoll. no experience.
<yunfan[Cr2]>
i just heard of that epoll could support that
<yunfan[Cr2]>
but i havent look into that
<singa>
yes, in general, it's a bit table, mapped to array of epoll_event structures
<singa>
it has O(1) instead of poll's O(n) complexity
mtsd has joined #picolisp
<aw->
epoll used by libev (nodejs)
<aw->
it has nice properties
yunfan[Cr2] has quit [Ping timeout: 264 seconds]
<singa>
I had project in Rust using https://tokio.rs/ (it uses epoll too)
<singa>
thince picoLisp has fast coroutines - thought it would be great to bring asynchronous I/O too
<beneroth>
nginx uses epoll (when available)
<beneroth>
I still have to find out how to hand a socket from one process to another
<beneroth>
e.g. master process to select/epoll (listen) to incoming connections, and than assign it to a worker process.
<aw->
beneroth: i think i did that in my nanomsg lib.. can't remember
<beneroth>
instead of the simpler (and more stable, but not as scalable) forker architecture
<singa>
usually there is one process utilizes epoll and calling asynchronous handlers (coroutines)
<singa>
Hovewer, such design imposes restrictions to all app architecture
<singa>
since you have to write every heavy function as coroutine
<Regenaxer>
I still don't see why all this can be done with existing 'task's (ie *Run)
<Regenaxer>
s/can/can't
<Regenaxer>
epoll()s main diff is the higher limit on FDs, right?
<Regenaxer>
I'm using coroutines in tasks
<singa>
and fastest polling
<Regenaxer>
select() is not the bottleneck
<Regenaxer>
Usually there is no polling at all
<Regenaxer>
polling (busy wait) is bad, right?
<singa>
definitely
<Regenaxer>
So I have everything asynchronous in tasks
<Regenaxer>
or separate processes of course
<singa>
let me look closer on tasks
<singa>
maybe it's already there - all I need
<Regenaxer>
Looks like epoll() is better, would be good to replace the internal select() with epoll() in the long range
<Regenaxer>
This is not trivial probably, I also looked at poll() back then but decided against it
<Regenaxer>
it is internally the same system call anyway
<Regenaxer>
(I think poll() is the true internal in Linux)
<singa>
epoll is not the POSIX
<Regenaxer>
yeah
<Regenaxer>
but widely supported?
<singa>
yes
<Regenaxer>
Oops, must go. Back later
<Regenaxer>
afp
<aw->
i looked into epoll a while back, it seems like it would be a great addition to PicoLisp, i wouldn't specifically try to "replace" what's already there
<aw->
there's always a need to select() blocking
<aw->
sometimes* a need
<beneroth>
T
sriram has joined #picolisp
<Regenaxer>
ret
<Regenaxer>
Hi sriram!
<Regenaxer>
I looked at your code this morning
<Regenaxer>
There were some issues, I'm not sure what you intended in the SVG code
<sriram>
Pixels (px) are relative to the viewing device. For low-dpi devices, 1px is one device pixel (dot) of the display. For printers and high resolution screens 1px implies multiple device pixels.
<sriram>
so just lucky it worked on my screen with that default conversion (96/72)
<sriram>
so i suppose my question still holds
<sriram>
how can we use the down function when its units are in dots (points)
<sriram>
and the svg doc is specified with "px"
<sriram>
^when^if
<Regenaxer>
As you see in app/lib.l
<Regenaxer>
Good for rough positioning
<Regenaxer>
Printing is always in pt
<Regenaxer>
I often do (down 6) for roughly half a line
<sriram>
yes...i saw app/lib.l...the down calls...i assumed that the down arguments were pixels too just like the x and y positions
<sriram>
ah ok ...good to know
<Regenaxer>
Whatever the unit is
<Regenaxer>
in 'page' for PDF printing it is always "pt"
<sriram>
even in pdfPage down is used : (down (*/ *FontSize 2 3))
<Regenaxer>
here *FontSize can have huge variations
<Regenaxer>
so it wants to go down 2/3 of a lineheight
<sriram>
so a lineheight = FontSize...and because FontSize varies it goes down 2/3 of FontSize
<sriram>
not sure i understood correctly
<Regenaxer>
lineheight is probably fontsize plus some spacing
<sriram>
(what is a lineheight?)
<sriram>
ah ok
<Regenaxer>
I don't remember well. Did not look at this stuff for some years
<sriram>
no problem
<sriram>
i will leave it now
<Regenaxer>
Simply use it for printing ERP etc. documents
<sriram>
and i will go to the mouse click/move for now :)
<Regenaxer>
Yeah, I also need some stuff doen
<sriram>
agreed....for screen..somehow i have a feeling i would like to use % rather than
<sriram>
absolute numbers
<sriram>
but thats ok
<sriram>
for now
<sriram>
bye for now :)
<sriram>
and thanks!
<Regenaxer>
:)
<Regenaxer>
yes, percent also work I think
<Regenaxer>
not sure for SVG at the moment
<Regenaxer>
on mobiles I do all in percent, but that's CSS/HTML
<sriram>
yes...will try in my miniapp too
<Regenaxer>
ok :)
orivej has quit [Ping timeout: 260 seconds]
<sriram>
hi Regenaxer...I was looking at the generated svg..the same DX DY args to <svg> are used for the width and height of the element itself *as well as* the view box
<sriram>
so cant do something like : <svg width="60%" height="60%" viewBox="0 0 1000 1000" ....>
<sriram>
so that the width and height of the element in the browser window is dissociated from the actual x y coords used for drawing rectangles circles text inside (they will use the viewbox coords)
<sriram>
the browser would scale the drawings inside the viewbox to to the actual element size
<sriram>
(I was planning to write my own <mysvg> function (<mysvg> W H Z *DX *DY) ...but just wanted to let you know in case you had any ideas to merge with the existing function)
<sriram>
illustration penyacom.org/p?q=SHZsUUw
<sriram>
(its an html file)
rob_w has quit [Quit: Leaving]
<Regenaxer>
I see, cool!
<sriram>
by the way..can I call the console function from lisp side...to display something on the repl
<sriram>
since the output port is used for sending to browser
<Regenaxer>
yes, stderr, usually with (msg X " some text")
<Regenaxer>
trace also goes to stderr
<sriram>
ah ok good...console does not work
<sriram>
it prints..but the browser does not show anything..though it responds to mouse clicks
<sriram>
console works from java side
<Regenaxer>
'console' in lib/form.l should work
alexshendi has joined #picolisp
sriram has quit [Ping timeout: 260 seconds]
andyjpb has quit [Ping timeout: 264 seconds]
khk has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
pierpa has joined #picolisp
_whitelogger has joined #picolisp
orivej has joined #picolisp
khk has left #picolisp ["Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is"]