orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 264 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 264 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 264 seconds]
orivej_ has joined #picolisp
orivej_ has quit [Ping timeout: 260 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
razzy has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
_whitelogger has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
mtsd has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
orivej_ has joined #picolisp
orivej has quit [Ping timeout: 264 seconds]
orivej_ has quit [Ping timeout: 260 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
<beneroth>
hi all
<tankf33der>
o/
<beneroth>
\o tankf33der
<Regenaxer>
Hi beneroth, tankf33der
<tankf33der>
picoLisp works on Linux kernel 5.7
<razzy>
Hi all :]
<beneroth>
tankf33der, yay!
<Regenaxer>
Hi razzy
<beneroth>
tankf33der, thanks for testing
<beneroth>
Hi razzy :)
<beneroth>
hi Regenaxer :)
<beneroth>
Regenaxer, I like to do some code rewriting while loading, a bit like C macros.. so `(foo ...) is the way to go. But how to guarantee that no accidental (foo ...) (without read macro) remains? zapping or redef 'foo after load?
<Regenaxer>
yes, zap is good
<Regenaxer>
or a transient symbol
<beneroth>
well the definition for 'foo needs to be outside of the loaded file
<Regenaxer>
ah, ok
<Regenaxer>
and the 'zap' too?
<beneroth>
aye
<beneroth>
I imagine:
<beneroth>
(de foo ...) (load ...) (zap 'foo) ?
<Regenaxer>
You could also (let foo '((X) ...) (load ...
<beneroth>
T
<beneroth>
could also be (let foo nsp~bar (load ...)) right?
<Regenaxer>
yes
<beneroth>
got it, thanks :-)
<Regenaxer>
:)
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
<aw->
hi all
<aw->
tankf33der here?
<tankf33der>
here.
<Regenaxer>
Hi aw-
<aw->
i'm looking for a hash algorithm in pure picolisp
* beneroth
looks forward to aw-'s EXPLAIN on this topic ^^
<aw->
yeah.. if I get it working
<aw->
oh that' weird
<aw->
Regenaxer: if I do (use *Timer (setq *Timer -3000) (task *Timer .... ) doesn't work
<aw->
(use *Timer ..) seems to be the issue
<Regenaxer>
sure
<Regenaxer>
It is dynamic binding
<Regenaxer>
You can pass it in the env
<Regenaxer>
(let Tim -3000 (task Tim 1000 'Tim Tim ... (task Tim)))
<Regenaxer>
The task has then its own environment
<Regenaxer>
'Tim' in this case
<Regenaxer>
Local bindings with 'let' or 'use' are gone when the task runs later in its own env
<aw->
ahhhhh
<aw->
ok that's why (let N ...) wasn't working either
<aw->
ok that makes sense
<aw->
i'll try this
<Regenaxer>
sorry, one quote too much
<Regenaxer>
as I said, the syms are not evaluated
<Regenaxer>
(task -2000 0 N 7 (msg (inc 'N)))
<aw->
great!
<aw->
ok it works now
<Regenaxer>
great :)
<aw->
i was looking at that example but slow to grok ;)
<Regenaxer>
One problem with timers calculated at runtime is that you must make sure that they don't conflict
<Regenaxer>
each timer needs a (slightly) different value
patrixl has joined #picolisp
<Regenaxer>
No problem if you have only one timer, and it stops before being started again
<aw->
i plan to have many
<Regenaxer>
So it needs some care
<aw->
but i'm using a key to store the unique number of the task
<aw->
(dec '*Timer)
<Regenaxer>
ok
<Regenaxer>
You could also check with (assoc ... *Run)
<Regenaxer>
and increment if it runs already
<aw->
hmmm
<aw->
so since a task runs in a different env, it can't change the value of global variables?
<Regenaxer>
No, globals can be changed normally
<Regenaxer>
'env' means local variable bindings
<Regenaxer>
Works with 'job's
<aw->
oh ok
<aw->
perfect
<aw->
i have one more question for you if you don't mind
<Regenaxer>
no problem
<aw->
i don't fully understand the difference between (set 'Var 123) and (setq Var 123).. i know it has to do with evaluation but it ends there
<Regenaxer>
These two are 100% equivalent
<aw->
i know
<aw->
but why use one or the other?
<Regenaxer>
setq is shorter
<Regenaxer>
and faster
<aw->
so they're = equivalent, no == equivalent
<Regenaxer>
(set (quote . Var) 123) calls a function
<Regenaxer>
equivalent in behavior
<aw->
yes i knew that
<aw->
why is (set) slower?
<Regenaxer>
The call to the quote function is some overhead
<Regenaxer>
very little though
<aw->
oh i see
<Regenaxer>
and the program size is one cell bigger
<Regenaxer>
So gc has more to do ;)
<aw->
(setq (quote . Var) 123) is very clear for me
<aw->
thank you
<Regenaxer>
but it is useless
<Regenaxer>
(set (quote ... makes sense
<Regenaxer>
(setq (quote . Var) will modify the *cell* (quote . Var)
<Regenaxer>
(de f (N) (setq (quote . Var) N))
<Regenaxer>
(f 1)
<Regenaxer>
(pp 'f)
<Regenaxer>
afp
orivej has joined #picolisp
patrixl has quit [Read error: Connection reset by peer]
patrixl has joined #picolisp
<Regenaxer>
ret
orivej has quit [Ping timeout: 264 seconds]
<aw->
Regenaxer: if I install a task, and then listen on a named pipe (blocking), will the task continue running?
<aw->
or.. will the task run at all after N seconds?
orivej has joined #picolisp
<aw->
seems to freeze in my tests
<Regenaxer>
yes, it is cooperative
<Regenaxer>
A blocking read always stops the whole process
<Regenaxer>
The pipe must be in a task too
<Regenaxer>
You must understand how task (or, to be exact, *Run) works
<Regenaxer>
ie the select() or poll() system call
<Regenaxer>
The term "multiplexed I/O" in Unix terminology
<Regenaxer>
*Run is just a front-end to select()
<Regenaxer>
or poll() in pil21
<Regenaxer>
select() and poll() is the same system call in the Unix kernel
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 260 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej_ has joined #picolisp
<tankf33der>
Regenaxer: remember how select is broken in musl? repl does not working. i will try pil21 on musl, was the same monthes ago. maybe try reimplement via poll then?
<Regenaxer>
pil21 does not use select()
<Regenaxer>
IIRC on musl the problem was that the "time not slept" (as written in the Linux man page of select()) was not set in musl
<Regenaxer>
poll() does not have this feature anyway
<Regenaxer>
Also, select() limits to 1024 file descriptors
<Regenaxer>
poll() has no limit, so we can fork more child processes in pil21
orivej_ has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
<tankf33der>
ok, then add glibc only as dependency
<Regenaxer>
in Makefile?
<Regenaxer>
Just take the C default of the target system
<Regenaxer>
i.e. -lc
<tankf33der>
add to readme of doc/diff or readme
<tankf33der>
just note
<Regenaxer>
Why should we mention glibc?
<Regenaxer>
It is all the job of llvm
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
<tankf33der>
because it hangs on musl
<tankf33der>
so this is glibc only lisp
<Regenaxer>
pil21 also hangs?
<Regenaxer>
without select()?
<Regenaxer>
I think it hung because the timer was mis-calculated
<tankf33der>
yea
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
<Regenaxer>
So no problem?
<Regenaxer>
Because the tests you made with musl was pil64?