ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
xkapastel has quit [Quit: Connection closed for inactivity]
xkapastel has joined #picolisp
jibanes has quit [Ping timeout: 248 seconds]
jibanes has joined #picolisp
karswell has joined #picolisp
orivej has quit [Ping timeout: 245 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
karswell has quit [Read error: Connection reset by peer]
<Regenaxer> f8l, jan6, ok but I don't even use tput now. Only ANSI escape sequences
rob_w has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 246 seconds]
<Regenaxer> Anyway, released a new version today with some bug fixes
orivej has joined #picolisp
orivej has quit [Ping timeout: 268 seconds]
lupe_ has joined #picolisp
lupe_ has quit [Client Quit]
lupe has joined #picolisp
<beneroth> hi all
<Regenaxer> Hi beneroth
<beneroth> Regenaxer, how is your availability? Got some time for a pipe optimization problem? :D
<tankf33der> Regenaxer: new release is ok
<beneroth> thanks tankf33der
<beneroth> I'm currently using the following code, how to improve performance? I failed to come up with the code to keep the pipe open for multiple calls, or to replace the pipe with a fifo file, as they need introduction of a signaling char (e.g. one of the special whitespaces intended for that)
<beneroth> (de html-escape (Str)
<beneroth> (pipe
<beneroth> (when Str
<beneroth> (wait 1)
<beneroth> (ht:Prin Str)
<beneroth> (till NIL T) ) ) )
orivej has joined #picolisp
lupe has quit [Quit: ZNC - https://znc.in]
libertas has quit [Quit: leaving]
libertas_ has joined #picolisp
orivej has quit [Ping timeout: 244 seconds]
<Regenaxer> Sorry, driving
<Regenaxer> You can keep the pipe open if you don't pass a prg
<Regenaxer> (setq Fd (pipe ...
<Regenaxer> Why the 'wait'?
<Regenaxer> eg. 'mail' in @lib/misc.l opens such a persistent pipe
<Regenaxer> java/lib.l did that too, but is no longer in the distribution
<Regenaxer> @lib/android.l does it too, but no 'pipe' function (the pipes are opened by the Java part)
xkapastel has joined #picolisp
orivej has joined #picolisp
<Regenaxer> java/lib.l basically did (setq *Java (pipe (exec 'java "-cp" Path ...
<Regenaxer> then communicated bidirectionally with that process
<Regenaxer> Thanks tankf33der!
<Regenaxer> (I'm back home btw ;)
libertas_ has quit [Quit: ZNC - https://znc.in]
<beneroth> Regenaxer, no problem
<beneroth> (wait) was added because many quick calls to (html-escape) produced too fast too many fd's
<beneroth> Regenaxer, yeah I experimented with keeping the (pipe) open, doing only (echo) or so. So then the (ht:Prin) and 'till calls happen both in the caller process, pipe is just abused as fifo. But I didn't manage to get that working, (ht:Prin) always got stuck
<beneroth> (eof) can not be used as "delimiter", a explicit delimiter is needed for such a permanent I/O loop I think.
<beneroth> I have to try some more
<beneroth> not so simple
rob_w has quit [Quit: Leaving]
<Regenaxer> Ah, yes, too many FDs
<beneroth> I believe (not profiled) that the creation/closing of the fd's is the performance bottleneck when doing many (html-escape) calls
<beneroth> unfortunately, I cannot work in-stream (parsing/correcting input, output to be saved in db)
<Regenaxer> Yes, I would expect open/close be the bottleneck too.
<Regenaxer> You cannot keep the 'pipe'd process open?
<beneroth> yes, that I would like to do
<beneroth> in the one-shot pipe, the prg is just (ht:Prin Str)
<Regenaxer> I see, not a real external process, jut a pil-helper
<beneroth> T
<Regenaxer> (setq *Fd (pipe (exec "picolisp" "-loop (while (line T) (ht:Prin @))" "-bye")))
<Regenaxer> Ugly :)
<Regenaxer> (out *Fd (prin ...)) ... (in *Fd (line T))
<Regenaxer> Something like that, not tested
<beneroth> thanks, I will test
<Regenaxer> Wouldn't it be better to modify the string manually?
<beneroth> is there a hn: function for that? or you mean, re-implementing ht:Prin in picolisp?
<Regenaxer> yes
<Regenaxer> eg (pack (replace (chop S) "<" "&lt;" ">" "&gt;" ...))
<beneroth> probably
<Regenaxer> Not sure if faster
orivej has quit [Ping timeout: 248 seconds]
ubLIX has joined #picolisp
orivej has joined #picolisp
ubLIX has quit [Quit: ubLIX]
ubLIX has joined #picolisp
ubLIX has quit [Quit: ubLIX]