beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: | Check for more information
geri has joined #picolisp
<geri> hey, do we have anything to connect to AF_UNIX sockets?
<geri> (probably not...)
<abu[7]> Only what is in @lib/net.l
<abu[7]> No AF_UNIX
<geri> do i gotta like clone the port function, adjust the values for AF_UNIX and pray? :D
<abu[7]> I have not investigated, What do you need them for?
<geri> you can talk to a running MPV player instance via ipc, ive made a music player using that fact and wanted to know if i'd be able to do it with pure picolisp instead of sh + socat + jq or cl with a json library
<geri> (yes im stupid)
<abu[7]> No, a valid idea
<geri> :D
<geri> its real fun too
<geri> its really cool i technically can do it with pico if i know C well enough, although it sucks that i dont know it well enough
<geri> so i guess ill have to scour through all of net lib
<abu[7]> The network stuff is really tedious
rob_w has joined #picolisp
<geri> i kinda know already, but not on the same level
<abu[7]> I'm also not good at that
<abu[7]> Took most from existing examples
<geri> do you use pil scripts with vi's !! operator?
<geri> just curious
<abu[7]> Yes, sometimes. Why not? There is nothing special.
<geri> why not indeed
<geri> on my system pil scripts are between dash and bash performance wise
<geri> closer to dash, but you cant compare usability of dash to a lisp
<geri> (which still amazes me)
<abu[7]> ☺
<geri> wizardry!
<geri> got work so gonna be afk a lot
<geri> good luck surviving the monday
<abu[7]> Thanks!
<abu[7]> You too!
geri has quit [Ping timeout: 260 seconds]
lagash has quit [Ping timeout: 268 seconds]
msavoritias has joined #picolisp
rob_w has quit [Ping timeout: 256 seconds]
geri has joined #picolisp
rob_w has joined #picolisp
user3456 has quit [Quit: I use ZNC -]
lagash has joined #picolisp
user3456 has joined #picolisp
user3456 has quit [Ping timeout: 252 seconds]
user3456 has joined #picolisp
rob_w has quit [Ping timeout: 264 seconds]
abu[7] has left #picolisp [#picolisp]
abu[7] has joined #picolisp
abu[7] has left #picolisp [#picolisp]
abu[7] has joined #picolisp
rob_w has joined #picolisp
rob_w has quit [Remote host closed the connection]
pablo_escoberg has quit [Quit: Client closed]
<geri> do you remember what was the last version of pico w/ C core? abu[7]
<geri> probably pre-3.0
<geri> rewriting it 3 times sounds pretty funny, although considering the language is minimalist it kinda makes sense too
<abu[7]> Pil64 was started around 2012, after that they were always both in the same distro
<abu[7]> The *latest* is
<abu[7]> Not only 3 times
<abu[7]> there is also miniPicoLisp and ErsatzLisp
<geri> oh right
<geri> wait, did you write miniPico too?
<abu[7]> T
<geri> xd
<abu[7]> :)
<geri> i can relate
<geri> if a function is defined to only take one function and 2 are passed, second one is completely ignored right?
<geri> it seems so, just want to confirm :D
<abu[7]> Superfluous arguments in general are ignored, missing args are bound to NIL
<geri> its nice to not eval extra stuff
<geri> and no need for optionals if everything is optional :D
<abu[7]> Yay
<abu[7]> The callee can decide what to do with the NILs
<geri> interesting that most builtins seem to only take a single any as an argument
<geri> i guess any x in this case means any arguments, any amount, any type
<abu[7]> As I said, they are *all* FSUBRs
<abu[7]> they take the list of unevaluated args
<abu[7]> *all*
<geri> explicit eval everywhere!
<abu[7]> T
<geri> i remember that fexpressions are hard to make compile efficiently, is it because evals are hard to compile efficiently? (iirc)
<abu[7]> It is because FEXPRs get their code-argument(s) as data which cannot be well compiled statically. I think this has nothing to do with 'eval' per se.
<geri> just managed to find anything on the web related to fexprs xd
<geri> so basically as far as i understood - they were present in mac and inter lisps but were "deprecated" because its easier to compile macros efficiently
<abu[7]> Ok, and FSUBRs are the built-in equivalents
<abu[7]> Yes, I think so too
<geri> whats the difference between fexprs and fsubrs?
<abu[7]> FSUBRs are built-in (low level)
<abu[7]> llwm or C
<geri> hm
<abu[7]> Same behavior
<geri> okay
<geri> had performance changed much since rewrite from assembly to llvm?
<abu[7]> Not really
<geri> but you get to write pico in itself
<geri> :D
<abu[7]> yes, and more portable most of all
<geri> like itd work on risc-v?
<abu[7]> yes, there is a problem on RISC-V, it does not have a condition code register
<abu[7]> Pil64's vm needed a CCR
<geri> new one doesnt?
<abu[7]> LLWM-IR has a kind of carry flag and overflow mechanisms which is enough
<beneroth> hi geri & abu :)
<geri> hello
<abu[7]> Hi beneroth!
<beneroth> geri, FEXPR are interpreters in itself. so cannot be compiled because you don't know what they will do until you call them with arguments (and the arguments then influence their behavior)
<geri> so the journey with main version is like "C so that it works" > "Assembly so it's fast" > "LLVM so it's fast and written in itself!" ?
<geri> :D
<beneroth> theoretically they could be compiled if you would know all possible arguments in your program. but if some of these arguments come from user input..then impossible
<geri> (and portable)
<tankf33der> hi all
<beneroth> assembly was because it was easier (memory management), not for performance
<tankf33der> pil21 works on riscv
<abu[7]> Hi tankf33der
<geri> so many people!
<beneroth> hey tankf33der
<beneroth> WOHOOOO great!
<tankf33der> all tests passes.
<tankf33der> all tests passed.
<beneroth> awesome, thanks for testing!
<abu[7]> The problem with FEXPs is that you don't know what is code and what is data, and *when* to execute the code
<abu[7]> It can be executed conditionally etc
<geri> beneroth: asm memory management being easier than C memory mangement sounds like a meme
<geri> or maybe it is indeed because its general/generic assembly instead
<geri> oh wait, is every extra argument unevaled because everything is unevaled by default?? :D
<abu[7]> Yep
<geri> makes sense
<abu[7]> It is a consequence
<beneroth> geri it's not a meme. in C memory allocation happens in blocks, and if you want a larger block you cannot resize the existing one but need to re-allocate the whole block. in asm you can extend the existing memory block.
<geri> ah
<beneroth> asm gives more fine-granular control than C
<abu[7]> But in both asm and llvm you will call malloc()
<abu[7]> So it ends up the same
<abu[7]> as in C
<beneroth> really?
<geri> if you were to rewrite all of picolisp core from scratch, how long would it take you? abu[7]
<geri> i feel now as if thats what you do instead of drinking coffee in the mornings
<abu[7]> hmm, iirc pil21 took a few weeks, and then two years to get it all rounded up
<abu[7]> I always wrote these versions parallel to my work
<abu[7]> Used them in projects
<geri> sounds like any projects i work on
<abu[7]> So it did not feel like extra work ;)
<geri> plus it might be a fun hobby for you too
<abu[7]> OK, sorry, have a meeting soon, must prepare
<geri> although after so much time it could get tedious and exhausting
<abu[7]> BBL
<geri> good luck
<abu[7]> ☺
pablo_escoberg has joined #picolisp
bjorkintosh has quit [Ping timeout: 246 seconds]
bjorkintosh has joined #picolisp
<geri> abu[7]: do you know japanese?
<abu[7]> Yes, some, but I forgot a lot during the last 35 years
<geri> :D
<geri> im griding anki cards every day, although kinda poorly lately
<abu[7]> Great! :)
<abu[7]> BTW, Penti has Kanji input too
<geri> yeah
<geri> thats why i asked
<geri> where can i read about ~?
<geri> maybe source code!
<abu[7]> you need the "Jap" version
<geri> i meant ~ reader thingie
<abu[7]> ?
<geri> the backtick youve explained, but where do i see what ~ does?
<geri> also about penti - any plans to distribute it with fdroid?
<abu[7]> I would like to, but did not succeed
<geri> aw, what was the problem?
<abu[7]> The procedure is complicated, and you need a git repo whicH I don't have
<abu[7]> Mia created one, but she also did not succeed
<geri> :(
<abu[7]> She asked for help at F-Droid but without avail
<geri> where do you store the source code?
<abu[7]> In my own incremental directory tree
<abu[7]> incremental backups
<abu[7]> I have my own version control so to say
<abu[7]> I always release TGZs, also for PicoLisp, PilBox
<abu[7]> It is just a snapshot
<geri> haha
<geri> i mean, my files are just rsynced onto my usb drive for backup
<geri> although all of my projects use git
<geri> discrimination against tar lovers(
<abu[7]> I hate Git and all existing repos I tried, because they destroy the metadata
<abu[7]> I depend on the metadata for all I do
<geri> what kind of metadata?
<abu[7]> E.g in Vip you get the whole directory tree sorted by modification date
<abu[7]> (vi "pil21")
<abu[7]> You still have *all* time stamps correct
<abu[7]> I can see what I worked on when
<abu[7]> That's lost if you pull from Git et al
<abu[7]> I still have files from the early 1990s with correct times
<geri> aw
<abu[7]> ALL my file management tools depend on correct times
<abu[7]> When I modify a file, and then revert, I never undo by editing
<abu[7]> Instead I fetch the old version from my repo to get the original timestamp too
<abu[7]> See also :bak and :kab in Vip
<abu[7]> The maintain stamps too
<geri> ive recently switched from having a single directory full of configs to multiple for specific kinds of things because emacs config is like 1k lines and some other stuff, so ill probably need get something like incremental backups working to share configs between phone and pc
<geri> what the hell, i just learned about superparens
<geri> why arent they used more
<abu[7]> A matter of taste perhaps
<geri> this is kinda really cool
<geri> except also harder to jump to matching paren
<abu[7]> Vip handlen super parens correctly
<abu[7]> *handles
<geri> i should probably try to fix it up in the elisp package im using
<geri> i hadnt seen it being used once in the source code yet though
<abu[7]> I use it in the REPL sometimes
<abu[7]> In source I somehow prefer (foo) ) ) )
<geri> i hate spaced out closing parens with passion 🙂
<abu[7]> They structure the code in a more readable way :)
<geri> i find it more readable with just closing parens without spaces, but then again, i aint used to seeing that
<abu[7]> ] or ))))) cuts it off too harshly
<geri> did you not add the ] reader macro?
<abu[7]> What does it do?
<geri> super parentheses? xd
<geri> apparently its a read macro
<abu[7]> Ah! Well, not really a macro, cause it does not expand to something
pablo_escoberg has quit [Quit: Client closed]
<geri> here, how cursed is this? :D
<geri> it honestly looks kinda neat for cases
<geri> when it works, of course
<abu[7]> Looks good so far, no?
<geri> yeah
<geri> the idea of using First . Rest is to only eval the arguments when it matters but idk how much performance does it actually give me
<geri> especially considering its mostly a single function file
<abu[7]> I would not worry so much about performance
<geri> yeah, thats what im thinking too
<abu[7]> The overhead is usually somewhere else
<geri> like calling external functions 40 times
<abu[7]> T
<geri> does pico do recursion well?
<geri> (except being written in itself ofc)
<abu[7]> The overhead?
<geri> like schemes have tail call optimisation to not eat up all the function stack
<geri> so im wondering how well recursion works
<abu[7]> Yes, uses stac
<abu[7]> Tail recursion can always be replaced by a loop
<geri> yeah, but some things look way better with recursion than with loops
<geri> oh, heres a very silly idea - make calling lists, like ((list + 1 2 3)) be the same thing as (eval (list + 1 2 3))
<geri> :D
<abu[7]> This is a legal syntax already
<geri> what the hell i was joking
<geri> xd
<abu[7]> ((list '(X Y) '(+ X Y)) 3 4)
<abu[7]> :)
<geri> cant do it with quote it seems
<geri> ('(+ 1 2 3))
<abu[7]> Think what it means
<geri> returns 3
<abu[7]> The CAR must evaluate to a function
<geri> and car of quote is quote itself or something?
<abu[7]> No
<abu[7]> (+ 1 2 3) as a function means '+' is the formal unevaluated parameter
<abu[7]> the body is (1 2 3)
<abu[7]> which runs as 3
<geri> im kinda lost with these last 3 lines
<abu[7]> (de f + 1 2 3)
<abu[7]> (de g L (car L))
<abu[7]> (g a b c) -> a
<abu[7]> fun is (L (car L))
<abu[7]> so (+ 1 2 3) is a fun
<abu[7]> see @doc/ref.html
<geri> which section?
<geri> oh wait
<geri> its a function f that takes + as an argument and returns 3 because its in the end
<geri> brain slow
<abu[7]> Yess :)
<abu[7]> doc/ref.html#ev
<abu[7]> "A legal function ..."
<geri> ('(() (+ 1 2 3)))
<geri> this works
<geri> and replacing () with _ too
<abu[7]> Yes, good
<geri> okay, now i really feel like code is data
<geri> :D
<geri> or data is code, hmm
<abu[7]> ☺
<geri> oh, you can actually mapcar lists
<geri> this is amazing
<geri> ive done something like creating a closure but using (fill) instead
<geri> how would you go about making a counter in a closure in pil?
<abu[7]> Closures are best created with 'curry'
<abu[7]> Look at the source of Vip
<abu[7]> Uses 'curry' is some places
<abu[7]> to create e.g. search or change functions
DKordic has joined #picolisp
<geri> (de make-mapper (@Src @Dst) (fill '((i) (list (pack @Src i) (pack @Dst i]
<geri> i have this rn
<geri> let me check it with curry
<geri> actually in this case its slightly neater with fill haha
<abu[7]> Name conventions :)
<geri> but good to know
<geri> ye, ive upcased I already
<abu[7]> 👍
<geri> although wit >'s and *'s and other stuff i wont remember
<geri> at least constants are easy enough to grasp
msavoritias has quit [Remote host closed the connection]
<geri> gotta sleep soon, enjoy
<abu[7]> Good night! :)
geri has quit [Quit: ERC (IRC client for GNU Emacs 29.3)]
chexum has quit [Ping timeout: 260 seconds]
chexum has joined #picolisp