💾 Archived View for gemini.ctrl-c.club › ~phoebos › logs › kisslinux-2021-06-01.txt captured on 2024-05-10 at 14:24:58.
⬅️ Previous capture (2021-12-17)
-=-=-=-=-=-=-
[2021-06-01T00:01:47Z] <noocsharp> there's a rather large button on your keyboard that would make your code more readable [2021-06-01T00:11:29Z] <midfavila> ...of course, the enter key! [2021-06-01T00:20:25Z] <acheam> you have clang installed? [2021-06-01T00:20:53Z] <midfavila> i do not. [2021-06-01T00:21:18Z] <acheam> oh [2021-06-01T00:21:24Z] <midfavila> why? [2021-06-01T00:21:37Z] <acheam> clang-formay [2021-06-01T00:21:45Z] <acheam> s/y/t/g [2021-06-01T00:21:56Z] * midfavila shrugs [2021-06-01T00:22:17Z] <june> clang-formy [2021-06-01T00:28:35Z] <noocsharp> eww, clang-format uses java style by default [2021-06-01T00:28:50Z] <midfavila> even more reason to avoid it [2021-06-01T00:29:19Z] <midfavila> one of these days I'm just gonna put an entire program on a single line, and make it return random numbers as exit codes [2021-06-01T00:29:44Z] <noocsharp> have you seen those code obfuscation contents? [2021-06-01T00:29:52Z] <midfavila> yeah, a few entries [2021-06-01T00:29:53Z] <noocsharp> contests* [2021-06-01T00:30:22Z] <midfavila> someone once wrote a flappy bird clone in C and formatted it to actually look like the bird. [2021-06-01T00:32:29Z] <noocsharp> yeah, people do some insane stuff [2021-06-01T02:04:59Z] <rio6> the land of ioccc [2021-06-01T03:10:59Z] <acheam> does anyone know why this script script would work in busybox ash, and bash, but not in dash? [2021-06-01T03:11:20Z] <acheam> https://git.armaanb.net/bin/tree/setter [2021-06-01T03:11:53Z] <acheam> in dash it gives " [: unexpected operator]" for the tests in lines 5, 9, and 22 [2021-06-01T03:14:51Z] <june> acheam: == is not a standard test(1) operator [2021-06-01T03:14:57Z] <june> the operator is = [2021-06-01T03:16:11Z] <acheam> ah thank you! [2021-06-01T03:16:16Z] <acheam> how confusing... [2021-06-01T03:24:35Z] <illiliti> '[[' is not portable too [2021-06-01T03:25:00Z] <illiliti> just do: amixer sget Master | tail -n 1 | grep -q "off" && ... [2021-06-01T03:26:25Z] <noocsharp> im unironically beginning to believe that templeos' command line is better than unix [2021-06-01T03:30:55Z] <acheam> illiliti: oops I thought I removed all of the '[['s thanks! [2021-06-01T03:33:09Z] <acheam> noocsharp: how so? [2021-06-01T04:18:13Z] <noocsharp> acheam: "commands" are just function calls [2021-06-01T04:18:50Z] <noocsharp> you get the flexibility and power of a real programming language [2021-06-01T04:24:22Z] <acheam> hmm interesting [2021-06-01T04:24:49Z] <noocsharp> it would be like using python as a shell, except closer to the metal [2021-06-01T04:26:46Z] <acheam> xon.sh [2021-06-01T04:28:15Z] <acheam> I'd use it if it weren't so damn slow to launcy [2021-06-01T04:28:30Z] <acheam> and just slow in general [2021-06-01T04:29:35Z] <noocsharp> i shouldn't have said python: it would be more like using c with a repl [2021-06-01T04:29:44Z] <noocsharp> but interpreted like python [2021-06-01T04:30:00Z] <noocsharp> and substantially faster, because it's c [2021-06-01T04:30:32Z] <acheam> thats cool [2021-06-01T04:30:45Z] <acheam> not exactly the same thing, but you light like picoc [2021-06-01T04:30:45Z] <noocsharp> so the entire system uses the same language for everything [2021-06-01T04:30:54Z] <acheam> thats hot [2021-06-01T04:32:04Z] <noocsharp> if you haven't seen templeos in action, you should check out some videos of terry davis [2021-06-01T04:32:10Z] <noocsharp> it's pretty amazing [2021-06-01T04:32:23Z] <acheam> ive seen bits here and thete [2021-06-01T04:32:29Z] <acheam> just never dove under the hood [2021-06-01T04:35:47Z] <noocsharp> the templeos kernel code seems like a good educational resource because of how simple it is [2021-06-01T04:36:40Z] <noocsharp> it is far more kiss than kiss [2021-06-01T04:43:04Z] <acheam> how's nvidia support tho [2021-06-01T04:43:24Z] <acheam> and I gots to have my ac wireless [2021-06-01T04:48:04Z] <testuser[m]_> hi [2021-06-01T05:24:46Z] <acheam> hello testuser[m]_ [2021-06-01T13:52:29Z] <nerditup> o/ [2021-06-01T13:54:25Z] <omanom> \o [2021-06-01T14:07:16Z] <sad_plan> shiet, this LTO stuff is going to take forever. gcc alone been compiling for roughly around 1.5hrs already :p compiling the rest of the system aswell is going to take foreveeer [2021-06-01T14:10:11Z] <acheam> nerditup: were you able to get sr.ht up? [2021-06-01T14:12:21Z] <testuser[m]_> sad_plan: only pgo stuff takes longer [2021-06-01T14:12:27Z] <testuser[m]_> thats lkike 5 packages [2021-06-01T14:12:59Z] <testuser[m]_> 3* excluding gcc [2021-06-01T14:13:43Z] <sad_plan> aah ok. I was worried there for a sec, thinking about rust and firefox, which already takes really long time already. [2021-06-01T14:14:04Z] <sad_plan> what is this pgo stuff anyway? [2021-06-01T14:14:17Z] <testuser[m]_> ff is with pgo so it takes 2x time, but you can disable it and just go for LTO [2021-06-01T14:14:49Z] <testuser[m]_> you build a program to generate profile data into a directory, then compiler uses it to optimize hot code paths better [2021-06-01T14:14:50Z] <testuser[m]_> basically [2021-06-01T14:15:06Z] <testuser[m]_> its a noticeable difference on large programs like gcc [2021-06-01T14:15:13Z] <sad_plan> great [2021-06-01T15:48:43Z] <midfavila> noocsharp of course templeOS' command interface is superior [2021-06-01T15:48:53Z] <midfavila> it's far more flexible and just *capable* [2021-06-01T15:55:48Z] <omanom> KISS Temple when? [2021-06-01T15:55:56Z] <noocsharp> acheam: templeos supports neither graphical accelerate nor wifi [2021-06-01T15:56:03Z] <noocsharp> nor internet for that matter [2021-06-01T15:57:56Z] <testuser[m]_> nice [2021-06-01T16:13:14Z] <june> noocsharp: are those bad things? [2021-06-01T16:13:37Z] <june> what has graphics acceleration and internet ever done for us [2021-06-01T16:13:53Z] <claudia> good point [2021-06-01T16:35:14Z] <illiliti> guys, how do you concat strings in C? would like to hear your opinions [2021-06-01T16:42:37Z] <soliwilos> I'm a noob, but there's the strcat() function. [2021-06-01T16:44:15Z] <illiliti> unfortunately, strcat() is unsafe [2021-06-01T16:46:53Z] <testuser[m]_> strlcat from *bsd? [2021-06-01T16:47:09Z] <testuser[m]_> just put it in a .h file instead of adding dep on libbsd [2021-06-01T16:56:00Z] <illiliti> yeah, i considered strlcat [2021-06-01T16:56:15Z] <illiliti> until i saw memccpy [2021-06-01T16:56:53Z] <illiliti> which is defined by XSI(POSIX) [2021-06-01T16:59:50Z] <june> ime there is rarely a good use of str*cat [2021-06-01T17:00:37Z] <june> for example if it's called in any kind of loop, it's accidentally quadratic [2021-06-01T17:00:43Z] <illiliti> probably i'll have to roll my own concat func with variadic params, bell and whistles [2021-06-01T17:00:58Z] <june> have you tried snprintf? :P [2021-06-01T17:01:08Z] <illiliti> yes [2021-06-01T17:01:09Z] <midfavila> "Quadratic"? [2021-06-01T17:01:23Z] <illiliti> snprintf is inefficient [2021-06-01T17:02:14Z] <june> midfavila: https://en.wikipedia.org/wiki/Time_complexity#Table_of_common_time_complexities [2021-06-01T17:04:24Z] <june> illiliti: how so? [2021-06-01T17:06:18Z] <midfavila> hmm. i'll have to read more about that, june. thanks [2021-06-01T17:07:13Z] <june> basically if you're calling strlcat in a loop, it gets slower and slower the more you do it [2021-06-01T17:07:48Z] <illiliti> same thing with snprintf [2021-06-01T17:07:58Z] <illiliti> snprintf is even slower than str* [2021-06-01T17:08:17Z] <june> snprintf doesn't inherently get any slower if you use it properly [2021-06-01T17:09:27Z] <june> the problem with strlcat is that it contains an implicit strlen call [2021-06-01T17:09:31Z] <testuser[m]_> is there some smaller function than strlcat/snprintf if you just need to add a single char to a char array ? [2021-06-01T17:09:59Z] <june> sure, arr[i++] = c; [2021-06-01T17:10:35Z] <testuser[m]_> thanks [2021-06-01T17:10:41Z] <testuser[m]_> howndid i forget that [2021-06-01T17:12:37Z] <illiliti> june: i don't think that using it "properly" will help. if you have a lot of strings that you need to concat, snprintf is slower than anything [2021-06-01T17:13:08Z] <june> based on what? [2021-06-01T17:14:21Z] <noocsharp> june: i never said they were bad, but acheam asked about it [2021-06-01T17:15:32Z] <omanom> with the noted caveat that i am probably the worst when it comes to optimizing... at what threshold of "slower" does it actually matter? is it just purely a best-performance-possible thing, or is the use case driving the need for speed? [2021-06-01T17:18:03Z] <illiliti> june: snprintf(buf, sizeof(buf), "%s/%s", "/sys/", class); << this is used in lots of threads and definitely slower than chainsaws like memcpy [2021-06-01T17:18:29Z] <illiliti> i agree that snprintf gives best safety with average performance [2021-06-01T17:18:41Z] <noocsharp> snprintf is what i always use in that scenario [2021-06-01T17:18:54Z] <noocsharp> it's fast enough :> [2021-06-01T17:19:06Z] <illiliti> but i need excellent performance with excellent safety [2021-06-01T17:19:16Z] <illiliti> snprintf is slow in my case [2021-06-01T17:19:49Z] <noocsharp> probably best to roll your own then, i don't know of anything like what you want in libc [2021-06-01T17:20:27Z] <june> lol you really need to be concatenating /sys/ onto the beginning of a string a trillion times per second? [2021-06-01T17:21:12Z] <june> seems unlikely that's ever going to be the performance bottleneck [2021-06-01T17:22:03Z] <midfavila> algorithms are funky... [2021-06-01T17:22:10Z] <omanom> is there a way to ensure calls to strcat() are done safely? like a safety blanket? [2021-06-01T17:22:44Z] <june> sure, if you check your own bounds beforehand [2021-06-01T17:23:18Z] <illiliti> june: lol yes [2021-06-01T17:23:25Z] <illiliti> memccpy is almost what i'm looking for [2021-06-01T17:32:13Z] <zr> illiliti: You probably shouldn't be using ASCIZ strings for non-trivial applications [2021-06-01T17:32:43Z] <zr> That kind of performance is hard to avoid with those kinds of data types [2021-06-01T17:33:02Z] <zr> I'd use something like `struct { char *data; int sz; };` for strings [2021-06-01T17:33:08Z] <illiliti> yeah [2021-06-01T17:33:41Z] <june> s/int/size_t/ [2021-06-01T17:33:44Z] <zr> antirez has a good lib for this http://www.google.com/url?q=https://github.com/antirez/sds&sa=U&ved=2ahUKEwiN2o7m-_bwAhVFElkFHeBYBLcQFjAAegQIAhAB&usg=AOvVaw0X8zEfkjcIqzWFAssZmQgJ [2021-06-01T17:33:46Z] <zr> fuck [2021-06-01T17:33:57Z] <zr> https://github.com/antirez/sds [2021-06-01T17:34:04Z] <zr> yeah, size_t, not int [2021-06-01T17:34:10Z] <midfavila> you've been exposed as a google user [2021-06-01T17:34:11Z] <omanom> typical corporate shill behavior, geez zr don't be so transparent [2021-06-01T17:34:22Z] <zr> :C [2021-06-01T17:34:25Z] <midfavila> burn the heretic [2021-06-01T17:34:43Z] * zr equips cloak of fire resistance [2021-06-01T17:35:03Z] * midfavila equips Torch of Op-Burning +3 of Fire [2021-06-01T17:35:35Z] <illiliti> fuck, what the hell ipv6 isn't available on k1sslinux.org [2021-06-01T17:35:47Z] <midfavila> ipv6 is cringe [2021-06-01T17:35:48Z] <zr> smh where is that slacker of a bdfl [2021-06-01T17:35:52Z] <midfavila> embrace trad ipv4 [2021-06-01T17:35:59Z] <illiliti> midfavila: you're cringe [2021-06-01T17:36:04Z] <midfavila> fight me [2021-06-01T17:36:06Z] <midfavila> rn [2021-06-01T17:36:27Z] <testuser[m]_> no [2021-06-01T17:36:33Z] <midfavila> c r i n g e [2021-06-01T17:36:47Z] <midfavila> let me guess, you use *words* to solve conflict *peacefully* [2021-06-01T17:38:17Z] <illiliti> no, i'll send you a box with bomb [2021-06-01T17:38:33Z] <midfavila> joke's on you, my mailbox isn't large enough to fit a bomb [2021-06-01T17:39:04Z] <midfavila> ...I mean, unless it was C4 or something. I guess you could rig a detonator. [2021-06-01T17:39:15Z] <midfavila> ...hmm... [2021-06-01T22:53:44Z] <midfavila> >finally acquire phantom power supply and not-shit condenser mic [2021-06-01T22:53:53Z] <midfavila> >the phantom power supply expects two mic inputs [2021-06-01T22:54:04Z] <midfavila> >mfw mic can only pass a single audio channel through to my PC because of this