Maja changed the topic of ##bash-crimes to: we bash back | club of folks preoccupied in whether they could, not whether they should | logs https://libera.irclog.whitequark.org/~h~bash-crimes
Tekk has joined ##bash-crimes
<engler> bonk
<domi> *yawn* i'm still dead after the event, sorry for being slow :)
<domi> panekj-: SOON
<domi> this has been actually on my todo list for a long time
<domi> fwiw i'd like to make a small cleanup in HTTP.sh before I do that, but... I could do both at the same time if I don't break any APIs <.<
<engler> the bash talk was very nice btw
<domi> thank you! :3
<Tekk> It was! That's how I ended up here
<Tekk> Y'all got me since I told my friend that I wouldn't consider it a systems language without pointers....then 40 minutes in "Oh btw bash has references" :D
<Maja> admittedly the talk title is somewhat clickbait because the claim is debatable at best
<Maja> but it's a good way of succintly describing the insanity of what it was actually about, so I don't feel bad about it
<Tekk> I didn't feel cheated by it
<Tekk> Especially if you write a bash interpreter in your microforth so it can run on bare metal :3
<Maja> lmfao
<Maja> I'd rather write an AOT bash compiler tbh
<Tekk> Somehow that feels worse
<Tekk> I love it
<Tekk> Oh! I actually had a question about the talk
<Tekk> I think there's still oss compat buried in alsa, that'd be easy to talk to from bash. Did you not look at it at all or was it just funnier to do pulse?
<Maja> not sure if the oss compat would be enabled on all kernel builds, though
<domi> yeah it's an explicit choice in menuconfig
<domi> https://f.sakamoto.pl/IwIjrnLXg.png altho it's apparently compiled-in by default in alpine's config
<domi> fwiw i kinda prefer just talking with ALSA directly. haven't tried either, but i doubt there would be many blockers :p
<Maja> on most modern setups talking directly to alsa is a pain
<Maja> because distros don't configure dmux by default
<Maja> as in, you need exclusive access to the output device
<domi> Maja: pipewire does some sort of alsa compat, so did pulse. looking at /etc/alsa/conf.d/, it seems that they're overriding everything to be passed through PW and then it uses some custom module
<Maja> ah, hm, i must be misremembering
<domi> if you're doing raw alsa without pw/pulse then you likely figured out dmix for yourself :p
<domi> (or you have hw dmix, mmmm)
<domi> still, in 2024AD i feel like pulse's socket may be a more future-proof way to do audio playback
<domi> unrelated to anything: eh, i wish there was a way to do cross-platform bash modules. I want to write bash extensions so badly, but them needing to be an architecture-dependent shalib kinda breaks the mood of "write once, copy wherever, it'll work if you wrote it well enough"
<domi> what in the cinnamon toast did i just find https://module.sh/
<domi> another RCE-as-a-service
<Maja> just invoke cc.sh before loading your module /hj
<domi> i would be tempted to add a codegen for more than one arch for this /hj
<domi> (from arches i care about: amd64, various flavors of ARM, i686, RISC-V. in most-least order, for now)
<Maja> re: module.sh, ...
<Maja> that checksum doesn't look cryptographically secure
<domi> Maja: the concept is cool, I think!
<domi> the execution tho..
<domi> last scripts in the repo are from 4 years ago
<Tekk> domi: just compile your bash functions for 386 then open in a hex editor and put a shebang for qemu-i386 in there :)
<domi> it tries to do sane things, but fails in so many ways omfg
<domi> Tekk: :^)
<domi> ... i mean, honestly, this does sound like something i'd do
<tastytea> no need to edit the shebang, qemu can be registered as a handler in the kernel via binfmt
<domi> related cursed idea: polyglot binary that's both a valid MBR and a shell script that launches qemu to start the system from that MBR
<domi> hard mode: x86 emulator in bash instead of qemu ;p
<domi> tastytea: TIL
<Tekk> I mean given how many risc-v and mips emultors I've seen in perl
<Tekk> and I think even awk
<Tekk> tastytea: Don't you have to configure your binfmts at build time though? I remember doing that for wine once
<tastytea> hehe
<Maja> re: polyglot binary. have you seen Actually Portable Executables?
<domi> ... so I have an in-progress 6502 emu in bash
<domi> i gotta finish that sometime
<Tekk> You should
<tastytea> Tekk: you can register them at boot AFAIR
<domi> i'm 1/3 through the instructions, but i'm doing the hardcore route of implementing other hw related to the NES/famicom as I go :p
<domi> also it's really really really slow. i'm thinking about writing a 6502->bash transpiler at some point XD
<domi> Maja: wonderful, thank you
<domi> > If you're on Windows, try renaming bin/make to bin/make.exe and run that. Then rename it back
<domi> i'm delighted
<Tekk> Nah, go the other way. Make your AOT compiler compile to 6502, then feed it through the 6502 bash emu :3c
<domi> :D
<domi> that sounds hilarious
<domi> this is cool
<Tekk> Hmmm
<Tekk> Ahh, playing with the binfmt?
<Tekk> making it point to /tmp/meow.sh
engler has quit [Quit: Relax and enjoy your hobbies.]
engler has joined ##bash-crimes
<domi> Tekk: correct, that was just `echo ':meow:M::uwu::/tmp/meow.sh:' > /proc/sys/fs/binfmt_misc/register`
<domi> idk if i'll ever have any use for this, but it is Neat™