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
rob_w has quit [Quit: Leaving]
shpx has joined #picolisp
ubLIX has quit [Quit: *cackles*]
aw- has quit [Ping timeout: 246 seconds]
aw- has joined #picolisp
shpx has quit [Ping timeout: 250 seconds]
aw- has quit [Read error: Connection reset by peer]
aw- has joined #picolisp
_whitelogger has joined #picolisp
_whitelogger has joined #picolisp
_whitelogger has joined #picolisp
_whitelogger has joined #picolisp
_whitelogger has joined #picolisp
orivej has joined #picolisp
razzy has joined #picolisp
<razzy> hi all, for the record: i like simple understandable tests where you can analyse results, complemented with one automated bundle of everything that says "everything is OK" or "there was a problem, start making simple tests to understand"
<razzy> also maintenance costs of said bundle are too high for picolisp imho
<Regenaxer> Hi razzy, which bundle are you talking of?
<razzy> one that i do not know exists in picolisp
<razzy> Regenaxer: do tests.l cover everything in picolisp?
<Regenaxer> you "do not know exists"?
<Regenaxer> what does that mean?
<Regenaxer> Anyway. How can a test cover everything?
<Regenaxer> What *is* everything?
<razzy> everything-test could cover all basics building blocks or most used functions in software.
<razzy> for example fuzzy-testing https://en.wikipedia.org/wiki/Fuzzing input-output for functions
<Regenaxer> No fuzzy tests there. Please implement!
<razzy> do you mean it?
<Regenaxer> sure
<Regenaxer> Don't talk, do!
<Regenaxer> a good exercise
<Regenaxer> You could contribute something useful instead of just complaining and demanding all the time
<razzy> :D T
razzy has quit [Quit: ERC (IRC client for Emacs 26.1)]
rob_w has joined #picolisp
razzy has joined #picolisp
orivej has quit [Ping timeout: 272 seconds]
osmano807 has joined #picolisp
<osmano807> Hello, can someone help debug why the internal http server doesn't start even with the sample programs?
<osmano807> It doesn't show any errors, but the server doesn't start (no tcp port open, but the picolisp shell starts)
<Regenaxer> Hi osmano807
<Regenaxer> You mean the (server ..) function, or the httpGate utility?
<Regenaxer> and what did you start, and how?
<osmano807> Nevermind. The problem was with my distro (NixOS) and wrong packaging (It wasn't passing shell arguments to the picolisp binary)
<Regenaxer> All right :)
osmano807 has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
<tankf33der> picolisp build and pass tests on voidlinux. ok.
<Regenaxer> Thanks
<tankf33der> and pil32 via multilib mode.
<Regenaxer> ok
freemint has joined #picolisp
<freemint> razzy how would you go about implementing fuzzing? what would you like to fuzz?
<razzy> freemint: you put randomized inputs to every basic function. record outputs. use pairs input-output as benchmark. in future use same inputs. if outputs change, return failure
<freemint> the same randomized inputs for everyone? It's not fuzzing then.
<razzy> freemint: i mean multiple randomised inputs->output per function. it count as fuzzing imho
<razzy> did i get my idea across?
<freemint> so you got different inputs each time?
<razzy> freemint: in first batch you have different inputs for one tested function.
<razzy> in seconds and after you have same batch of different inputs so you can run diff on them
<razzy> you can run diff between first which you know is OK. and everyafter which might be changed
<freemint> ok i would go the "compare equivalent implentations" route with the other implementations being more audible
<freemint> razzy so you can only catch new errors?
<freemint> afk?
<razzy> freemint: yes, new errors and hardbugs like segfault.
<razzy> freemint: also, if you have different versions of same function, you can compare those
<razzy> but ussually you do not program everything 3 times
<razzy> freemint: it is very usefull, if you do some core changes, and want to be reasonably sure that everything else works ok.
<razzy> freemint: did i explain my idea well?
orivej has quit [Ping timeout: 272 seconds]
lodsw has quit [Read error: Connection reset by peer]
<razzy> btw, i think something(propably GC) restructuralise adresses of cells. adresses seem different each time i look. is it true?
lodsw has joined #picolisp
<Regenaxer> The address of a cell never changes
<freemint> razzy the addresses of a list does not change but (== (1 2) (1 2)) are not pointer equal because they are technically not the same list
<Regenaxer> only a new cell may appear in that place
<Regenaxer> freemint, right
<Regenaxer> the reader creates two lists
<freemint> razzy so your idea was vaguealy explained and your english was a little lacking, like my english gets bad when i am tired. Because of the vagueness i had to ask and i am not sure that your approach is the best you could take but since you implement it you can do your own thing
<freemint> I would go with multiple equivalent implementations
<freemint> but i would not include it in the default unit test and write a seperate fuzz.l instead which generate reports and you can leave running for some time and it will try to find errors.
<razzy> freemint: noted, in bucket list
<razzy> Regenaxer: i think i have counterexample https://ptpb.pw/qduh
<freemint> razzy my approach is huge undertaking but it will end up generating a powerfull documentation
<razzy> your aproach? to fuzzying?
<Regenaxer> razzy: Counterexample for what?
<Regenaxer> I see
<Regenaxer> hmm, you still did not grasp Lisp
<Regenaxer> (adr '(cdr a)) is *read* newly each time
<Regenaxer> (adr (cdr a)) is the CDR
<Regenaxer> As I said, an existing cell is *never* moved
<Regenaxer> this would create havoc, as it might be referred to from many places
mtsd has joined #picolisp
<freemint> Oh Regenaxer i did not see that either
<razzy> Regenaxer: thx, i will meditate on it
<Regenaxer> Good :)
<mtsd> Good evening :)
<Regenaxer> Good evening mtsd!
<mtsd> Hello Regenaxer!
<Regenaxer> :)
<mtsd> Last few days of 2018 :)
<Regenaxer> yeah
<mtsd> We are going to celebrate new years eve with some friends. They have small children too, so it will be quite peaceful
<mtsd> Well, as peaceful as it can get, with many small children around ;)
<Regenaxer> Same here (though without small children)
<Regenaxer> They come here, and we make Sushi-Party :)
<mtsd> Sounds great! I really like sushi :)
<Regenaxer> :)
<mtsd> Tried making some at home once
<freemint> My '+ idea
<freemint> (de add (A B) (+ (x| (A B)) (>> -1 (& (A B))))) (de addlist @ (if (cdr (rest)) (add (car (rest)) (apply addlist (cdr (rest)))) (car (rest))))
<Regenaxer> 'A' is a function?
<Regenaxer> (+ (x| (A B))
<freemint> sorry misstype
<freemint> (de add (A B) (+ (x| A B) (>> -1 (& A B))))
<Regenaxer> What kind of addition is this?
<freemint> Addition by binary shifting how it is done in hardware
<Regenaxer> (if (cdr (rest)) can be done much simpler
<Regenaxer> (rest) is expensive
<freemint> I was curious if there was an better way
<Regenaxer> you iterate with (next)
<Regenaxer> and a loop is much better than recursion
<Regenaxer> I did not completely understand what you do
<Regenaxer> just my experience ... ;)
<freemint> ok i will improve it
<Regenaxer> recursion might be all right
<Regenaxer> but here it looks like a plain loop
<freemint> it is a plain loop
<Regenaxer> What is the purpose of the above?
<Regenaxer> (de addlist @ (for (N (add (next) (next)) (next) (add @ N)) N))
<Regenaxer> ?
<freemint> is it to handle (+ 6 7 8)
<Regenaxer> ok
<freemint> (de addl @ (let N 0 (loop (NIL (rest)) (setq N (add (next) N))) N )) but i think i could make it more beautifull
<Regenaxer> No, not (rest)
<Regenaxer> it builds a new list on each call
<Regenaxer> (args) is better
<Regenaxer> checks *if* there are more
<Regenaxer> (de addl @ (let N 0 (while (next) (setq N (add @ N))) N]
<Regenaxer> or
<Regenaxer> (de addl @ (let N 0 (while (args) (setq N (add (next) N))) N]
<freemint> what does (setq N (add @ N)) do?
<Regenaxer> '@' is bound to the result of (while (next)
<freemint> ahh
<Regenaxer> (doc '@)
<Regenaxer> or better picolisp/doc/ref.h
<Regenaxer> oops
<Regenaxer> picolisp/doc/ref.h#atres
<Regenaxer> @ Result
<Regenaxer> -> Flow functions
<freemint> why won't you make it picolisp/doc/ref.h#aters ;)
<Regenaxer> the path depends on the installation
<Regenaxer> Here it is e.g. file:///data/data/com.termux/files/usr/lib/picolisp/doc/ref.html#atres
<freemint> you did not catch the joke?
<Regenaxer> oh, ups
<Regenaxer> Sitting here with family after a few beers ;)
<Regenaxer> But haters is too harsh
<freemint> :)
<freemint> is there a cheap? get the position of the most significant bit which is not 0?
<freemint> i do not like that my add still uses +
<Regenaxer> Unfortunately not
<freemint> is there a chop for numbers?
<Regenaxer> yes, the normal 'chop' chops the decimal digits
<freemint> (chopn 9) (1 0 0 1)
<freemint> to binary numbers
<Regenaxer> (chop (bin 9))
<Regenaxer> but expensive
<Regenaxer> as 'bin' is expensive
<Regenaxer> better do the equivalent directly
<freemint> yeah i do not like that string conversion
<Regenaxer> without building a symbol first
<freemint> but nothing built in?
<Regenaxer> exactly
<Regenaxer> to find the highest bit?
<freemint> mhh i had that pop up in an actual program.
<Regenaxer> dup dup not and =
<Regenaxer> this is the Forth solution iirc
<Regenaxer> We should try the same in Lisp
<Regenaxer> hmm, rather not
<freemint> I had a use case for bin list to num recently
<Regenaxer> So modify the 'bin' function
<Regenaxer> can be easier, without sign
<freemint> i implemented by own adhoc solution back then (list (/ (& 8 HW) 8) (/ (& 4 HW) 4) (/ (& 2 HW) 2) (& HW 1)) it was not very perfomant but it was only need when creating a few onjects on startup
<Regenaxer> Shifts are probably better than divisions
<Regenaxer> And a loop makes it more flexible for the size
<freemint> but i do not know where to start loop i only know when to stop
<Regenaxer> like in 'bin'?
<freemint> I have not understood how bin solved that problem
<Regenaxer> in the first 'cond' clause
<Regenaxer> the sign stuff can be ignored
<Regenaxer> 'S'
<freemint> Can you explain the L and A part
<freemint> (or let me study a little)
<Regenaxer> (let (L (& 1 X) A (cons 0 I))
<Regenaxer> (until (=0 (setq X (>> 1 X)))
<Regenaxer> (push 'L (& 1 X)) ) )
<Regenaxer> That's the minimum
<Regenaxer> giving a list of 0 and 1
<Regenaxer> So you could also do something else
<Regenaxer> instead of building a list
<freemint> Why isn't the list in the wrong order?
<Regenaxer> because of 'push'
<freemint> ahh
<Regenaxer> starts from lowest bit
<freemint> of course
<Regenaxer> 'A' is also not needed
<freemint> A is for chopping into groups of blocks
<Regenaxer> right
<Regenaxer> (at A
<freemint> so much alien technology
<Regenaxer> Which part is alien?
<freemint> 'at it is self modifying code.
<Regenaxer> In this case not
<Regenaxer> it modifies the value of the variable A
<Regenaxer> (loop (msg (inc (0)))) *might* be called self modifying code, but I think it is *not*
<Regenaxer> the (0) is data, not code ;)
<Regenaxer> a kind of artificial distinction in picoLisp
<freemint> (de H () (at '(0 . 3) (prinl "bumm"))
<Regenaxer> same
<Regenaxer> (0 . 3) is *data*
<freemint> self modifying data?
<Regenaxer> the quote is not needed BTW
<Regenaxer> no, just normally modified data
<razzy> um, how do i save anonymous symbol to file, to reload it later by (read)? is there special function?
<razzy> or do i need to print everything about symbol, save it, and reaload with lots of pain
alexshendi has joined #picolisp
mtsd has quit [Quit: WeeChat 1.6]
orivej has joined #picolisp
<Regenaxer> razzy, yes, you need to save the value and the property list
shpx has joined #picolisp
<Regenaxer> or better use a database
<Regenaxer> Not much pain
<Regenaxer> (println (val Sym) (getl Sym))
<Regenaxer> (set Sym (read)) (putl Sym (read))
<Regenaxer> if no DB
<Regenaxer> But anyway, a DB is exactly for that
alexshendi has quit [Read error: Connection reset by peer]
<Regenaxer> お休み
shpx has quit [Ping timeout: 244 seconds]