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
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
aw- has joined #picolisp
jibanes has quit [Ping timeout: 264 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 246 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 272 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 264 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
orivej has quit [Ping timeout: 260 seconds]
<Regenaxer> tankf33der: Now with a fresh mind, I think I could fix the problems (except ^Z of course)
<Regenaxer> released. Can you test later?
<tankf33der> sure
<Regenaxer> thx!
<aw-> Regenaxer: hi
<Regenaxer> Hi aw-!
<Regenaxer> aw-, btw, I noticed that I need to change PilBox from MIT/X11 to GPL
<aw-> ?
<aw-> why?
<Regenaxer> cause it contains the readline library file
<Regenaxer> in the TGZ
<aw-> hmmm
<Regenaxer> The Debian maintainer also complained
<Regenaxer> about readline
<aw-> i see
<aw-> well, that is not good
<Regenaxer> I told him that he may change to GPL for package
<Regenaxer> yes, old trouble
<aw-> right, perhaps dual license
<Regenaxer> yeyh
<aw-> or get rid of readline ;)
<Regenaxer> Difficult
<Regenaxer> or impossible
<Regenaxer> I think there is no full alternative
<aw-> ok
<aw-> i have a question about (native)
<Regenaxer> ok
<aw-> if i call a function that expects a u8 argument (0-255), and i provide 257 as the argument
<aw-> is it normal for the program to interpret it as 2 ?
<aw-> err
<aw-> as 1
<Regenaxer> yes, it is masked
<aw-> 256 = 0, 257 = 1 ...
<aw-> ok so picolisp is doing that
<Regenaxer> hmm, not sure
<tankf33der> Regenaxer: all passed.
<Regenaxer> in fact C does not support such arguments
<Regenaxer> values smaller than an int are always converted
<Regenaxer> register or stack argument
<aw-> hmmm
<Regenaxer> tankf33der, great! :)
<aw-> what about a pointer to an array?
<aw-> the items in the array are integers
<Regenaxer> fine
<aw-> or, are they 8-bit unsigned integers?
<Regenaxer> whatever you define
<Regenaxer> a string for example is a structure of 8-bit values
rob_w has joined #picolisp
<Regenaxer> whether signed or unsigned depends on how the program interprets them
<Regenaxer> this is for all values
<Regenaxer> an array of integers may be interpreted as an array of bytes or whatever
<Regenaxer> I C, *data* have no type
<Regenaxer> the code does
<Regenaxer> static types, existing only at compile time
<aw-> hmmm
<aw-> ok so my issue is on the native side, it only accepts an array of 8-bit integers
<aw-> but on picolisp side if I send a list with values (257 257) then on native side i get [1, 1]
<Regenaxer> How do you mean that?
mtsd has joined #picolisp
<aw-> i'm trying to figure out who is converting it to [1, 1]
<Regenaxer> 257 can never be a byte value
<aw-> native or picolisp
<aw-> yes i know
<Regenaxer> it is already stored as 1
<aw-> ok ok that makes sense
<Regenaxer> So you do not have function args as bytes
<Regenaxer> but pointers to arrays of bytes, right?
<Regenaxer> byte args make not really sense
<aw-> right
<Regenaxer> or, they do, but are passed as ints
<Regenaxer> How is the array built?
<Regenaxer> from 'native' or from C code?
<aw-> from picolisp with (struct)
<aw-> (struct X NIL 257 257) .. then I pass X as argument to the (native) function
<Regenaxer> So 257 is illegal
<Regenaxer> not runtime-checked by 'struct'
<Regenaxer> yes, src/main.l line 1183: (set Ptr (i8 (int Val)))
<Regenaxer> It simply truncates to 8 bit
<Regenaxer> equivalent to (struct X NIL (& 257 (hex "FF")) ...
<aw-> right
<aw-> ok perfect, that's what I wanted to know
<aw-> thank you!
<Regenaxer> :)
<Regenaxer> ha!!
<Regenaxer> tankf33der, I found a fix for the ^Z issue
<Regenaxer> I think it was indeed my fault
<Regenaxer> I inserted a check whether readline is initialized
<Regenaxer> Because when Vip is called from the shell, readline is not used and thus not initialized
<Regenaxer> hmm, but not 100%
<Regenaxer> Now it is bad in the REPL
<Regenaxer> ok, but now it seems OK
<Regenaxer> needed a different check in one case
<Regenaxer> testing
<tankf33der> what you do in testing?
<Regenaxer> Seems good now :)
<Regenaxer> So pil21 is perfect now?
aw- has quit [Ping timeout: 260 seconds]
aw- has joined #picolisp
Regenaxer has quit [*.net *.split]
inara has quit [*.net *.split]
inara has joined #picolisp
Regenaxer has joined #picolisp
<tankf33der> Regenaxer: pil21 is perfect as always.
<Regenaxer> hehe ;)
<Regenaxer> Now I released a new chess.tgz
<tankf33der> i wonder why (call 'python) works
<tankf33der> and (call 'irb) fails in pil21
<Regenaxer> What is irb?
<tankf33der> because calling 'irb in pil64 works.
<tankf33der> repl for ruby
<Regenaxer> I see
<Regenaxer> Can you try to trace (call 'irb)?
<Regenaxer> What the difference is
<tankf33der> http://ix.io/2HYA
<Regenaxer> It immediately dumps a traceback?
<Regenaxer> reading from stdin
<tankf33der> yea
<tankf33der> this is pil64:
<tankf33der> $ pil +
<tankf33der> : (call 'irb)
<tankf33der> irb(main):001:0>
<Regenaxer> Most probably has to do with readline
<Regenaxer> how it initialized I/O
<Regenaxer> How about ./pil -"call 'irb" + ?
<Regenaxer> avoids readline
<tankf33der> http://ix.io/2HYC
<Regenaxer> ok
<Regenaxer> Vim also does not work:
<Regenaxer> : (call 'vim)
<Regenaxer> Vim: Error reading input, exiting...
<Regenaxer> Vim: Finished.
<Regenaxer> Same with ./pil -"call 'vim" +
<Regenaxer> Used to work in pil64
<tankf33der> this is my last issue.
<Regenaxer> 'call' needs some setup then
<Regenaxer> not only the tty cleanlp
<Regenaxer> uq
<Regenaxer> cleanup
<Regenaxer> but also stop/start readline
<Regenaxer> The whole readline stuff is indeed hard to get righy
<Regenaxer> I try rlSigBeg + rlSigEnd in 'call'
<Regenaxer> Not sure where
<Regenaxer> in parent or in child
<Regenaxer> and is all that terminal handling still needed?
<Regenaxer> 'call' is tough
<Regenaxer> already in pil32 + pil64
<Regenaxer> (rlSigBeg) does not work
<Regenaxer> sigh
<Regenaxer> I give up
<Regenaxer> The problem is that pil changes the terminal settings (key, raw) and readline does that too. Then programs like vip or irb also want to do that. A mess!
<Regenaxer> I don't find a way to "uninitialize" readline
<Regenaxer> Perhaps remove (initReadline) from 'main', and do it later on demand?
<Regenaxer> Then at least the command line call would work
<Regenaxer> Hmm, no, (initReadline) only initializes variables. Does not call any readline function
<Regenaxer> So why does -"call 'vim" not work?
<Regenaxer> btw, in pil64 pil -"call 'vim" also does not work
<Regenaxer> : (call "./pil" "-println 123" "-bye")
<Regenaxer> 123
<Regenaxer> -> T
<Regenaxer> Does not work well if called without "-bye"
orivej has joined #picolisp
<Regenaxer> I give up trying to improve 'call'
orivej has quit [Ping timeout: 265 seconds]
<tankf33der> Regenaxer: it is ok, lets leave it as is. what you think?
<Regenaxer> yeah, I don't understand what exactly goes wrong
<tankf33der> Regenaxer: deleting irb issue from file.
<Regenaxer> ok
<aw-> Regenaxer: do you have an example of (native) T specification? "Direct lisp value" ?
<aw-> result* specification
<Regenaxer> I'm out atm, will look later
<aw-> ok np
<beneroth> I would think this means a PLIO encoded value
<beneroth> (which can be any picolisp value)
<beneroth> but I cannot be certain
<aw-> that could be interesting..
orivej has joined #picolisp
<Regenaxer> Ah, no, it means pointer to Lisp data
<Regenaxer> Example: http://ix.io/2I0R
<Regenaxer> For a PLIO encoded value there is a new function 'plio'
<Regenaxer> With native + T you could do anything, e.g. access built-in Lisp functions, or implement an array of Lisp items
<Regenaxer> (for the latter take care of gc!)
<aw-> i see
<aw-> oh interesting for (plio)
<Regenaxer> 'plio' is used in @lib/net.l iirc
<aw-> so i can pass plio to a C function as a pointer?
<Regenaxer> yes
<Regenaxer> address of a buffer
<aw-> ah yes i see it in @lib/net.l
<aw-> so (udp) is sending data encoded with plio
<Regenaxer> right
mtsd has quit [Quit: Leaving]
<aw-> thank you!!
<Regenaxer> :)
orivej_ has joined #picolisp
orivej has quit [Ping timeout: 260 seconds]
<Regenaxer> BTW, calling built-in functions needs quite some knowledge about how they work:
<Regenaxer> $: (%@ "_cons" T '(T x 1 2))
<Regenaxer> -> (1 . 2)
<Regenaxer> $: (%@ "_cons" T '(T x (+ 3 4) (* 3 4)))
<Regenaxer> -> (7 . 12)
<Regenaxer> The 'x' can be anything, is ignored by 'cons'
<beneroth> thanks, noted :)
<Regenaxer> hi beneroth :)
<beneroth> heya :)
<tankf33der> Regenaxer: do you have tests for T calls?
<Regenaxer> Not specially
<tankf33der> i will add all above, just in case
<Regenaxer> They are the simplest of all args and return values
<Regenaxer> ok, good
<Regenaxer> Then better use
<Regenaxer> (%@ "_cons" T '(T cons (+ 3 4) (* 3 4)))
<Regenaxer> i.e. with 'cons' instead of 'x'
<Regenaxer> as this is the normal case
<Regenaxer> (cons (+ 3 4) (* 3 4))
<Regenaxer> The interpreter functions get the whole expression
rob_w has quit [Remote host closed the connection]
jibanes has quit [Ping timeout: 272 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 246 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 272 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 264 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
Blukunfando has joined #picolisp
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
f8l has quit [Remote host closed the connection]
f8l has joined #picolisp
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
orivej_ has quit [Ping timeout: 240 seconds]
jibanes has quit [Ping timeout: 272 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 264 seconds]
jibanes has joined #picolisp
orivej has joined #picolisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 272 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
orivej has joined #picolisp
jibanes has quit [Ping timeout: 246 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 264 seconds]
jibanes has joined #picolisp