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
shoshin has quit [Read error: Connection reset by peer]
shoshin has joined #picolisp
patrixl has quit [Quit: Leaving.]
patrixl has joined #picolisp
orivej has quit [Ping timeout: 260 seconds]
wineroots has joined #picolisp
jibanes has quit [Ping timeout: 246 seconds]
jibanes has joined #picolisp
aw- has joined #picolisp
aw- has quit [Remote host closed the connection]
aw- has joined #picolisp
<aw-> hmmm... seems the (pil) function doesn't exist in pil21
aw- has quit [Quit: Leaving.]
aw- has joined #picolisp
<Regenaxer> aw-, yes, (pil) is meaningless now
<Regenaxer> because (path) supports "~/.pil/..."
<Regenaxer> + Path names expand "~" for the HOME directory
<Regenaxer> - 'pil' is not needed
<Regenaxer> Found a bug in (read "_"), did not convert fixpoints according to *Scl
<aw-> ok thanks
orivej has joined #picolisp
mtsd has joined #picolisp
orivej has quit [Ping timeout: 272 seconds]
<Regenaxer> aw-, no big problem, right?
rob_w has joined #picolisp
<aw-> no i replaced with (tmp)
<aw-> that was the only code i have which uses (pil)
<Regenaxer> ah, ok, good
<Regenaxer> What I mean is (pil "foo") is the same as "~/.pil/foo", but 'pil' is expensive as it calls (sys "HOME") plus 'pack' etc. each time
<Regenaxer> pil21 now reads HOME at startup
<Regenaxer> and expands "~" like a shell
<Regenaxer> (and of course also "@" as before)
<Regenaxer> Much more consistent I believe
<aw-> i see
<aw-> in my code i was doing (pil "tmp" ...)
<aw-> not good
<Regenaxer> :)
michelp has quit [Read error: Connection reset by peer]
pointfree has quit [Ping timeout: 272 seconds]
michelp has joined #picolisp
pointfree has joined #picolisp
orivej has joined #picolisp
<tankf33der> Regenaxer: http://ix.io/2DDG
<tankf33der> this is demo code from picolisp tutorial
<tankf33der> i dont see Line 2 if i entering it.
<Regenaxer> Oh, this example is not correct
<Regenaxer> (+ 1 1) is a list, not an atom
<Regenaxer> yeah
<Regenaxer> has always been wrong :(
<Regenaxer> The HTML, SVG, PS and such functions have a rule
<Regenaxer> Atoms are printed directly, lists are *evaluated*
<Regenaxer> so it needs (prin (+ 1 1))
<Regenaxer> I think we had this issue recently
<Regenaxer> Was it in PilCon?
<tankf33der> i dont know
<tankf33der> i am just playing with tutorial
<Regenaxer> good
<Regenaxer> I did not put app.html into pil21
<Regenaxer> It needs a lot of reworking I think
<beneroth> Regenaxer, yeah we discussed "Atoms are printed directly, lists are *evaluated" during pilcon recently
<beneroth> not the last one, one before or so
<Regenaxer> Hi beneroth! Thanks for refreshing my memory! :)
<Regenaxer> I think Olaf asked for that
<beneroth> I think it's a good rule, also prevents accidental prints from any function calls
<beneroth> return values or such, I mean
<Regenaxer> right
<beneroth> is there a document describing all changes between pil64 and pil21? especially "breaking" changes like (arg) and (pil) ?
<Regenaxer> and automatic printing of atoms makes the code more readble, as many parts are just constant strings or numbers
<beneroth> T
<Regenaxer> yes, there is doc/diff
<beneroth> oh okay
<beneroth> the rolling release is still pil64? or you switched it to pil21 too?
<Regenaxer> and the parts in doc/ref?.html should be updated
<beneroth> ok
<Regenaxer> Not switched yet
<beneroth> kk
<Regenaxer> More testing
<Regenaxer> Then I ask also Kanru to change in Debian
<beneroth> I will stay on pil64 a bit longer. Also I'm still in a big project. Ones that calms down I will switch my development environment to pil21 I think
<beneroth> good :)
<Regenaxer> On production servers I also did not switch yet
<Regenaxer> only local development and testing
<beneroth> I'm also considering to keep using pil21 in the long term, if feasible, for servers I control (for the performance benefit, if there is one - I should measure)
<Regenaxer> good
<beneroth> could be worth it for horizontal scaling (many picolisp instances)
<Regenaxer> T
<beneroth> but yeah, needs to be actually benchmarked
<beneroth> oh I wanted to say pil64 in the last sentence xD
<beneroth> anyway xD
<Regenaxer> :)
<beneroth> db format didn't change, I got that right,correct?
<Regenaxer> yes
<Regenaxer> interchangeable
<beneroth> wunderbar.
<beneroth> yeah!
<Regenaxer> :)
aw- has quit [Quit: Leaving.]
aw- has joined #picolisp
<tankf33der> my test suite still running under gc+, third week soon.
<beneroth> impressive, tankf33der :)
<Regenaxer> wow
mtsd has quit [Quit: Leaving]
rob_w has quit [Quit: Leaving]
dexen has joined #picolisp
LamBaah has joined #picolisp
LamBaah has quit [Remote host closed the connection]
<Regenaxer> tankf33der, are you sure it does not hang?
<tankf33der> yes, i see progress
<Regenaxer> good
<dexen> i've tried using the native call function today and was blown away with how neatly it's designed
<Regenaxer> Glad to hear :)
<dexen> now i'm stuck - how do i allocate buffer & pass a pointer to it to readlink(const char *pathname, char *buf, size_t bufsiz); ?
<Regenaxer> There are 2 (in pil21 three) ways
<Regenaxer> But in this case the easiest is to let 'native' do it directly
<Regenaxer> (Buf (256))
<Regenaxer> to get the value as bytes, '(Buf (16 B . 256))
<Regenaxer> I would use 'buf' though
<Regenaxer> pil21 only
<Regenaxer> (buf Buf 256 (%@ "readlink" 'N "linkFile" Buf 3256) (struct Buf 'S))
<Regenaxer> I think the direct call is not so useful, as you get a list of bytes
<Regenaxer> oops, wrong size
<Regenaxer> I meant
<Regenaxer> (buf Buf 256 (%@ "readlink" 'N "linkFile" Buf 256) (struct Buf 'S))
<dexen> alright thank you, now i'm trying to grasp it :D
<dexen> don't think i have pil21 up and running yet, so i'm going with the Buf option
<Regenaxer> ok :)
<Regenaxer> ok, let me try
<Regenaxer> no to tell nonsense ;)
<Regenaxer> (use Buf (%@ "readlink" 'N "a" '(Buf (64 (B . 64))) 64) Buf)
<Regenaxer> this gives a list of bytes in the variable 'Buf'
<tankf33der> i gonna create slides for native usage.
<tankf33der> as tutorial.
<Regenaxer> Great idea tankf33der!
<Regenaxer> dexen, I strongly recommend pil21
<Regenaxer> easy to set up
<Regenaxer> Ok, here a complete example for direct buffer:
<Regenaxer> (use Buf (let Len (%@ "readlink" 'N "a" '(Buf (64 C . 64)) 64) (pack (head Len Buf]
<Regenaxer> Using (buf P ... (struct P 'S)) in pil21 is more clean I think
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
<dexen> great thank you
<dexen> incidentally, does native work with variadic functions like printf()?
<Regenaxer> yes, but with some limitation
<Regenaxer> We had a discussion in the mailing list a few days ago
<Regenaxer> It works basically, but if you call repeatedly you need to take care *not* to call it with more arguments than the first time, or
<Regenaxer> you take a fresh transient symbol at that time
<Regenaxer> (or every time)
<Regenaxer> The reason is that 'native' caches the signature (kind of)
<dexen> ah makes sense. also i was wondering about the overhead, so "caches signature" is a nice hint.
<Regenaxer> ok :)
<Regenaxer> Besides for printf() such functions are rare in my experience
<Regenaxer> (though in fact I had a project 25 years age which hat lots of varargs functions)
<dexen> it does feel like a little marvel of engineering - the concise handling of complex structures and whatnot
<Regenaxer> cause C is so flexible and supports lots of memory structures
Blukunfando has quit [Ping timeout: 264 seconds]
dexen has quit [Quit: Konversation terminated!]