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
bjorkint0sh has quit [Remote host closed the connection]
bjorkint0sh has joined #picolisp
bjorkint0sh has quit [Remote host closed the connection]
bjorkint0sh has joined #picolisp
z4k4ri4 has quit [Quit: WeeChat 4.6.2]
z4k4ri4 has joined #picolisp
<tankf33der> morning
<tankf33der> i will create macos Makefile
<abu[7]> OK, good
<abu[7]> The easiest to pack it into the release as Makefile.macos, right?
Iacob has quit [Ping timeout: 260 seconds]
<tankf33der> yeap
rob_w has joined #picolisp
Iacob has joined #picolisp
<tankf33der> can not make shared libraries on macos
<tankf33der> picolisp is ready
<taleon> PicoLisp works on macOS, but not Vip.
<taleon> If I remember correctly, pil + didn't work either. But I'm sure about Vip.
<tankf33der> one of the version of experiments.
<tankf33der> makes me crazy.
<tankf33der> abu[7]: forgot how to check shared modules
<tankf33der> sndx - i meant
<tankf33der> done/
<tankf33der> done.
<tankf33der> makefile for macos ^^^
<tankf33der> all compiled. all tests passed.
<tankf33der> afk.
<abu[7]> taleon: The problem with Vip on Mac is from shared libs?
rob_w has quit [Remote host closed the connection]
rob_w has joined #picolisp
<abu[7]> So thanks tankf33der and taleon! I've put both Makefiles into the release
<tankf33der> and ask users to test. I can imagine situations where macos version will fail
rob_w has quit [Ping timeout: 248 seconds]
<taleon> abu[7]: I'll test it later on my "old" MacBook Air M1. I rarely use it and have to check. I think I had an error message saying that the dimensions/measurements couldn't be determined. More details later.
<abu[7]> OK, great!
<abu[7]> it it an ioctl() call iirc
<abu[7]> 'getTerm' in @lib/term.l
<abu[7]> So it could be some wrong constant like TIOCGWINSZ
<taleon> We already discussed this topic last year. However, I didn't pursue it further because I don't use macOS very much.
<taleon> Unfortunately, termbin.com seems to be down. It's about time for a new paste service that can be called directly from the terminal.
<abu[7]> tankf33der's pb1n
<abu[7]> It is also a command in Vip
<abu[7]> :pb1n
<abu[7]> sends current buffer
rob_w has joined #picolisp
beneroth_ has quit [Quit: Leaving]
beneroth has joined #picolisp
<taleon> That's right, pb1n.de. I'll test that out. :)
<beneroth> thanks tankf33der!
<abu[7]> I also use:
<abu[7]> alias pb1n='curl -F "f=@-;" pb1n.de'
<abu[7]> but almost always simply in Vip
<taleon> Really good and simple. I also set up an alias and it works.
<taleon> $ cat Makefile.macos | pb1n
<abu[7]> 👍
<M-Sci> beneroth: Do You have a few KiBs of DHT?
* M-Sci hides.
<taleon> macos: ~ pil +
<taleon> : (version)
<taleon> 25.5.5
<taleon> -> (25 5 5)
<taleon> :
<taleon> macos: ~ vip
<taleon> [/Users/cr/mystuff/src/pil21/bin/vip:9] Can't get terminal size
<taleon> ?
<abu[7]> Yes, getSize -> getTerm
<abu[7]> (%@ "ioctl" 'I 1 TIOCGWINSZ
<abu[7]> TIOCGWINSZ is from sysdefs
<abu[7]> Generated in the make process
<beneroth> M-Sci, DHT? I guess you don't mean the androgen hormone?
<M-Sci> W/Distributed_hash_table
<abu[7]> Distributed Hash Tables?
<abu[7]> I was too slow
<taleon> Unfortunately, I am not familiar with macOS syscalls and would not know how to work around this issue. I avoid Apple whenever possible. :-)
<abu[7]> It should build automatically, plled from includes
<abu[7]> *pulled
<M-Sci> I recently realized that Hash is such a general concept that DHT could be a linked list in an extreme case. Array, or more accurately Memory Region, is also a Linked List with 0 bit link field.
<M-Sci> (** 256 size) is not far from malloc...
bjork1intosh has joined #picolisp
bjorkint0sh has quit [Ping timeout: 260 seconds]
rob_w has quit [Ping timeout: 244 seconds]
corecheckno has quit [Remote host closed the connection]
<taleon> I have tried this code http://pb1n.de/?8c6c36 under macOS and it returns the following result: 80 25
<taleon> ioctl() seems to work in principle.
<taleon> tty_fd outputs 3
<abu[7]> Cool, looks good
<taleon> But in Vip I still get "Can't get terminal sizeâ".
<abu[7]> oh
<abu[7]> With pil @lib/term.l + and then (getSize)
<abu[7]> same error?
<taleon> ~ pil @lib/term.l +
<taleon> : (getSize)
<taleon> Can't get terminal size
<taleon> ?
<abu[7]> ok
<M-Sci> Buffering? flush(2) perhaps?
<abu[7]> Not needed for ioctl()
<M-Sci> I remember there was some quirk with /dev/ttyUSB0 on Mailing List (some years ago).
<M-Sci> Oh, sorry.
<M-Sci> It was not resolved to my knowledge.
<abu[7]> Yeah, here we look at stdin
<abu[7]> (%@ "ioctl" 'I 1 TIOCSWINSZ ...
<abu[7]> I think TIOCSWINSZ is wrong
<abu[7]> can you print TIOCSWINSZ in your C program, taleon?
<abu[7]> and then
<abu[7]> : TIOCSWINSZ
<abu[7]> On Android
<abu[7]> : TIOCSWINSZ
<abu[7]> -> 21524
<taleon> : TIOCSWINSZ
<taleon> -> 2148037735
<taleon> I'm not sure how I'm spending this under C. It's not a variable or a number.
<abu[7]> It is a #defined constant
<abu[7]> printf("%d\n", TIOCSWINSZ);
<taleon> 1074295912
<abu[7]> different!
<taleon> aye
<abu[7]> It is probably from #include <termios.h>
<abu[7]> (vi "src/sysdefs.c")
<abu[7]> Somethinm
<abu[7]> y
<abu[7]> g
<abu[7]> must go wrong here
<taleon> : (vi "src/sysdefs.c")
<taleon> Can't get terminal size
<taleon> :)
<abu[7]> haha
<abu[7]> -I in Makefile?
<taleon> I use vim
<abu[7]> good
<abu[7]> The include used in building sysdefs must be different from the one used in your C build
<taleon> #include <stdio.h>
<taleon> #include <string.h> // strerror
<taleon> #include <unis Type: int
<taleon> #include <errn variable tty_fd
<taleon> #include <fcnt
<taleon> #include <sys/
<abu[7]> you could grep for TIOCSWINSZ in "/usr/include/"
<taleon> ioctl.h>
<abu[7]> ok
<taleon> Phew, I'll have to look for where that is under macOS first. :-)
<abu[7]> Not in "/usr/include/" ?
<abu[7]> Pretty Unix standard iirc
<M-Sci> Ah the joys of Global Variables...
<abu[7]> Not a variable
<abu[7]> global include files :)
<abu[7]> System calls *must* be global
<M-Sci> `errno' seems to be a confused generalization (obstruction) of Status Register.
<abu[7]> errno is a second return value
<abu[7]> often '@@' in PicoLisp
<abu[7]> In some kind return values are always global
<abu[7]> because in a register
<abu[7]> and registers are the mosr global things
<abu[7]> *most
<M-Sci> Good point.
<taleon> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
<abu[7]> Uh
<abu[7]> Mac is special
<taleon> oh yes
<taleon> ioctl.h:#define TIOCSSIZE TIOCSWINSZ
<taleon> ttycom.h:#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
<abu[7]> oh, it is not a numeric constant :(
<abu[7]> ie it is evaluated as a function at runtime
<abu[7]> still it evaluates to a number
<abu[7]> so lib/term.l / sysdefs should work
<abu[7]> Hmm, why /* set window size */ ?
<abu[7]> We GET the size
<abu[7]> TIOCGWINSZ
<abu[7]> "Term I/O get window size"
<M-Sci> An escape sequence? Terminal Emulator Window can be resized, right?
<taleon> Good question
<abu[7]> No
<abu[7]> escape sequences are not a sys call
<abu[7]> they are interpreted by the terminal
<abu[7]> ioctl is a lower level
<abu[7]> So "#define TIOCSSIZE TIOCSWINSZ" is really strange
<abu[7]> set and get are different
<abu[7]> See with -E what the C compiler *really* includes
<abu[7]> It is the -E option in clang and gcc iirc
<taleon> This is the verbose output of my code.
<abu[7]> T
<abu[7]> Seems only /usr/include/sys/ioctl.h
<abu[7]> yes, might work too
<abu[7]> but ioctl *does* work in the C test
<abu[7]> So the pil build is wrong
<abu[7]> src/sysdefs.c
<abu[7]> (sc
<abu[7]> oops
<abu[7]> You could setq TIOCSWINSZ to 1074295912
<abu[7]> then getSize should work
<abu[7]> or whatever your C code printed (?)
<abu[7]> Was it 2148037735 ?
<taleon> pil @lib/term.l +
<taleon> : (getSize)
<taleon> Can't get terminal size
<taleon> -> 1074295912
<taleon> ? (setq TIOCSWINSZ 1074295912)
<taleon> ? (getSize)
<taleon> Can't get terminal size
<taleon> ? TIOCSWINSZ
<taleon> -> 1074295912
<taleon> ./a.out
<taleon> 1074295912
<abu[7]> I think you said 2148037735
<abu[7]> hmm
<abu[7]> can you strace?
<abu[7]> strace a.out 2>&1 |grep ioctl
<taleon> Apparently there is no strace under macOS. I'll have to search the internet.
<abu[7]> oh
<abu[7]> Good I stopped Mac development 30 years ago
<taleon> hehe
<taleon> dtrace a.out
<taleon> dtrace: system integrity protection is on, some features will not be available
<abu[7]> How is the situation on normal BSD?
<abu[7]> Is dtrace like strace?
<taleon> On OpenBSD is ktrace
<abu[7]> on Linux too
<abu[7]> kernel trace
<abu[7]> strace is system calls
<abu[7]> not sure about the exact differences
<taleon> To be honest, I have never used dtrace. macOS is not my favorite OS and I only use it very rarely and then only as a pure user.
<taleon> I have to read up on it first.
<abu[7]> sigh ;)
<taleon> I'm not sure if this is any kind of meaningful output: http://pb1n.de/?eb9f18 Otherwise I'll have to see how it works with ktrace.
<abu[7]> Looks good
<abu[7]> : (hex "80086804")
<abu[7]> -> 2148034564
* beneroth looks forward to soon(TM) using PicoLisp on MacOs (M3) and FreeBSD (requires that a different build than OpenBSD? probably?)
<beneroth> M-Sci, broad meaning of DHT: is it really so broadly defined but misused, inaccurate terminology (in service of bullshiting or real ignorance)? unfortunately, IT is full of it
<M-Sci> beneroth: Not at all. AFAIK a trivial Hash Function, like always returning 1, will degenerate a Hash Table into a Linked List.
<taleon> The last time I tested PicoLisp on FreeBSD, it was pretty straightforward. Here are my notes. However, back then I installed the code via git. http://pb1n.de/?8a8024
<beneroth> M-Sci, you are right! Not DHT is broadly defined, "hash" is. Agreed!
<M-Sci> taleon: [prin "^[[18t"] gives me result but IDK how to read it.
<beneroth> taleon, thank you very much, appreciated. I will not come around to test this in next weeks, but its on my list. I plan to experiment with FreeBSD and Jails as an alternative to Proxmox (primarily to get more stable cli/admin UI then even debian has, and because I detest SystemD)
<M-Sci> Oh yes, I'm not on BSD :) .
<M-Sci> I hope it will be of some help.
<beneroth> you're on MacOS, or what?
<taleon> If you need help with FreeBSD, let me know. I've done quite a few things with FreeBSD, but I prefer OpenBSD because it's easy to use and requires little configuration. Otherwise there is also a nice German BSD community at www.bsdforen.de
<beneroth> I also have a MacOS PicoLisp project coming up this summer, so I appreciate all the MacOS efforts by tankf33der, abu[7], taleon and everyone else - thank you all! <3
<beneroth> taleon, thanks! Will come back to it. Bookmarking bsdforen.de :)
<beneroth> M-Sci, taleon: and yes, I can set up a paste hosting if the need arises
<taleon> I always document everything and still have a lot of notes here. Back then it was a dedicated server with FreeBSD at Hetzner with nginx, letsencrypt, mail server, matrix serverencrypted jails via zfs, postgresql, etc. zfs is very cool. Especially the snapshots etc. You can then simply roll back if something goes wrong. Even an update to a new FreeBSD version can be easily rolled back to the previous
<taleon> version with a boot environment.
<taleon> Translated with www.DeepL.com/Translator (free version)
<taleon> I wanted to make it easy for myself with the translation and deepl betrayed me. :)
<beneroth> I'm Swiss and speak german, so no issue :)
<beneroth> deepl is great!
<taleon> I have a pro version, but unfortunately I forgot that I'm currently using macOS and wasn't logged in there. :)
<beneroth> I've worked with zfs on Solaris and Proxmox (and Proxmox Backup Server), only good experiences so far, but I haven't really dabbled in all the features besides setting up a proper mirror raid
<beneroth> (and make replacement disks for old solaris hardware compliant with all the disk slicing bureaucracy)
<taleon> A lot has happened since then.
<beneroth> yeah, but still a loot old solaris boxes keep on running :D
<beneroth> s/loot/lot
<taleon> This stuff just works. :)
<taleon> Old Sun computers are constantly being given away here. However, due to the electricity costs, they are no longer really interesting to me as a hobby.
<beneroth> yeah
<beneroth> that is also my main motivation for contemplating FreeBSD: just work and not forcing me to learn new network configuration syntax and other BS every few years become some NIH kid wanted to put their mark on Debian
<beneroth> (but also that I probably can build a more optimized, flexible and more efficient system using FreeBSD/ZFS/Jails instead of Promox etc. Worth a try)
<beneroth> (for client webhostings and hosting of my own stuff etc.)
<beneroth> s/become/because
<taleon> Yes, it's more than suitable for that. Jails allow you to physically separate customers from each other while still maintaining full performance without a separate VM layer.
<taleon> I'm off now. Got to get up early tomorrow. :) Good night.
<M-Sci> o/
<beneroth> good night o/
<M-Sci> An example of getSize. Buffering and error handling is missing.
<beneroth> that's pil code? why use so many square brackets [] instead of normal ones () ? I think closing square bracket ] closes all open brackets (back up to the top-level)
M-Sci is now known as DKordic
<DKordic> beneroth: def swap(ToS, NoS, *Data, **Dictionary): return OK(NoS, ToS, *Data, **Dictionary)
<DKordic> [ dfn ( swap < ToS NoS > ) ( < NoS ToS > ) ]
<DKordic> beneroth: Brackets are for application of FEXPRs, and parentheses for application of Functions.
<DKordic> W/Function_literal
<DKordic> [ dfn ( Forth! Data Factor < > ) ( Data ( Factor < ) > ) ]
<DKordic> Example: [ dfn ( a-list < > ) ( < 3 5 7 "or anything else" > ) ]
<DKordic> I can not do this in pil.
<beneroth> ah, I see. thanks for explaining
<DKordic> I know I am difficult. But I bet You don't know what You are missing out on.
<DKordic> Key point: Name one of the Parameters «return», «result» or «continue». Now from 0 to any number of Values can be returned in the same sense as they are... received! Isn't that neat?
<DKordic> «if» has 2 such Continuations. MMIO is an excellent example clarifying Side-Effect.
aw- has quit [Ping timeout: 252 seconds]
aw- has joined #picolisp