acheam changed the topic of #kisslinux to: Unnofficial KISS Linux community channel | | post logs or else | song of the day
<midfavila> idk man
<virutalmachineus> sounds like bloat to me(joking)
<dilyn> > monadic predicate logic
<dilyn> mfw liebniz was right the whole time
<noocsharp> actually wouldn't monadic predicate logic be equivalent to first order logic?
<midfavila> not if i'm interpreting the BNF grammar of first order logic
<midfavila> it seems to allow a single proposition to have multiple predicates
<dilyn> FOL has quantifiers I'm not certain if MPL does
<dilyn> I've always skipped over the distinction tho
<midfavila> MPL does
<dilyn> then they're functionally equivalent without me knowing anything more about it
<noocsharp> but multiple predicates = 1 tuple of predicates
<dilyn> mfw mpl doesn't have explosion
chomwitt has quit [Ping timeout: 244 seconds]
rohan has quit [Ping timeout: 256 seconds]
<testuser[m]12> Hi
<midfavila> so, question for anyone with experience programming using toolkits like Motif or Athena:
<midfavila> i might just be working off a small sample size, but i've seen a lot of programs that declare and set a variable to hold a string, use it once, and then free it. why would you do that instead of passing the result of the string initialization function directly to whatever function uses the variable?
<midfavila> it seems kind of redundant to use a variable for a value that's used once
rohan has joined #kisslinux
<noocsharp> show an example
<midfavila> this snippet is what I'm talking about
<midfavila> (this is from the IRC client I've spent today hacking on)
<midfavila> i've seen similar things in other Motif programs I've peeked at the source for, too
<midfavila> passing the function's return value doesn't make it less readable or reduce semantic value either
<midfavila> "the function" being XM_STRING_CREATE (which I suppose is a macro...)
<midfavila> but similar things occur with... gah, what's the function to create a motif string... one sec
<midfavila> XmStringCreate(), go figure
rohan has quit [Ping timeout: 268 seconds]
<midfavila> man, the macro doesn't even do anything useful in this case
rohan has joined #kisslinux
<midfavila> #define XM_STRING_CREATE(str) XmStringCreateLocalized(str)
Torr has quit [Quit: leaving]
<noocsharp> who knows
<noocsharp> perhaps they intended to error check in case XmStringCreateLocalized failed but never did
* midfavila shrugs
<noocsharp> also in my experience people tend to avoid passing function outputs directly as parameters into other functions in c, except in trivial cases
<noocsharp> i guess because most of the time, functions can fail
<midfavila> actually,
<midfavila> i just took a quick peek at the manpage
<midfavila> the function opaquely allocates memory
<midfavila> that answers that question
midfavila has quit [Remote host closed the connection]
midfavila has joined #kisslinux
midfavila has quit [Client Quit]
ejjdhfjsu has joined #kisslinux
midfavila has joined #kisslinux
midfavila has quit [Client Quit]
rohan has quit [Read error: Connection reset by peer]
rohan has joined #kisslinux
midfavila has joined #kisslinux
<midfavila> okay, wew
<midfavila> somewhere, somehow the IRC client's state struct stopped being initialized
<midfavila> libera didn't like me trying to connect sans nickname
midfavila has quit [Remote host closed the connection]
midfavila has joined #kisslinux
<midfavila> huh... it's interesting to see how even the full IRC RFC is mostly server-side stuff
<midfavila> someone by the name of Jack Allnut appears to have taken the time to go through and write a spec specifically for clients, it's surprisingly short
<wael[m]> is there a way to set mdev rules without modifying mdev.conf directly?
<illiliti> no way
<wael[m]> no possible way ever? damn taht sucks
<illiliti> why
<wael[m]> i just want to have 1 or 2 simple mdev rules but modifying mdev.conf directly could make KISS overwrite it on mdev update
<midfavila> i'm pretty sure there are guards against that
<midfavila> doesn't kiss compare the checksum of a file during an update to what it was during the original install?
<wael[m]> hm
<midfavila> or am I mistaken?
<illiliti> kiss doesn't overwrite files in /etc/
<wael[m]> alright cool
<illiliti> if those were modified
<wael[m]> illiliti: is this correct?: PRODUCT=1038/12b3/0;.*
<illiliti> maybe
<wael[m]> one way to find out
ella-0_ has joined #kisslinux
ella-0 has quit [Ping timeout: 256 seconds]
<wael[m]> how do i view mdev logs again
<illiliti> uevent?
<wael[m]> thx
<wael[m]> im not sure how the hell do i give myself 777 access to hidraw
<wael[m]> i just want 1 specific device lol
<virutalmachineus> what do you guys think of zig?
<wael[m]> i dont program but i see zig as meh
<wael[m]> looks like what rust is trying to achieve, ' a modern C'
sad_plan has joined #kisslinux
<illiliti> zig is OK if you don't care about llvm and cmake dependency
<illiliti> it's more like a personal issue, but i don't like how zig tries to NIH and absorb everything
<illiliti> build system, cross-compilation, linker, compiler, ...
<illiliti> zig is more than just a language
<illiliti> but as a language it's OK
<illiliti> if there were minizig without llvm/cmake dep, which would just implement zig compiler without all the bells and whistles, i would use it for everything
<wael[m]> what about nim?
<illiliti> nim's stdlib depends on GC
<illiliti> it's no go for general purpose programming
<illiliti> and system programming too
<illiliti> but again, it's my personal view. of course every language have its use case
soliwilos has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
ejjdhfjsu_ has joined #kisslinux
ejjdhfjsu has quit [Ping timeout: 256 seconds]
ioraff has quit [Quit: ioraff]
dilyn has quit [Ping timeout: 248 seconds]
<phoebos> midfavila: motif and athena's string handling is so awful
<phoebos> at least motif has a few more routines to do stuff with them
<testuser[m]12> @illiliti self hosted compiler without lolvm is on the roadmap
<testuser[m]12> years to go tho
<testuser[m]12> how are u supposed to manage multiple networks with wpa spplicent
<phoebos> wpa_cli enable/disable_network?
<testuser[m]12> oh
<testuser[m]12> ioraff: I thought the patches in gentoo repo were for old versions because of the naming they used lol
<testuser[m]12> @phoebos can u set interface and driver in wpa_supplicant.conf
soliwilos has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
<illiliti> testuser[m]12: even if zig get rid of llvm at some point, it still won't fit my criteria
<testuser[m]12> what lang do u prefer other than C then
<testuser[m]12> also does the -M flag on wpa_supplicant cause an infinite loop for anyone else
<illiliti> hare i think. its stdlib is lacking many things, but it isn't over-engineered unlike zig
<testuser[m]12> but generics
<illiliti> i don't see the need for them
<illiliti> i'm fine without
<testuser[m]12> would u duplicate hash map code in every project
<testuser[m]12> is there a preprocessing solution or something
<illiliti> i see what you mean. re hashmap, i'm thinking about implementing some variants of hash maps and putting them into BSD0. this way you can simply adopt them into your project without reinventing everything each time.
<illiliti> and there's no preprocessing. hare's best is -Dvar:type=value
sad_plan has quit [Quit: nyaa~]
soliwilos has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
sad_plan has joined #kisslinux
ejjdhfjsu_ has quit [Remote host closed the connection]
<illiliti> there's build tags though. forgot about them
<illiliti> you can use them to implement things like #ifdef _linux_
<phoebos> testuser[m]12: you have to do each driver/interface separately
<phoebos> > wpa_supplicant can control multiple interfaces (radios) either by running one process for each interface separately or by running just one process and list of options at command line. Each interface is separated with -N argument.
<phoebos> see the example in the manpage
<phoebos> you'd need two configs
soliwilos has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
fitrh has joined #kisslinux
<testuser[m]12> ok
<testuser[m]12> how does it work if you have interface names like wl0ps0s20 that keep changing
soliwilos has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
<phoebos> can you stop them from changing
<phoebos> but I don't know
<Ogromny> illiliti: hare is fuckingly cool
fitrh has quit [Quit: fitrh]
soliwilos has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
<illiliti> yeah, they did many things right
<illiliti> btw
<illiliti> i can do kiss r go, finally
<illiliti> good fucking riddance, go! i hate you google
<Ogromny> I hate google too lol
<Ogromny> Starred your repo <3
<illiliti> thx
<illiliti> 770.5K dnscrypt-client
<illiliti> 8.4M dnscrypt-proxy
<illiliti> insane difference
<illiliti> go and dnscrypt-proxy have become too annoying to deal with, really
<illiliti> both are growing in size on each release
<sad_plan> so no more go on your system from now on then? you just about had it with go havent you? :p
<illiliti> yep
<sad_plan> I still use go for 1 packge, but it would be nice to avoid it all together. damn github-cli is written in go, and its annoying..
<sad_plan> I had 2, but got rid of fzf, for fzy, which was written in C instead :D
<illiliti> o fzy is nice. i have bindings for it, but i don't use them too often
<sad_plan> it is. im however really just using it with ytfzf though. I rearly use it otherwise
* sad_plan shrugs
<illiliti> isn't github-cli written in ruby?
<illiliti> oh wait, the old version was written in ruby
<illiliti> i'm pretty sure it sucks though, so you no choice but to rewrite it in more sane language if you want to get rid of go
<wael[m]> what is a sane language?
<sad_plan> yeah, I dont know any sane languages atm, so ill either stick with it, or just choose to not use it. its rather convinient though.
<sad_plan> C is a sane language
<illiliti> c, hare, zig
<wael[m]> everyone outside this place always say C is unsafe and blah blahh
<sad_plan> it can be unsafe, if you write unsafe code. it really breaks dowm to 'muh memory safety' when comparing rust to C in any case.
<sad_plan> its a meme at this point
<wael[m]> also, what is hare? i have never ever heard of it
<sad_plan> its a new language
<illiliti> it is unsafe yeah, but despite its unsafety, it is simple, portable and doesn't totally suck unlike those "modern" languages
<wael[m]> i do tons of POSIX scripting and i wanna learn C at one point
<sad_plan> you could also look into rc. its the shell from plan9. really simple, and small
<illiliti> but less portable
<sad_plan> yeah, unfortunatly
<midfavila> meh, if you target rc, you target rc
<midfavila> i daily it myself
<midfavila> v v comfy
<midfavila> only problem with it in interactive use is that linking it against the usual line editing libraries is pretty clunky, owing to them expecting bourne syntax
<sad_plan> I cant vouch for that at all, as Ive bearly used it. I tried to rewrite some scrits in it, but I belive I got stuck on some if statement or loops or w/e..
<midfavila> rc handles conditionals a little oddly
<midfavila> the else statement needs to directly follow the initial conditional's closing brace
<midfavila> as someone who's used to putting it on its own line that peeves me
<midfavila> loops are definitely different, much more C-like than bourne
<midfavila> while(statement){thing} or for(variable in range){thing}
<midfavila> fortunately the entire BNF grammar fits on like
<midfavila> one page
<midfavila> so it's not hard to figure out the language itself
<midfavila> ...well, assuming you know yacc, anyway
<midfavila> i still need to learn that, gah
<illiliti> yacc? why do you need to learn it?
<midfavila> i need to use it for at least one project of mine
<illiliti> secret project?
<midfavila> a while ago i committed to restoring a lisp-based windowing system from the 80s written in KnR C and its own lisp, WOOL
<midfavila> oh, it's not secret, it's just on hold
<midfavila> because I'm shit at programming
<midfavila> lmao
<midfavila> turns out, going from "yeah I know what a pointer is" to "time to make a custom interpreter and windowing system" is a bit of a leap
<illiliti> bruh
* midfavila shrugs
<midfavila> anyway if you wanted to look at the source,
<midfavila> last time I touched it was last year >.<
<midfavila> but it uses yacc and lex to create a parser and stuff
<midfavila> at some point i'll probably just write a new wm and WOOL interpreter
<midfavila> because this code is a massive mess
<illiliti> i see
<illiliti> > Removed spyware routines
<illiliti> lol
<midfavila> it's not a joke
<midfavila> there were subroutines that called a server to report telemetry data on boot
<midfavila> i mean, the original creators didn't hide them, at least
<midfavila> but I figured removing them would be a good idea, regardless of whether the server was still online or not
<midfavila> anyway, I gotta change the font for my IRC client real quick, brb
midfavila has quit [Remote host closed the connection]
midfavila has joined #kisslinux
<midfavila> and we're back
<wael[m]> o/
<midfavila> figured a monospace font might be a little nicer for the main output window than a variable-pitch one
<midfavila> definitely is
<illiliti> have you heard about coherent os? it's an ancient unix-like os. i tried to port its coreutils, but gave up quickly. it's quite unpleasant to work with ansi c
<illiliti> yeah i like resurrecting ancient stuff
<midfavila> >mfw I haven't done anything other than ansi c
<midfavila> also yes
<midfavila> i'm familiar with coherent unix
<midfavila> iirc it was a very early clone
sad_plan has quit [Quit: nyaa~]
<midfavila> didn't the bell labs guys say that there was a non-zero chance they plagiarized system five or whatever?
<illiliti> they didn't find anything to prove that and drove off
<midfavila> aaah
<midfavila> i dunno if i'd bother with its userland to be honest
<midfavila> i think i'd much rather write my own versions of system software
<midfavila> i wrote my own posix cat recently :D
<midfavila> and it even works
<midfavila> i don't really like how clunky parsing arguments in C is though, so until I better understand data structures and can implement a better method, most utilities are on hold
<wael[m]> POSIX CAT? HOW?
<midfavila> .../s?
<wael[m]> aw god fucking damn it
<midfavila> if you're *not* screwing with me, the answer is that I sat down with the posix manpage for cat open and only wrote in C89 using posix libraries
<midfavila> it's... pretty bad, but it's my first non-trivial (?) program, so I'm at least slightly proud of it
<illiliti> congrats
<illiliti> next step is awk
<illiliti> go
* midfavila grasps their head
* midfavila screams
<illiliti> xd
soliwilos_ has joined #kisslinux
<midfavila> that's another reason I need yacc
<midfavila> *fuck* writing parsers and shit by hand
<midfavila> that's way beyond me right now
<midfavila> i'm gonna stick to like
<midfavila> echo and ls and cp and stuff
<midfavila> at least for now
<illiliti> how about shadow utils? those are non-posix though
<midfavila> non-posix utilities are next, after posix utilities
<midfavila> i want to slowly rewrite my unix userland to be completely custom, so...
<midfavila> the scope is at the very least POSIX+SUS+some extensions from late research unix/plan 9
<midfavila> and that includes a compiler and shit, ugh xwx
<midfavila> i need a copy of the dragon book....
soliwilos has quit [Ping timeout: 268 seconds]
<illiliti> nice
<midfavila> yeah, i guess
<midfavila> it'd be nice to copy what the ACK does
<midfavila> or, I guess, GCC too
<midfavila> have an intermediate language that's emitted by frontends, pass that through an optimizer, and then compile that intermediate language to assembler and then machine code
<midfavila> probably just start with an implemention of mini-C, scheme and pascal, gradually add more frontends over time
<illiliti> which frontends?
<midfavila> C proper, Common Lisp, Basic, nothing crazy
<illiliti> ah
<midfavila> the idea is to have a simple, portable, non-optimizing compiler that's easy-ish to understand
<midfavila> optimizations are always gonna be optional if i can help it
<wael[m]> lisp can compile to machine code?
<midfavila> in this case it wouldn't be a direct compilation, but i fail to see why it wouldn't be able to
<midfavila> the source code will be transpiled to a logically equivalent intermediate language before any (optional) optimization and compilation is done, so...
* midfavila shrugs?
<midfavila> ultimately i'm just talking about like-to-dos and nice-to-haves
soliwilos_ has quit [Remote host closed the connection]
<illiliti> do you plan to stick to the posix at all cost? how about replacing some components with more sane versions, e.g dd -> rw
soliwilos has joined #kisslinux
<midfavila> SUS where possible, POSIX where SUS can't be, and where neither POSIX nor SUS can be referred to, Plan 9
<midfavila> as a last resort I intend to refer to late-generation research unix
<midfavila> if there are more sane counterparts of unix commands to be found in later versions of research unix and/or plan 9 then i'll likely implement those as well
<midfavila> but in a separate package
<illiliti> rw is a sortix thing, so...
<midfavila> ...oh!
<midfavila> I use his zlib
<midfavila> sortix is cool
<midfavila> but yeah, if I stea^H^H^H^Huse any of his ideas, they'll be in a separate package
<midfavila> idea is mp-utils for portable tools that are standard, mu-utils for standard but unportable, and me-utils for extensions
<midfavila> although for sufficiently large and complex programs like a compiler, or some of the more complex interpreters of Unix, I'll put them in their own repos with symlinks in the appropriate repo
<midfavila> today, wc. tomorrow, mcc. the day after, the world
<wael[m]> is there a way to quickly get a version of a package without having to view its package sources
<midfavila> nope
<wael[m]> aghhhh there is no way thats not possible
<midfavila> a few people myself included have said that kiss version $PACKAGE should do the trick, but that just displays the version of kiss
<midfavila> oh, it's totally possible
<midfavila> trivial even
<midfavila> it's just not a change upstream is willing to make
<wael[m]> yes i always thought of that
<midfavila> just make a shell alias
<wael[m]> wait
<midfavila> or a kisslet
<midfavila> a "peck"?
<midfavila> that would be pretty amusing - if kiss extensions were called pecks
<wael[m]> kiss-ver() { cat $(kiss s $1)/version } ?
<testuser[m]12> wael[m]: no
<wael[m]> how den
<midfavila> you should probably use a head -1
<testuser[m]12> yea
<midfavila> or a sed 1q,
<midfavila> or some shit with awk,
<midfavila> or something to take only the first line
<wael[m]> tru
<illiliti> read -r line < file
<wael[m]> i guess i can just do kiss-pv
<wael[m]> read -r pkgdir <<-EOF $(kiss s $1) EOF
<wael[m]> convenient
blu has left #kisslinux [#kisslinux]
<illiliti> yep
<phoebos> kiss l pkg?
<wael[m]> YES
<wael[m]> that works
<wael[m]> ok i didnt have to make read -r kiss pv cat head1 benchmark this works
<illiliti> but it works only with installed packages
<wael[m]> but thats what i want
<wael[m]> but good point
<wael[m]> illiliti: 'POSIX' kiss-pv without head or cat is 1.10 ± 0.04 times faster than cat head, amazing
<testuser[m]12> tf is kiss pv
kinozawa has quit [Quit: Leaving the Cosmos...]
<noocsharp> mutt
<noocsharp> oops
kinozawa has joined #kisslinux
kinozawa has quit [Client Quit]
<wael[m]> @testuser: basically look up version of package without needing it installed
<wael[m]> i just compared the normal way vs posix way
kinozawa has joined #kisslinux
kinozawa has quit [Client Quit]
kinozawa has joined #kisslinux
ioraff has joined #kisslinux
<wael[m]> you guys are telling me toybox is half the size of busybox (in SLOC and size too) and has the features i want unlike busybox? this is a steal!
<wael[m]> unfortunately i use glibc 2.36 and i dont think landley likes it because my pr to fix the building on glibc is unnoticed
<ioraff> it's been 2 days
<wael[m]> i have little patience nowadays sorry
<wael[m]> but he has committed and commented on other things in the same repository after the time period of the pr
<wael[m]> sooooooooooooooooo
soliwilos has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
rohan has quit [Ping timeout: 248 seconds]
soliwilos has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
rohan has joined #kisslinux
* midfavila shrugs
soliwilos_ has joined #kisslinux
soliwilos has quit [Remote host closed the connection]
* midfavila shrugs
dilyn has joined #kisslinux
rohan has quit [Ping timeout: 256 seconds]
rohan has joined #kisslinux
chomwitt has joined #kisslinux
dilyn has quit [Quit: Connection closed]
soliwilos_ has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
* midfavila shrugs
chomwitt has quit [Remote host closed the connection]
<testuser[m]12> ¯\_(ツ)_/¯
<virutalmachineus> ¯¯¯¯_(0.0)_/¯¯¯¯
* midfavila shrugs
<testuser[m]12> ¯\_(ツ)_/¯
kinozawa has quit [Quit: Leaving the Cosmos...]
kinozawa has joined #kisslinux
* midfavila shrugs
soliwilos has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
<virutalmachineus> are you running a shrug script?
kinozawa has quit [Quit: Leaving the Cosmos...]
kinozawa has joined #kisslinux
* midfavila shrugs
soliwilos has quit [Ping timeout: 268 seconds]
soliwilos has joined #kisslinux
* midfavila shrugs
* midfavila shrugs
Torr has joined #kisslinux
midfavila has quit [Remote host closed the connection]
<ax> midfavila: interesting thought, I pretend that the choice of "ax" is generic as an example.
soliwilos_ has joined #kisslinux
soliwilos has quit [Ping timeout: 268 seconds]
rohan has quit [Ping timeout: 244 seconds]
soliwilos has joined #kisslinux
soliwilos_ has quit [Ping timeout: 268 seconds]
soliwilos has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
midfavila has joined #kisslinux
<midfavila> i just realized that when writing my implementation of cat i could have represented the "internal buffer" as the result of something similar to a recursive function call
<midfavila> at least in principle
<midfavila> "while input isn't exhausted, concatenate the result of reading the next file onto the result of concatenating the result of reading the next file onto..."
<midfavila> instead of taking the path i actually took which does a bunch of pointer bullshit to implement functions that continuously expand an array
<midfavila> . _.
soliwilos has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
rohan has joined #kisslinux
soliwilos has quit [Remote host closed the connection]
soliwilos has joined #kisslinux
<noocsharp> you shouldn't do that either, you should just open a file, dump to stdout, close it, repeat
<midfavila> posix requires that the default behavior be buffered output
<midfavila> -u needs to be supplied if unbuffered output is desired
<noocsharp> FILE has builtin buffering i believe
<midfavila> sauce?
<midfavila> i'd like to know if i wasted my time so i don't do it again in the future
<midfavila> i'd look at another implementation of cat but i'm trying to avoid contaminating my code
<noocsharp> -u just forces unbuffering
<noocsharp> it can be unbuffered by default, it's just not required to
<noocsharp> and i think i'm wrong actually that FILE is buffered by default
<midfavila> i don't think files are buffered by default
<midfavila> they're just a stream of bytes terminated by eof
<noocsharp> i'm talking about the libc FILE abstraction
<midfavila> and i mean, fair enough on the not being required bit
<midfavila> yes, I figured
<midfavila> anyway, required or not, it's an option and i wanted to implement it
<midfavila> i needed the practice with pointers
<noocsharp> fair enough, but remember that it uses more memory than necessary
<midfavila> of course