beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
theruran has quit [Quit: Connection closed for inactivity]
rob_w has joined #picolisp
<pablo_escoberg> I'm getting some unexpected behavior trying to get vip to color parens.  I've never done any terminal coding, but I'm still getting unexpected behavior from `job`.  Code here:  https://pastebin.com/C84P1DtN (sorry, for some reason my ISP is blocking pb1n.de).  For some reason, the `job` is not maintaining its state properly.  Any idea what I'm
<pablo_escoberg> doing wrong?
<abu[7]> Hi pablo_escoberg! The 'job' setup looks Technically correct to me
<abu[7]> It pops Avail and pushes Used
<pablo_escoberg> and it works fine if I call it from the REPL.
<pablo_escoberg> it only screws up when it's called from `addLine` AFAICT
<abu[7]> Is it all in the 'vip' namespace?
<pablo_escoberg> yes, I copied the file and modified it directly
<abu[7]> You can put in .viprc
<abu[7]> or .pil/viprc
<pablo_escoberg> I was going to send you a diff to see if you wanted to include it.  If not, I would redefine `addLine` in viprc
<pablo_escoberg> but the problem right now is it's behaving unexpectedly
<abu[7]> I do not want highlighting as you know
<abu[7]> but an add-on is very good
<pablo_escoberg> OK, in that case you can consider the paste a .pilrc, with a `(symbols 'vip 'pico)` at the beginning.
<pablo_escoberg> pretty sure the behavior will be the same...
<abu[7]> I have no time atm, I'm sure you can debug it ;)
<pablo_escoberg> ok, thanks anyway
<abu[7]> ☺
<abu[7]> Could not resist and did a quick trace
<abu[7]> rainbow returns NIL most of the time
<abu[7]> better: http://pb1n.de/?fb2a97
<pablo_escoberg> :).  thanks, but I can't access pb1n.  Stupid thing from my ISP.
<abu[7]> It is because output may start anywhere, so the parens are not balanced
<abu[7]> oh
<pablo_escoberg> but what do you mean the parens are not balanced?  Wouldn't that give an error?
<abu[7]> I did: ("(" (and Avail (push 'Used (++ Avail))))
<abu[7]> (")" (and Used (push 'Avail (++ Used))))
<pablo_escoberg> makes sense
<abu[7]> Otherwise it pushes lots of NILs
<pablo_escoberg> right, but that doesn't explain the behavior
<abu[7]> I did (trace 'rainbow) after (load ...) in Vip
<abu[7]> Debugging directly in Vip
<pablo_escoberg> I haven't really used `trace` at all, so the output is a bit foreign to me, but could provide a clue
<abu[7]> Yeah, trace is perhaps the most useful of the debug functions
<tankf33der> hi all
<pablo_escoberg> damn!  I'll have to look into it more.
<pablo_escoberg> hi tankf33der
<tankf33der> trying pil21 on new llvm19 snapshot
<abu[7]> Hi tankf33der!
<abu[7]> 👍
<abu[7]> Do you think anything critical changed with 19?
<tankf33der> works.
<abu[7]> very
<tankf33der> i just testing time to time to be sure
<abu[7]> ood
<abu[7]> oops
<abu[7]> Very good ☺
<tankf33der> :)
<abu[7]> Why might pb1n not work for pablo_escoberg?
<tankf33der> pablo_escoberg: do you work from Russia ?
<pablo_escoberg> nope, USA
<tankf33der> server in Germany, all opened.
<pablo_escoberg> it's eero, which my ISP uses.
<pablo_escoberg> I could report it, but I'm sure nobody reads the reports...
<tankf33der> :)
<tankf33der> do you have ipv6 ?
<tankf33der> server hash
<tankf33der> server has
<pablo_escoberg> nope, just ip4.  no idea how pb1n ended up on the blocklist, but it did
<pablo_escoberg> if you want to harass them, the email address for reports is blocked@eero.com
<pablo_escoberg> I strongly suspect it goes directly to /dev/null, but I guess I could be wrong.
<tankf33der> try pulsar.pb1n.de
<tankf33der> the same ?
<tankf33der> its Finland
<pablo_escoberg> yup, same
<pablo_escoberg> i assume it's a dns block...
<tankf33der> dns resolution works ?
<pablo_escoberg> pretty sure there is nothing you can do on your end expect bug them...
<pablo_escoberg> interestingly, when I ping it, I'm getting the ip6 address
<pablo_escoberg> and it pings correctly
<pablo_escoberg> dig pb1n.de
<pablo_escoberg> ; <<>> DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu <<>> pb1n.de
<pablo_escoberg> ;; global options: +cmd
<pablo_escoberg> ;; Got answer:
<pablo_escoberg> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21091
<pablo_escoberg> ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
<pablo_escoberg> ;; OPT PSEUDOSECTION:
<pablo_escoberg> ; EDNS: version: 0, flags:; udp: 65494
<pablo_escoberg> ;; QUESTION SECTION:
<pablo_escoberg> ;pb1n.de.            IN    A
<pablo_escoberg> ;; ANSWER SECTION:
<pablo_escoberg> pb1n.de.        30    IN    A    192.168.4.1
<pablo_escoberg> ;; Query time: 16 msec
<pablo_escoberg> ;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
<pablo_escoberg> ;; WHEN: Mon Jun 10 01:27:29 PDT 2024
<pablo_escoberg> ;; MSG SIZE  rcvd: 52
<pablo_escoberg> which is weird
<pablo_escoberg> I can access it by ip directly
<pablo_escoberg> so it is definitely a dns block
<pablo_escoberg> 5.45.104.89
<pablo_escoberg> but I can't get that through nslookup or dig
<tankf33der> so now you have a topic what to ask ISP
<pablo_escoberg> If there was anyone to talk to, sure :)
<tankf33der> change dns server
<pablo_escoberg> good idea.  hang on
<tankf33der> 1.1.1.1
<tankf33der> good start point
<pablo_escoberg> ok, I'm kind of out of the loop.  I changed my resolv.conf file, but I'm still getting the same thing.  Do I need to restart a particular service? (I'm on Linux Mint, sadly)
<tankf33der> unknown
<tankf33der> ping 1.1.1.1 works ?
<pablo_escoberg> yup.
<pablo_escoberg> probably need to restart, which I'll do tomorrow.  I'll lyk
<tankf33der> after restart dns servers could be rewritten back to default
<tankf33der> by dhcp for example
<pablo_escoberg> well, I overwrote the resolv.conf symlink with a static file, which is what the instructions said.  And it looks like I'll actually be restarting in a few minutes (upgrade going on right now), so I'll lyk sooner rather than later.
<tankf33der> ok
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
<pablo_escoberg> This is really strange.  It didn't work!  The resolv.conf file says `nameserver 1.1.1.1` and nothing else.  yet I still get the eero blocked screen when I try to go pb1n.de.  It must be hijacking DNS somehow.  I need to look into it.
fuxoft has joined #picolisp
<fuxoft> So, about those coroutines in PicoLisp:
<fuxoft> My coroutines are endless loops, so they are always "running" and never naturally end.
<abu[7]> OK
<fuxoft> Unless they are explicitly killed using (co 'tag), they will keep "running" and occupying memory.
<abu[7]> Only stack
<abu[7]> primarily
<fuxoft> There is no way to make the coroutine a part of some local environment for them to be stopped and destroyed automatically when the local environment gets out of scope?
<abu[7]> Indirectly also heap for data referred from this stack
<abu[7]> There it no env here going out of scope
<abu[7]> except the stack segment
<abu[7]> and the segment holds the running routine
<fuxoft> I am probably not making myself clear enough...
<abu[7]> There is no way for the interpreter to know that you will not yield it later
<abu[7]> A coroutine is an independent running context
<fuxoft> Let's say I define a function foo. Calling this function creates a coroutine caller 'coro which infinitely yields data. After doing this, the same function (still during the same call) collects exactly 999 pieces of data from the (infinitely running) coroutine and then the function returns.
<abu[7]> Good
<fuxoft> There is no way for the 'coro coroutine automatically stopped and destroyed when foo returns?
<abu[7]> Right
<abu[7]> foo might be called later again, who knows?
<abu[7]> Is it a problem to stop it at the end of poo?
<fuxoft> Yes. But if it would be called again, I'd expect it to create a new coroutine that starts generating fresh data, that's the intended functionality
<abu[7]> This is the case
<abu[7]> (de foo ... (co 'a ...) ... (co 'a))
<abu[7]> Will start 'a' each time
<fuxoft> Is it? From the docs I'd think that when calling "foo" again, the original coroutine would CONTINUE producing the data it was already producing, not starting anew. There is no "kill coroutine" command anywhere in this scenario...?
<fuxoft> I thought (co 'a ...) just continues running the (already existing) coroutine 'a
<abu[7]> Yes, but (co 'a) stops it
<abu[7]> i.e. no body
<fuxoft> Oh yes, I read that wrong. Correct.
<fuxoft> Great.
<fuxoft> I understand this, I think.
<abu[7]> ☺
<abu[7]> I think garbage collection is secondary here
<fuxoft> But my problem is that (co 'a) is being fed data from (co 'b), which is being fed data by (co 'c) etc... And 'c does not know anything about 'a or vice-versa
<abu[7]> gc only cleans up
<abu[7]> I see
<abu[7]> It is a flow control issue, not gc
<fuxoft> Yes, true. My terminology is not correct.
<abu[7]> or philosophy of gc in different langs
<abu[7]> Hmm
<abu[7]> Nasty
<abu[7]> Perhaps have each co push itself into a global?
<fuxoft> In Lua and Janet, the coroutine is an object which can be assigned to a local variable. When the variable goes out of scope, the relevant coroutine ios automatically stopped and destroyed without me having to do anything. This correctly cascades down the chain of coroutines.
<fuxoft> Yeah, I can probably do it SOMEHOW, I just wanted to make sure that I am not missing some simple solution...
<abu[7]> I understood the way of those
<abu[7]> Perhaps:
<abu[7]> (co 'a (push '*SomeVar (co)) ...
<abu[7]> then at the end:
<abu[7]> (mapc co *SomeVar)
<abu[7]> and (off SomeVar)
<abu[7]> Kind of ugly ;)
<fuxoft> In reality, it's more complex in my project. More than a chain, it's a TREE of coroutines, with several coroutines "feeding" their parent... And I need a way to kill just a "branch" of coroutine and all its sub-coroutines
<abu[7]> I see
<fuxoft> Anyway, what happens when I use an integer as a coroutine tag? Can I do that? It doesn't seem to produce an error.
<tankf33der> Did you discussed version of picolisp?
<fuxoft> Yes that was me, some time ago. Now I have the latest version
<abu[7]> Yes, this is fine, just make it slower if there are *very* many coroutines
<fuxoft> Unfortunately I am not receiving ANY emails from picolisp mailing list so I have to discuss exclusively here...
<tankf33der> The same issue? :/
<abu[7]> This mail problem is nasty too
<abu[7]> I have no idea
<fuxoft> Yeah. I've tried to subscribe three times and I have received ZERO emails from picolisp list so far. Nothing in my Spam folder and no error reports from my email forwarder (ForwardEmail.net)
<abu[7]> There is no error for your email in the logs
<fuxoft> No. I see detailed log reports from various spammers etc. but zero reports about emails from Picolisp list. Is it possible that the list handler has some wrongly cached very old DNS information? I have changed my MX records several months ago.
<fuxoft> For my domain fuxoft.cz.
<fuxoft> Sorry I have to go now. Thanks for all your help.
fuxoft has quit [Quit: Client closed]
<abu[7]> Hmm, the adresses he registered are strange
<abu[7]> Too bad he lefr
<abu[7]> left
<abu[7]> This must be somehow the problem
<abu[7]> He is registered twice, e.g.
<abu[7]> srs0=7ba3=nm=fuxoft.cz=fuka@fe-bounces.fuxoft.cz
<abu[7]> That's not a legal address
<abu[7]> Or is it?
<abu[7]> The othes address is
<abu[7]> srs0=6a58=nf=fuxoft.cz=fuka@fe-bounces.fuxoft.cz
<tankf33der> try online
<tankf33der> email is valid but risky
<tankf33der> read yourself
<abu[7]> ok
<abu[7]> In any case, where does that address come from?
<tankf33der> unknown, but definitely from him
<abu[7]> Let's wait until he shows up
<abu[7]> Also to discuss his co problem
<tankf33der> and i would like to see his code
<tankf33der> i did not got problems on newer version of pil
<tankf33der> pil21
<abu[7]> I think he needs to send a message to the children
<abu[7]> It is not a pil problem
<abu[7]> but of how to stop his coroutines
<abu[7]> It is a tree of co's
<abu[7]> and each knows only it's direct children
<abu[7]> So they must be stopped recursively
<tankf33der> about his email format
<abu[7]> uh
<abu[7]> SRS
<tankf33der> chatgpt helped :)
<abu[7]> 👍
<abu[7]> A better solution is perhaps not to stop the coroutines at all, but to send a message at startup to re-initialize them.
<tankf33der> what is code ?
<abu[7]> No idea, haven't seen
<tankf33der> ok :)
<abu[7]> Only saw mail and here
beneroth has joined #picolisp
<tankf33der> afk
fuxoft has joined #picolisp
<fuxoft> Hello, I am back.
<fuxoft> First the email problem: I was registering by clicking the link on Picolisp site, which opened my GMail with prepared e-mail. I've just clicked "SEND".
<abu[7]> H
<abu[7]> Hi
<abu[7]> Can you read this log?
<fuxoft> Yes
<abu[7]> Good
<abu[7]> So it is your client which produces the addresses?
msavoritias has joined #picolisp
<fuxoft> I am using GMail and when I look at the headers of the sent email, they look perfectly OK, no garbage
<abu[7]> Hmm, email in general is a mess ;(
<fuxoft> "fuka@fe-bounces.fuxoft.cz" looks like something that my SMTP server (ForwardEmail.net) is adding by itself. I don't have anything like that in my GMail or ForwardEmail settings.
<fuxoft> I am using GMail web interface with ForwardEmail as SMTP.
<fuxoft> Can I see that gibberish address somewhere in the archive so that I can contact ForwardEmail about it? It's shown as my sender address??
<abu[7]> I posted here
<fuxoft> Yeah, I see that, but I have no context where in my headers that appears, exactly. Is that shown as my sender address??
<abu[7]> I see it only in the file that has all subscribed members
<fuxoft> OK, I will keep experimenting.
<fuxoft> When I send "Subscribe" to the list, am I supposed to immediately receive a confirmation email? That would make my experimenting easier.
<abu[7]> Can you send a test mail to me?
<abu[7]> abu@software-lab.de
<fuxoft> Yes, right away
<beneroth> or to me: support@itship.ch
<beneroth> sounds weird
<beneroth> sounds like your email server replaces your email with another one when sending an email?
<abu[7]> I think you get the "subscribed" mail back I think
<fuxoft> OK, sent to itship.ch also.
<fuxoft> I am certainly sending and receiving several emails each day and this problem is new to me.
<abu[7]> Does this give any hint: http://pb1n.de/?772ec0
<fuxoft> The "From:" field is correct (fuka@fuxoft.cz). I have no idea what "X-Envelope-From:" means. I certainly didn't put it there intentionally.
<abu[7]> T
<abu[7]> Sorry, meeting, bbl
<fuxoft> From my Googling, this looks like mailing list software problem. It should use the "From:" field and should not care about "X-Envelope-From:" field. There are various legitimate reasons for these two to be different.
<beneroth> Return-Path: <SRS0=8740=NN=fuxoft.cz=fuka@fe-bounces.fuxoft.cz>
<beneroth> "The Return-Path header is used to indicate to the recipient (or receiving MTA) where non-delivery receipts are to be sent."
<beneroth> so looks correct
<beneroth> question is why some email go to your bounce address when they should not?
<fuxoft> But why is this address listed as my e-mail address in abu's database at all? It should list my "From:" address, which appears to be correct in my emails.
<beneroth> X-Envelope-From is added by some email server in between, most likely your origin MTA. copy of Return-Path would be okay.
<beneroth> yeah, agreed.
<beneroth> abu[7], bug in the parser of the mailing list?
<beneroth> if it simply uses (from "From:") then it might end up picking the wrong header, depending on the order of headers (which is unordered by definition, I believe)
<abu[7]> done
<abu[7]> Yeah, seems the wrong "From:"
<abu[7]> No
<abu[7]> it assumes that the *first* line has "From <addr>"
<abu[7]> This is the script I use all the years: https://software-lab.de/mailing.tgz
<abu[7]> What I posded above is what I see here in mutt, not what the script receives via fetchmail
<abu[7]> It must be that the first line has that garbage
<beneroth> you refer to "From u0_a16 Mon Jun 10 15:02:01 2024" which is not an email header. must be added by fetchmail
<abu[7]> This is here locally in Termux
<abu[7]> Not relevant
<beneroth> (case (pack (car L))
<beneroth> ("From:" (setq *Src *Line))
<abu[7]> I'n not talking about email headers
<abu[7]> It is an mbox format
<beneroth> that seems correct to me, cannot mix it up with X-Envelope-From
<beneroth> yeah the initial from your scrip looks for is mbox format. not from the original email source.
<abu[7]> (setq *From is from that first line
<beneroth> ja. and only *From is used to check for membership.
<abu[7]> T
<beneroth> not *Src which comes from the *From header and which is used to then send the email and set reply-to
<beneroth> and that *From comes from mbox format
<beneroth> not email header
<beneroth> so how is *From determined in the processing before your script comes into play?
<abu[7]> But the messy address is member
<beneroth> yep
<beneroth> so probably Return-Path ended up in the initial From line (the mbox initial line, not from email header)
<beneroth> or X-Envelope-From
<abu[7]> I wonder if many people have that problem
<beneroth> if this is the issue, then the bug is that your script assumes a certain behavior from the preprocessing which is not reliable
<abu[7]> Yeah
<beneroth> most email senders don't set a Return-Path different from From header, I think. This is primarily for automatic emails and newsletters and such.
<abu[7]> Let's all switch to Matrix ;)
<abu[7]> Not perfect
<beneroth> email is still better
<tankf33der> better
<beneroth> matrix is a huge mess, I find.
<beneroth> which do you find better, tankf33der ?
<abu[7]> I dont think so
<beneroth> have you implemented a client in pil yet?
<tankf33der> switch to matrix will kill community finally
<beneroth> you have for IRC and email, no problem.
<abu[7]> Not yet
<abu[7]> IRC is even better, true
<beneroth> tankf33der, could be worse. we could switch from IRC to discord xD
<tankf33der> or zulip
<abu[7]> Most can use only email
<beneroth> keep it simple and functional
<beneroth> email and IRC
<beneroth> everyone can use IRC, people just don't know it anymore.
<abu[7]> IRC is simple, mail not so
<tankf33der> switch to https://lists.sr.ht/
<tankf33der> ?
<abu[7]> Then all need to switch, may be hard
<tankf33der> switch to another ML soft?
<beneroth> what is the issue? lets fix the bug in the script.
<tankf33der> ok
<beneroth> or use another ML. I'm happy to host it.
<abu[7]> What is the best way?
<abu[7]> Would the list address change then?
<beneroth> I would recommend: lets fix the script, and see if that fixes all problems. Else lets pick a ML software and I setup hosting for it.
<beneroth> abu[7], you decide
<abu[7]> I mean, another address would be difficult to communicate
<abu[7]> And I don't know atm what is the right fix
<beneroth> yep. I think we could switch without needing to change that.
<beneroth> abu[7], ?
<beneroth> don't rely on that initial From line from Mbox?
<abu[7]> OK for me
<beneroth> why don't use the *From header for membership registering/membership check instead of the mbox From?
<abu[7]> Set *From from another header field?
<abu[7]> I'm afraid it will break at another place then ;)
<tankf33der> tankf33der is checking hard http://pb1n.de/?772ec0
<beneroth> *From is not set from any header field. it's set from the mbox terminator line
<abu[7]> Rigct
<abu[7]> We have
<abu[7]> From: "=?UTF-8?Q?Franti=C5=A1ek_Fuka?=" <fuka@fuxoft.cz>
<beneroth> fuxoft, abu[7] what was the initial problem again? because the newest picolisp mailing list emails from/to fuxoft are correct, no?
<tankf33der> but first line is: From u0_a16 Mon Jun 10 15:02:01 2024
<beneroth> abu[7], you have it in *Src
<abu[7]> He does not receive any mails
<beneroth> tankf33der, yep thats the mbox separator line. https://datatracker.ietf.org/doc/html/rfc4155
<beneroth> abu[7], so he didn't receive the emails I received today from picolisp ML (10:42, 10:56, 12:09 CET) ?
<abu[7]> T
<abu[7]> No mails at all it seems
<beneroth> fuxoft, what about spam folder?
<beneroth> wait
<beneroth> fuxoft is using google, aye?
<beneroth> abu[7], do you have DMARC and DKIM set up?
<abu[7]> No idea
<abu[7]> At the provider?
<beneroth> google and yahoo require bulk senders (5k or more messages) to have DMARC set up
<beneroth> yes, in DNS of your domain
<abu[7]> I have no control, it is at Strato
<beneroth> no control over DNS?
<beneroth> DMARC is not set up, might be that
<abu[7]> I have just some webspace and emails
<beneroth> how did you get to the "fuka@fe-bounces.fuxoft.cz" topic? just because it looked funny in the mail source?
<beneroth> the picolisp ML entry is the correct email it seems, no?
<abu[7]> He is registered as srs0=7ba3=nm=fuxoft.cz=fuka@fe-bounces.fuxoft.cz
<abu[7]> and another similar one
<abu[7]> The mails are accepted
<beneroth> ok, so it is registered wrongly, probably because of the mbox terminator
<beneroth> yeah
<abu[7]> And relayed back to srs0=7ba3=nm=fuxoft.cz=fuka@fe-bounces.fuxoft.cz
<abu[7]> So this relaying gets lost
<beneroth> so it's a mix of funky email forwarder and the mailing list taking it from mbox taking sender from X-Envelope-From or Return-Path header instead of From or Sender header.
<beneroth> abu[7], so technically, it's his end :P
<abu[7]> Perhaps the utf8 chars are a problem somewhere?
<beneroth> I don't think so
<abu[7]> "=?UTF-8?Q?Franti=C5=A1ek_Fuka?="
<beneroth> that's similar format than UTF-8 encoding of Subject line
<abu[7]> Yeah
<beneroth> because email headers are not UTF-8 in standard
<abu[7]> properly encoded
<beneroth> in the From header it's just his display name in front of the actual email address
<beneroth> it's correct
<abu[7]> ok
<beneroth> fuxoft should have a way to access his bounce emails
<abu[7]> fuxoft: How about trying some webmail access to your accout?
<beneroth> abu[7], cannot you manually correct his registered address for now?
<abu[7]> Yes
<beneroth> lets do that, as a first step
<abu[7]> but then his mails will not be accepted
<abu[7]> I *add* it
<beneroth> second step, lets try to find the exact cause and/or update your ML script to prevent that situation in the future. As I see it, nothing is wrong with your ML per se, it is just that fuxoft ends up registered with an email he cannot receive.
<beneroth> abu[7], what if both are present?
<beneroth> technically the check should pass, even when the check is not exactly correct, in a sense xD
<abu[7]> No problem, it will be even 3 ther
<abu[7]> then*
<beneroth> maybe this solves the problem at hand for now
<beneroth> middle-term we should improve the ML script and get DMARC entry into the DNS
<beneroth> we can do this together within next days or so
<beneroth> ok?
<abu[7]> I add fuka@fuxoft.cz
<abu[7]> I don't find any other such messy entries
<abu[7]> Done
<fuxoft> Great, thanks.
<abu[7]> Now we have 3 entries
<fuxoft> Because I am unable to reply to mailing list thread, I will send a new email later, with detailed explanation of what I am trying to achieve with those coroutines and why.
<fuxoft> Or is it preferable to use IRC or Matrix?
<tankf33der> fuxoft: will you show a code ?
<abu[7]> I send a test mail
<abu[7]> fuxoft, I think the solution is *not* to stop the coroutinec
<abu[7]> but 'yield' a message to them
<fuxoft> That wouldn't work because there are several NEW, different coroutines generated every second, the "tree" is constantly being changed.
<fuxoft> And most of them just generate data (audio waveforms) as quickly as possible, without checking for any conditions.
<abu[7]> This gives infinitely many routines?
<fuxoft> No email so far.
<fuxoft> I will have to leave for a while...
<abu[7]> Takes a few mins
<beneroth> cu later fuxoft :)
<abu[7]> ☺/
<tankf33der> afk
<abu[7]> cu tankf33der
<beneroth> cu tankf33der o/
<beneroth> abu[7], I received your testemail
<abu[7]> me too
<abu[7]> Let's see if fuxoft got it
geri has joined #picolisp
rob_w has quit [Remote host closed the connection]
<geri> hey, is there any need for unit testing frameworks in pil?
<geri> cause dynamic binding lets you override a lot more than lexical
<abu[7]> tankf33der has a big test suite
<geri> there may be a problem with overriding functions that depend on a lot of other functions though, because all "child" functions will get their insides overriden too...
<abu[7]> Yeah, testing is an art
<abu[7]> Built in is only pil lib/test.l -bye +
<geri> m?
<beneroth> insofar as unit test make sense at all, I think picolisp makes it quite easy to do testing, because mock-up is so easy to set up.
<geri> i know about test and assert
<geri> yeah, that
<geri> seems way less needed to have a framework for that
<beneroth> T. a framework would require some assumptions about your program or its software design. I think this is also hard with Lisp being much more free-form
<abu[7]> I always "forget" to set up tests
<beneroth> so I guess most people tend to make an testing "framework" tailored to their program and needs
<geri> yeah im more comparing it to js or python unit testing stuff
<geri> abu[7]: forgetful!
<geri> i tend not to write tests but i mostly write crap so my opinion doesnt matter
<beneroth> abu[7] I write a test.l for library implementations, e.g. my own protocol or parser implementations. but the end-user applications are anyway tested when in use, and also repeatedly during development before changing production.
<geri> oh btw, what's a picolisp alternative to 'exec program &' in sh?
<beneroth> geri, my opinion is that some js/java/python guys like to write tests.. or even do "test-driven-development".. I think it's crap, same as static typing, it only catches the easy-to-catch bugs. The hard bugs come from integration of multiple software pieces, unexpected input or unexpected networking issues.
<beneroth> geri, exec alternative: (call)
<beneroth> or, if you need to write/read stdin/stdout of the program, or both: (out 'lst ...) / (in 'lst ...) / (pipe ...)
<geri> i need to replace current program and send it to background
<beneroth> testing: in the end no automation or way of working can replace developers who thinks disciplined about all possible cases.
<abu[7]> 5
<abu[7]> (pipe (exec
<beneroth> often it is also forgotten to test the stuff which should not work. bad inputs and illegal actions must be tested too. not only the nice good cases.
<beneroth> geri, ah then exec
<abu[7]> (pipe (exec "@bin/ssl" Host
<geri> but program will still be in foreground...
<geri> im calling a video player from shell and dont want it blocking anything
<abu[7]> It runs in background
<geri> hm
<abu[7]> pipe returns an fd
<abu[7]> I use that often with 'task'
<beneroth> you're talking about a program you start in foregrond, which should switch to background and exec something else?
<geri> start in foreground, then exec something else and put everything into background, basically returning from original script instantly
<abu[7]> e.g. from the mailing list
<abu[7]> (setq *Sock (pipe (exec "@bin/ssl" *SmtpHost *SmtpPort)))
<abu[7]> Then read/write
<abu[7]> or (task *Sock ...
<beneroth> abu[7], I think he is not talking about the exec'ed program to run in background, but his own program which was not started in background
<abu[7]> So (unless (fork) (loop ...
<abu[7]> Minimal background process
<fuxoft> The email from abu arrived OK
<geri> i call my script from bash - it opens mpv in background with whatever i passed it and script exists immediately
<abu[7]> 👍
<abu[7]> Can you try the above fork?
<geri> what's the loop for?
<beneroth> placeholder for your forked program
<abu[7]> T
<beneroth> so you could try (unless (fork) (exec ...))
<geri> its still in foreground
<geri> and doesnt exit, because forked
<geri> exec prog & is magical i guess :D
<beneroth> can you show your code?
<abu[7]> This works: http://pb1n.de/?4cc005
<beneroth> there is no magic. magic thinking is a curse in IT. it's all deterministic and man-made.
<beneroth> good example abu[7] :)
<abu[7]> Better: http://pb1n.de/?2bedf1
<abu[7]> It should terminate :)
<geri> okay that better one seems like it, let me plug my stuff in
<geri> okay seems good, just need to discard all output
<geri> (err '/dev/null (out '/dev/null (exec ...)))?
<abu[7]> Yay
<abu[7]> I would (err "/dev/null" to avoid interning a symbol
<abu[7]> (out will not help here
<abu[7]> It does not redirect stdout
<geri> doesnt it?
<abu[7]> No, it is the current output channel
<abu[7]> You could use 'pipe'
<abu[7]> it redirects stdout and stdin
<geri> hmm
<abu[7]> (pipe (exec ...) (out "/dev/null" (echo]
<abu[7]> to awoid a SIGPIPE
<geri> awoo
<abu[7]> If the exec'd process writes a lot
<abu[7]> more than PIPEBUE bytes
<abu[7]> PIPEBUF iirc
<abu[7]> or PTPE_BUF ?
<geri> who knows :D
<geri> pil is the first language i know of that actually comes with a text editor for itself
<geri> but apparently it used to be popular at some point
<geri> idk where ive heard that
<bjorkintosh> geri: well, forth also tends to. it's not a good editor, but it's there.
<bjorkintosh> another one, elisp. it comes with a famous text editor.
<bjorkintosh> mit-scheme, comes with edwin
<abu[7]> Ah, cool! Forth "screen" editor!
<abu[7]> I used one for years
<bjorkintosh> cmucl as well comes with hemlock.
<bjorkintosh> all smalltalks come with something resembling a text editor.
<fuxoft> In Smalltalk, that's their whole IDE.
<bjorkintosh> 'xactly.
<geri> bjorkintosh: im using the elisp one and thats a fun comparison :D
<bjorkintosh> hahaha
<bjorkintosh> you've had one all along!
<geri> i wonder which is more powerful
<geri> an editor with a full language or a full language with an editor
<geri> also i just recently found out that cmake's logo is very similar to picolisp's
<geri> pil is the older one
<bjorkintosh> none are as powerful as a language which gives you something close to a spreadsheet for at least viewing tabular data.
<bjorkintosh> tables are arguably as old as written numbers, yet most programming languages make you jump through incredible hoops just to display such data.
<geri> what language are you implicitly talking about
<bjorkintosh> almost all of them.
<bjorkintosh> with a handful of exceptions.
<geri> i meant the exceptions
<geri> :D
<bjorkintosh> R. Apl. Sqlite.
<geri> i mean
<geri> cant you implement table printing in any language?
<bjorkintosh> tables (or maps if you will) are a rather fundamental ADT
<bjorkintosh> geri: yes. of course. printf exists for that purpose.
<geri> ADT?
<bjorkintosh> but a gui requires a library.
<bjorkintosh> ADT: Abstract Data Type.
<geri> ah
<bjorkintosh> array? It's a map (or table). Dictionary? It's a map. Map? It's a map.
<bjorkintosh> function? why yes, they're maps (or tables) too.
<geri> like lua tables?
<bjorkintosh> quite similar yes.
<bjorkintosh> dictionaries too. a lot can be done with just that one concept?
<bjorkintosh> the very idea of random access memory is a tabular description of hardware memory. you have addresses and contents of those addresses.
<bjorkintosh> from that, pretty much most (if not all) datastructures are variations on that theme.
<bjorkintosh> logical functions? well, you get a table. simplest ones being buffer, and negation.
<geri> variable lookup is usually using hash maps
<bjorkintosh> and map is a synonym for table.
<bjorkintosh> table == map == table == map ad nauseum.
<geri> and table is a synonym for dictionary
<geri> :)
<bjorkintosh> you get it.
<geri> B)
<geri> bash calls them associative arrays
<bjorkintosh> yep. what's an array for starters? an indexed table.
<geri> actually
<geri> if we look at it from low level(er) implementation standpoint
<geri> it should be all arrays
<geri> hash maps are just arrays with some wrapping magic
<bjorkintosh> yes.
<geri> posix sh has an array btw, did you know :)
<bjorkintosh> I did'nt, since I don't use it. but it's relatively easy to implement.
<geri> a whole one
<geri> XD
<geri> it's $@
<geri> (insert obligatory "ew thats not lisp" comment)
<bjorkintosh> oh yeah.
<geri> i find it funny that you put a dot at the end of each sentence but dont bother to capitalize them properly
<geri> :D
<bjorkintosh> haha.
<bjorkintosh> oops.
<geri> abu[7]: is `bind' just an evaluating let?
<abu[7]> Yes
<geri> good to know
<fuxoft> Hmmm, I've sent a message to the mailing list about a hour ago, with subject "Auto-destroying coroutines" and I don't see it appearing at https://www.mail-archive.com/picolisp@software-lab.de/maillist.html yet...
<abu[7]> Oh! I also did not get it
<fuxoft> So that's worse situation than before. At least my previous emails were seen by other list members... :)
<abu[7]> Now I see in the log "srs0=8740=nn=fuxoft.cz=fuka@fe-bounces.fuxoft.cz" discarded
<abu[7]> This is a new address
<abu[7]> Not a registered one :(
<abu[7]> It is a different problem
<fuxoft> These seem to keep changing all the time...
<abu[7]> T
<abu[7]> Don't you have webmail access to that account?
<fuxoft> Is it a problem patching the maillist script to get the email address form the "From:" field and not from anywhere else, ever? Otherwise the problems will never stop.
<fuxoft> Or should I just completely move over to IRC or Matrix? Is that preferable? I don't mind, if the online archive is available.
<abu[7]> I think IRC is better anyway for such discussions
<abu[7]> Life ☺
<geri> life :)
<abu[7]> The mailing list has much less traffic
<abu[7]> Most interesting stuff we had here
<abu[7]> also bug reports and fixes
<fuxoft> OK!
<fuxoft> So here is the whole e-mail with explanation of what I am trying to achieve and Janet code: https://gist.github.com/fuxoft/9e70b3ba61d2b640712b188b936df55a
<abu[7]> Good
<abu[7]> I will remove the two messy addresses from the list, ok? You stay registered as "fuka@fuxoft.cz"
<fuxoft> Of course.
<abu[7]> ok
<abu[7]> reading ... interesting project!
<abu[7]> The "controller" can be main routine in pil, right?
<abu[7]> No, there are several controllers
fuxoft_ has joined #picolisp
fuxoft has quit [Quit: Client closed]
fuxoft_ is now known as fuxoft
<geri> how bad of an idea does this sound?
<abu[7]> Why do you use pattern variables?
<geri> cause it used to use a macro
<geri> just removed
<geri> (let + macro)
<abu[7]> fuxoft, I think I would define some convention to 'yield' some value to a coroutine to tell it to stop
<abu[7]> Then each routine only keeps track of its children
<abu[7]> It maps 'co' to the list when it is done
<abu[7]> So they are all recursively stopped
<fuxoft> How can I yield a value TO the coroutine?
<abu[7]> (yield 'coA "value")
<abu[7]> Oops
<abu[7]> (yield "value" 'coA)
<geri> is there a completion hotkey in vip?
<geri> like tab in repl
fuxoft16 has joined #picolisp
<abu[7]> geri, yes
<abu[7]> Tab
<geri> wth XD
<geri> didnt expect it
<abu[7]> It completes symbols and files
<abu[7]> depending on context
<fuxoft16> But some of my coroutines have severak (yields) in them, e.g. "first gradually increase from 0 to 1 and then keep sending 1 infinitely". In this solution, I'd have to check for those special commands after every yield, which is exactly the complexity I wanted to avoid.
<fuxoft16> *several
<geri> is there a difference between (cons 'X) and (list 'X) for one element?
<abu[7]> I think it is easy. The DES library makes use of this iirc
<abu[7]> (cons 'X) and (list 'X) are completely equivalent
<fuxoft16> ...or maybe I don't quite understand how (yield) with two arguments work, I have to look at it closer...
<abu[7]> (list ) is perhaps a little faster
fuxoft has left #picolisp [#picolisp]
fuxoft16 has quit [Client Quit]
fuxoft has joined #picolisp
<abu[7]> I make a simple example
<geri> there
<abu[7]> You don't need (cons 'prog (cdr Args))) if you use (de wc (Var . Prg)
fuxoft has left #picolisp [#picolisp]
<abu[7]> Then (run Prg)
fuxoft82 has joined #picolisp
<geri> i dont want to eval Var though
<abu[7]> I don't understand the purpose of wc
<geri> with chop :D
fuxoft82 is now known as fuxoft_
<geri> basically just makes you not need to chop stuff multiple times in the body?
<abu[7]> (de wc Arg ... (run (fdr Arg))
<geri> cdr*?
<geri> yeah thats probably better
<abu[7]> yep ☺
<abu[7]> fuxoft_: unsable net?
<geri> its basically just a (arguably bad) abstraction over (pack (fun (chop Var)))
<fuxoft_> If I did that, I'd have to add to every (yield) in my coroutine the test whether it rerturned "bye" and act accordingly. So this was the complexity I was trying to avoid.
<abu[7]> unstable*
<fuxoft_> Net is OK but I've installed IRC client onto my phone and now it's clashing with my webchat...
<abu[7]> You can abstract it into a single function
fuxoft has joined #picolisp
<abu[7]> yield and then throw
<abu[7]> You call that fun everywhere instead of yield
<fuxoft_> Yeah, I'll have to test how much it will slow everything down. Thanks
<geri> okay, enough of useless lil functions for today, going to bed
<geri> have fun
<abu[7]> Killing from the parent directly is possible, but the problem
fuxoft is now known as fuxoft_mobile
<abu[7]> is that it does not recurse
fuxoft_ is now known as fuxoft
<fuxoft> Yeah.
<abu[7]> ie the child does not notice and will not kill *it's* children
geri has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.3)]
<fuxoft> Exactly. And still it's not quite as elegant as my previous attempts where I don't even have to explicitly kill any coroutine, it gets done transparently when they go out of scope.
<fuxoft> I am just in the wrong mindset, I will try approaching the whole thing differently in PicoLisp
<abu[7]> Yeah, scope has a different meaning here
<fuxoft> On another note: Is there a detailed reference for vip available somewhere? I'd like to try using it it but I have zero previous experience with vi/vim so I'd rather learn vip directly instead of learning vim and then experimenting what works on vip and what does not.
<abu[7]> Hmm, good question
<abu[7]> No real docs
<abu[7]> Only the wiki article
<abu[7]> Yes
fuxoft46 has joined #picolisp
fuxoft46 has quit [Client Quit]
fuxoft97 has joined #picolisp
fuxoft97 has quit [Client Quit]
fuxoft has quit [Ping timeout: 250 seconds]
<pablo_escoberg> I ended up doing this for my rainbow parens (the `job` thing didn't work out due to the way it was called.
<pablo_escoberg> (de addLine (Y L N)
<pablo_escoberg>    (cup (+ (: top) Y) 1)
<pablo_escoberg>    (clreol)
<pablo_escoberg>    (setq Avail (31 32 33 34 35 36 37))
<pablo_escoberg>    (for C (nth L (: winX))
<pablo_escoberg>       (T (lt0 (dec 'N)))
<pablo_escoberg>       (cond
<pablo_escoberg>          ((: buffer flat))
<pablo_escoberg>          ((=T (val C))
<pablo_escoberg>             (ifn (>= "^_" C "^A")
<pablo_escoberg>                (attr NIL T)
<pablo_escoberg>                (setq C (char (+ 64 (char C))))
<pablo_escoberg>                (attr RED T) ) )
<pablo_escoberg>          ((>= "^_" C "^A")
<pablo_escoberg>             (setq C (char (+ 64 (char C))))
<pablo_escoberg>             (attr RED) )
<pablo_escoberg>          ((gt0 (val C))
<pablo_escoberg> The "#addLine redefined" message bugs me for no good reason :)
<abu[7]> You do (unded 'addLine) (de addLine ...
<abu[7]> undef*
<abu[7]> Or, shortes, (off addLine)
<abu[7]> grr
<abu[7]> shorter*
<abu[7]> Too tired :)
<pablo_escoberg> OK, can do
msavoritias has quit [Remote host closed the connection]
<abu[7]> fuxoft_mobile: In fact, the best doc for Vip is the source itself :)
<abu[7]> Try this
<abu[7]> : (vi 'vip~vi)
<abu[7]> Then /case
<abu[7]> ie. go to the long case statement in that function
<beneroth> bjorkintosh, think one step further and you end up at the cell as the fundamental element to build things from ;)
<bjorkintosh> equivalent to an element of a set, yes?
<beneroth> yes but not only.
<bjorkintosh> biological cell, and memory cell?
<beneroth> nah. biological cells are turing machines.
<beneroth> I simply meant lisp cells. so logical sets.
<beneroth> s/sets/cells
<bjorkintosh> heh. biological cells are too coarse grained!
beneroth has quit [Remote host closed the connection]
beneroth has joined #picolisp
beneroth_ has joined #picolisp
beneroth has quit [Read error: Connection reset by peer]