klange changed the topic of #osdev to: Operating System Development || Don't ask to ask---just ask! || For 3+ LoC, use a pastebin (for example https://gist.github.com/) || Stats + Old logs: http://osdev-logs.qzx.com New Logs: https://libera.irclog.whitequark.org/osdev || Visit https://wiki.osdev.org and https://forum.osdev.org || Books: https://wiki.osdev.org/Books
<kaichiuchi> I sound like him
<kaichiuchi> apparently.
<zid> an ambiguous finnish accent?
<kaichiuchi> no, more or less just a complete asshole
<zid> linus doesn't sound like an asshole
<zid> he's very nice and well spoken
<kaichiuchi> put it this way
<zid> he sometimes swears in emails, oh no
<zid> I swear at cutlery
<kaichiuchi> the way he used to act, on IRC and in some various open source circles it'd be mostly okay
<zid> wtf why are there fireworks going off
<kaichiuchi> but then people got fed up with him
<heat> english new year
<zid> There's 31 days in every decemer right
<kaichiuchi> I think it was more or less coming close to telling people to commit suicide
<zid> there's not leap decembers
<pog> there's only 29 this december
<pog> you didn't get the memo?
<zid> They're a day late then
<heat> england is 2 days ahead of everyone
<heat> UTC+48
<kaichiuchi> i.e. did not seem to realize that his words, as a person of influence, have influence and he needs to be careful
<heat> yo wtf i've got fireworks here too
<kaichiuchi> i would never want to be well known
<heat> zid, you around?
<kaichiuchi> imagine the freedoms you'd lose
<zid> heat: yea hi that's me sorry
<zid> I was firing back
<heat> with your gun?
epony has joined #osdev
<zid> you mean my american can opener?
<heat> idk is that your 50 cal or your 44 cal?
<zid> 45 acp
<zid> The 50 cal is for driving nails
<bslsk05> ​lkml.org: LKML: Linus Torvalds: Re: [Regression w/ patch] Media commit causes user space to misbahave (was: Re: Linux 3.8-rc1)
<kaichiuchi> classic but it's brutal
<zid> this is.. brutal?
<zid> "I'm angry because you're responsible for a lot of stuff and this is obviously crap"
<kaichiuchi> being linus torvalds and publicly telling someone to shut the fuck up such that when a future employer googles them that might be one of the first things they see?
<kaichiuchi> yeah that's pretty bad
<zid> I'll discord you an alternative
<kaichiuchi> sure
<bslsk05> ​lore.kernel.org: Re: [syzbot] WARNING in do_mkdirat - Al Viro
<heat> by far my favourite
<zid> heat: have you ever kissed a girl?
<zid> Is my favourite.
<mjg> calm down sir
<zid> Mainly because it was a pathetic clapback to getting owned
<bslsk05> ​yarchive.net: Extreme system recovery (Al Viro)
<mjg> zid: that is a classic
<zid> I just tell the girls about my argument packets
<zid> and my struct task *task asm("r12")
<mjg> dude i got to the club with my commit count on my bicep
<kaichiuchi> there is something I will say right away
<kaichiuchi> a lot of people are too touchy
<heat> yo girl dm me at mjg@freebsd.org
<kaichiuchi> I was on the C++ discord one day
<zid> That's a red flag to begin with
<zid> Clearly going to be full of people with troubled pasts
<mjg> > C++
<mjg> > discord
<zid> and worrisome futures
<mjg> is that a double negative?
<kaichiuchi> i don't quite remember what happened, but like 4 people got instantly banned
<zid> I assume thy get enough traffic
<zid> that they can filter for quality users
<zid> as in, higher quality than all caps shouting racist abuse
<zid> which actually is allowed here for about 3 weeks before geist finally bans them
<kaichiuchi> the most I remember is someone saying that dogs are pure at heart and become attached to good people, only for someone to point out that hitler's dogs loved him
<kaichiuchi> that entire conversation was scrubbed
<zid> haha I got banned from WoW for 3 days for saying something similar
<zid> nuance takes effort
<kaichiuchi> the whole default git branch thing on github also really annoys me
<zid> yea I disabled that
<zid> faux corporate wokism
<kaichiuchi> no one once thought ever that "master" in a git branch had a connotation with racism
<kaichiuchi> until someone suddenly decided that it did
<kaichiuchi> ironically, some of these people have master's degrees
<clever> i always force my default branch back to master
<zid> like nike hiring famous gay people for ad campaigns while having factories in muslim countries or whatever
<mrvn> kaichiuchi: yes, master, whatever you say, master
<clever> kaichiuchi: what are the pins in an SPI port called? :D
<zid> "look, we care about things!"
<clever> MISO and MOSI?
<zid> miso and mosi or rx and tx, everything else is illegal
<clever> zid: rx isnt clear, rx from which viewpoint?
<zid> rx and tx stand for racially execute and transgirl execute
<clever> ive seen some uart adapters mislabel rx and tx, so idiots can wire rx->rx and it works
<kaichiuchi> the problem that I have is that these people have mostly proliferated some of the most well known open source projects
<zid> I actually hate battery markings for that same issue
<kaichiuchi> creating problems where quite literally none existed
<kaichiuchi> code of conduct makes me laugh
<zid> It's just very hard to argue against
<zid> It puts you on "the other side"
<kaichiuchi> yes
<zid> rather than "This is not a debate, you're an idiot"
<kaichiuchi> now if you say that you want your branch name to be "master"
<kaichiuchi> you're racist
terminalpusher has quit [Remote host closed the connection]
<kaichiuchi> there's no sidestepping that conclusion if the premise was "we're trying to eliminate possible racist connotations"
<zid> It's racist to insist it's a racist term, as slavs are white, qed.
<clever> my dad said 1 wrong word on facebook, "id hit that a$$", hit is encouraging violence, ban!
<clever> he is now on a watchlist, and gets banned every week for the littlest things
<kaichiuchi> I also just don't believe, ironically, that these people are good people
<zid> nah your dad just isn't telling you about the groups he joined
<heat> why did your dad say that
<clever> heat: because somebody posted a photo of a hot woman
<heat> <heat> why did your dad say that
<clever> i dont know, lol
<kaichiuchi> someone who is afraid of words, and is in some type of position of power is dangerous
<zid> kaichiuchi did you read my discord message
<kaichiuchi> yes
<mjg> > There is an active and welcoming OS development server on Discord with hundreds of members. The server is not affiliated with this OSDev.org.
<kaichiuchi> i understand where you're going with that
<zid> you didn't respond
<kaichiuchi> sorry :(
<zid> That was 4/10 power level, so the orginal is NOT brutal
<mrvn> kaichiuchi: there are some solids papers published that show that the more you eliminate stuff like racism them more people get offended by "racist" terms
<clever> mjg: one of the mods on that server has also been rather abrasive in the past
<mrvn> like suddenly things are racist
<clever> mjg: claiming everything i say is wrong, offering no proof otherwise, and then using his mod powers to rename me to `not so clever`
<mjg> maybe patch wiki? :p
<pog> meow
<mjg> loller
<kaichiuchi> what kills me is these are people who would not hesitate to burn auschwitz to the ground, and bury any knowledge that naziism actually happened
<mjg> also lol @ hitler vs dogs remark, it is the same i'm making
<zid> pog when are you sending me pictures of trees
<heat> holy shit lmao
<clever> he is no longer a mod, but i think he chose to step down, rather then was "fired"
<mjg> clever: maybe he was "asked"
<zid> clever: I'd ban you from my discord for your then/than issue
<zid> It's not abusive if it's hampering communication, that's my excuse.
<mrvn> mjg: voluntold
<pog> nah the people that want to destroy the evidence of the holocaust are fash
<clever> zid: lol
<pog> fuck them
<pog> punch them in the face
<kaichiuchi> pog: yes, that's my point
<heat> ok im gonna have to play the boring part
<zid> we had a world war about whether it's okay to punch nazis in the face
<zid> we won so yes it is
<heat> can we go like remotely on-topic
<pog> yes
<mjg> +88
<kaichiuchi> DOS!
<heat> pogger
<zid> heat I asked you to go on topic and you said no
<kaichiuchi> OS/2!
<pog> operating systrsems development
<clever> pog: the RPF forum mods have sometimes been accused of the same
<mrvn> heat: I'm not sure. can we?
<kaichiuchi> C++
<zid> You were supposed to not rm -rf boros
<mjg> so what do you guys think about rust
<clever> pog: one mod made a mistake moving a thread, and wound up appending to another and necro'ing the thread
<kaichiuchi> also __attribute__((flatten)) is so goddamn good
<zid> pog: I finally commited a branch of boros with a pirated gameboy rom in it so now you can watch it play zeldo
<zid> heat: did it get any fps on your machine?
<mjg> anyone got a post-hello world kernel in it?
<clever> pog: i defended that user, claiming i saw the post in another thread
<mrvn> kaichiuchi: what does that do?
<pog> nice
<heat> mjg, fine language, annoying people, takes long to compile
<heat> zid, fps?
<clever> pog: i was then banned for 24h for arguing with mods, and my defense statement was deleted :P
<zid> heat: famines per speculum
<heat> im afraid not
<clever> pog: and the user in question was also banned, for something he didnt do, something a mod did to him :P
<heat> mjg, yeah Mutabah has one
<kaichiuchi> mrvn: consider 3 functions A B and C, and you call them in function D; A, B, and C will be inlined in D, but they will not be inlined elsewhere unless the compiler makes that determination
<zid> dang did you try -kvm, I can run it fullspeed in tcg
<zid> in kvm it just turns into a blur
<pog> i haven't worked on my kernel code in a minute
<bslsk05> ​thepowersgang/rust_os - An OS kernel written in rust. Non POSIX (42 forks/617 stargazers/NOASSERTION)
<clever> pog: all evidence in his favor was silenced, and mod-a didnt know what mod-b did, and assumed the non-mod users where in the wrong
<heat> pog, come work on my kernel code
<pog> no
<heat> why not
<pog> i'm gonna write a rust kernel
<kaichiuchi> so it's useful perhaps if you have both cold and hot code that make use of functions A, B, and C
<zid> I think I just threw up in my mouth a little
<pog> all the gals are using rust these days i want to be cool like them
<kaichiuchi> but in the cold case you don't want to inline
<heat> but this is C++
<heat> everyone likes C++ right
<pog> c++ isn't cool anymore
<zid> oh wow
<mrvn> heat: we all switched to cpp2
<zid> mapping takes FOREVER with accel=kvm
<zid> is this the bug you were talkin about heat
<zid> It takes 30 seconds to boot instead of 0.03
<heat> i even have glibc man
<geist> Hmm what does?
<heat> join meee
<zid> qemu on new kernels
<heat> zid, hmmmmmmmm
<heat> possibly
<geist> Running what?
<heat> can you perf record and tell me if migrate_pages is on top?
<zid> my bootloader is mapping some phys memory in, with accel=kvm it's not done, with tcg it's instant
<zid> tell me what command to run
<kaichiuchi> hm
<heat> sudo perf record when shit goes south
<geist> Ah interesting are you dojng tlb invalidates?
<kaichiuchi> you can’t have static variables in constexpr functions
<zid> no
<kaichiuchi> not until C++23
<kaichiuchi> :(
<heat> geist, it looks to be intense page migration and thrashing
<geist> Hmm
<heat> I think it's related to the MGLRU changes
<heat> (or maybe maple?)
<zid> should I bisect it
<zid> I know 5.13 is good, 6.11 is bad
<heat> you should see if you actually have the same issue
<epony> only if it's an Emasconfig
<zid> >>>>>>>>>>>>>>tell me what command to run
<heat> <heat> sudo perf record when shit goes south
<mjg> > if self.0.len() > 0 {
<mjg> dafuq
<zid> emerge perf?
invalidopcode has quit [Remote host closed the connection]
<bslsk05> ​github.com: rust_os/path.rs at master · thepowersgang/rust_os · GitHub
<heat> zid, mayb
<mjg> oh sorry, you guys are actually chatting
invalidopcode has joined #osdev
<epony> about rust, all the time
<zid> perf is from perf, not oprofile or profile-tools or something?
<heat> should be perf
<zid> dev-util/perf exists
<zid> let's try that
<mjg> depends on distro
<zid> ergh my VM is super slow in general now
<mjg> maybe linux-tools or similar
<geist> Maybe it's having some kvm issues?
<zid> yea I think I have my tlbs back now
<geist> Like is it actually getting the full feature set
<zid> installing sys-process/time
<zid> I didn't have time before apparently
* mjg glares at zid
<zid> I had it as a shell command, idk what /usr/bin/time is
<zid> what do I do with eprf.data
* mjg glares at zid
<mjg> perf report
<zid> 83.78% swapper
<pog> i don't believe in time
<zid> acpi_idle_do_entry
<mjg> what you most likely want instead mofo is git clone https://github.com/brendangregg/FlameGraph.git
<epony> therefore you exist solely in a vm simulation (there is not concept of time uniformity there)
<heat> yo your machine still uses acpi_idle?
<heat> mjg, doesn't help if thrashing swap
<mjg> and then read stackcollapse-perf.pl
<zid> It isn't a real machine
<pog> wait isn't time a bash builtin
<zid> that's what I said
<pog> oh you said that
<mjg> pog: it often is a shell builtin
<pog> disregard me i'm very blonde today
<mjg> but cmon man, it is a standalone program when you rae not looking
<epony> discover the granularity of microtime and picotime
<pog> no thanks
<geist> this is the older nehalem based xeon or did you get an upgrade?
<epony> did you know that the kernel actually ticks at 1kHz ;-)
<zid> I've never owned bahealemen anything
<zid> I went from p6 to core2 to sandy
<epony> you should have went to amd cpu by time of renewal after p55c
<epony> the segment intel was holdign well was the ulv with the atom
<epony> (and the xeon's of course, but these are expensive and do not get you much advantages for personal and small business computing)
<bslsk05> ​'OSDev Discord admins being openly racist (try not to cringe challenge)' by AnErrupTion (00:13:37)
<Mutabah> mjg: Questioning the meaning of that line (the link to my repo above)?
<mjg> Mutabah: i don't know almost any rust yet, looks pretty wird
<Mutabah> `Path` is a "tuple struct", the `.0` accesses the first field of the struct, i.e. the contained `ByteStr`
<mjg> that much i figured, but what's up with .len on it
<Mutabah> Getting the length :)
<Mutabah> A method call
<heat> >methods
<mjg> of the entire thing?
<heat> mjg has quit
<mjg> self.len would not work?
<Mutabah> Of the ByteStr
<Mutabah> `Path` (as implemented there) doesn't have a `len` method
<mjg> is this the rust way? not self.realpathbro.len?
<Mutabah> (It could, but its implementation would just be `self.0.len()`)
<mjg> i mean the self.0. bit looks like a total hack from over here
<Mutabah> `Path` is a wrapper around a `ByteStr`, that changes the behaviour a little bit
<mjg> so this is the idiomatic approach?
<Mutabah> Yes*
<Mutabah> * this is the implemenation of `Path`'s methods - code outside that file cannot see that `Path` contains a `ByteStr`
<mjg> i'm even less fond of how the code looks like
<Mutabah> So only code in this file will be doing the `.0`
<Mutabah> It could be `struct Path { inner: ByteStr }` and `self.inner` instead
<kaichiuchi> more rust
* kaichiuchi cry
<pog> i changed my mind i'm not learning rust
<heat> circlejerk becomes realjerk
<mrvn> don't you wish you could just export the structs size and alignment requirements without exposing the inner: ByteStr?
<Mutabah> mrvn: It's not exposed
<kaichiuchi> i don't want to learn rust because it will eventually fade
<Mutabah> kaichiuchi: everything fades eventually :)
<kaichiuchi> one day, tiny flames will dance across the darkness
<kaichiuchi> like embers linked by lords' past
<geist> mjg: if you're concerned about microptimizations, you probably wont be happy with rust
<mrvn> Mutabah: Then how does the caller allocate a Path on the stack?
<geist> it's better than you think, but i think there's a lot of work there, and/or a certain amount of 'to be safe you must spend more cpu/memory to do so'
<mjg> geist: we live in post-performance world man
<mjg> anyhow, i'm about to do some rust in userspace
<geist> indeed. however it's not terribad. my limited experience has shown that it's at least in the right ball park
<Mutabah> mrvn: Well, it's "exposed" in that way (to the compiler)... because it inherits the size/alignmemnt
<mrvn> .oO(How does the compiler put objects with >16 byte alignment on the stack anyway?)
<mjg> really dislike the syntax, but otherwise the lang seems to have legs
<geist> and some interesting optimization possibilities that it can do WRT exclusive ownership of things
<mrvn> Mutabah: the only way to expose that though is to tell the compiler what's inside.
<heat> isn't half the language syntax?
<Mutabah> mrvn: yes.
<mjg> geist: fwiw i did a quick check that atomic stuff compiles to sensible assembly in release mode
<geist> mrvn: re: aligment of things on the stack usually i see the compiler emit some sort of maskig based operation on the stack as it constructs the frame
<geist> ie, dynamically align SP to X and then allocate frame off that, etc
<mrvn> geist: so create a frame pointer with required alignment and then work from that?
<geist> yah
<mrvn> Hmm, "SP = SP & align_mask" should work too. no need for a frame pointer register.
<geist> right.
<mrvn> just needs a temp reg so it can later push the original SP
dude12312414 has joined #osdev
<geist> obviously it has to remember how to undo it, so it probably uses some sort of FP register in that case to put it back, right
<mrvn> On m68k you have the LINK opcode but that doesn't include alignment.
<geist> so it's generally not too bad. obviously it can waste up to the alignment - 1 amount of stack space but it does basically the more or less optimal solution
<heat> the compiler is pretty smart
<geist> given static codegen at least. if it re-laid out the frame it could obviously move things around, but it can't do that
<mrvn> geist: yeah. If it knew beforehand what aalignment the stack has then it could tweak the order of objects to make the big one fit.
<heat> have you seen the codegen for inline ASAN or ftrivial-auto-var-init?
<heat> it's nuts
<mrvn> It should also be rather rare. Objects with >16 byte alignment that you don't heap allocate should be rare. Only thing I can think of right away are page aligned IO blocks and they shouldn't be on the stack.
<geist> mjg: yeah my overall concern about rust is at the surface it seems to heavily rely on 'zero cost abstractions' in the form of aggressive cross module inlining
<mrvn> geist: doesn't every high level language nowadays claim zero cost abstractions?
<geist> and generics (ie, templates) abound. so i think it generally errs on the side of generating lots of code, including a lot of duplicate code
<heat> there are no zero cost abstractions
<kaichiuchi> it's zero cost abstraction when you have optimizations enabled*
<kaichiuchi> and even then it's sketchy
<bslsk05> ​'CppCon 2019: Chandler Carruth “There Are No Zero-cost Abstractions”' by CppCon (00:59:52)
<kaichiuchi> one must pray that the compiler is smart enough to weave its way through the oceans of madness
<geist> well, it's fairly close to C++ with LTO enabled in that regard. and also lots of rust is basically a template
<geist> so i find it a bit hard to justify it for space constrained systems, but then C++ has a similar problem in those cases too
<geist> but with C++ at least it's mostly 'opt in' in the sense tha tyou know when you're using a template
<geist> but i'm mostly talking out of by butt. i haven't writte enough rust yet to be an authority, just what i've observed in the parts i've fiddled with
<pog> rustrustrustrust
<geist> but so far the evidence is that idomatic rust relies on a lot of these abstractions as being just the norm
<geist> RUUUUUST
<geist> but i got my DE10-Nano today so that's mostly what i'm fiddling with today
<geist> and Rust and SystemVerilog are pretty much different universes
<pog> is gcc rust in mainline
<kaichiuchi> also
<mrvn> "But people are stupid, so accidents happen."
<kaichiuchi> one piece of advice I'm going to give you guys
<kaichiuchi> two 32" 4K monitors for programming is not as luxurious as one might think
<pog> i see ada, d, fortran, go and objc
<heat> gcc rust still sucks
<geist> kaichiuchi: indeed. i've settled on either a single 32" or a pair of 27"s
<geist> i think someone was saying gcc rust is more of a proof of concept at this point
<heat> geist, btw i got my glibc port going
<pog> i can only plug in one external monitor that works at an acceptable resolution
<geist> like it can compile most of std, or something
<geist> heat: oh? whats the report?
<pog> also it doesn't work with xorg. didn't try wayland
<kaichiuchi> the problem for me is most of what I do is on the left side, and I put a lot of docs on the right side
<geist> is it worth just going full on glibc if you have a not unix?
<kaichiuchi> but... it looks "far away"
<kaichiuchi> best way I can put it
<geist> right, hard to focus on all of it at once, and can actually cause neck strain to look around a lot
<kaichiuchi> yeah
<pog> i'd like a bigger monitor at work
<pog> a 4K 32
<pog> i often have three source files open at once and 1080p is a little crowded at the font size i like
<kaichiuchi> i used the monitor in landscape mode at one point
<kaichiuchi> that was much worse because of the height being so fucking big
<heat> geist, I don't know if its worth that much, but it does have a lot of solid abstractions over systemie things. it supports hurd and linux at the same time
<heat> as you may imagine, it doesn't really issue system calls directly much
<geist> yah and i know for example haiku (or even beos back in the day) use it
<heat> (outside of sysdeps/...)
<geist> yeah that *seems* like a generally good thing, especially if you're a not quite unix system
<geist> vs say musl. OTOH musl is somewhat smaller, more direct, so it's a different set of challenges
<heat> whether this can work for a non posix system, i don't know
<heat> you would maybe need to strip out any posix bits it has hanging around?
<geist> also build system: how easy is it to turn off parts of it
<geist> or is it pretty tightly gnarled up
<geist> say for the first pass just wanted say stdio and string, but wasn't understed in time or wide chars or whatnot
<geist> or network
<heat> oh I don't think it's that configurable
<heat> but the nice bit is that it's full of stubs for things you don't supply
<geist> noice
<geist> also it doesn't make a .a properly right? so you're pretty much signed up for dynamic loading
<geist> which frankly isn't a problem for me
<heat> it does make a .a
<heat> I statically linked my example prog
<heat> (it's large as shit)
dude12312414 has quit [Remote host closed the connection]
pog has quit [Quit: byee]
dude12312414 has joined #osdev
gog has joined #osdev
<heat> geist, are you actually considering using glibc?
* geist shrugs
<geist> lots of projects floating around, not enough time or energy
<geist> but maybe
<gog> nya
gog is now known as pog
<heat> it's a fun little thing
<heat> definitely more readable and "proper"
<pog> libc in assembly
<pog> optimized for one obscure implementation
<pog> like a cyrix 6x86 or something
nyah has quit [Ping timeout: 252 seconds]
<heat> i'm watching zid build kernels
<heat> 10/10
SGautam has quit [Quit: Connection closed for inactivity]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<zid> Heat's goose accent so think
<zid> super think
<heat> i can't believe you're british
<heat> you said you were english
<zid> oh no I did something bad
<zid> heat why does boros no longer boot
<zid> It used to
<zid> is it because I support acpi now? bad idea.
<heat> your whole setup seems to be crumbling
<zid> My setup is like 400 lines
<heat> i would advise 2L of spit and other undocumented sticky materials
<zid> have you actually looked at the *source* to boros? it isn't an OS where it thinks and it's doing things in the bg, and has interfaces and stuff
<zid> if you can see it doing a thing, that's what it's doing
<heat> i have
<zid> and it does 0 more than is needed to do that thing
<heat> great operating system
<zid> greater original operating system
<zid> GOOS
<heat> golang moment
<zid> we need an e
<zid> experience? experiment?
<heat> next time you hear me I'll do my best conservative prime minister accent
<heat> instead of the generic lazy american one
<zid> wait that was your american?
pog has quit [Ping timeout: 272 seconds]
<zid> sounded like goose
<heat> no you sound like goose
<heat> i sound like geese
<kaichiuchi> hi
<heat> hello kaichiuchi
<kaichiuchi> systemctl enable heat.service
<heat> log: bazinga
<heat> mjg, hello dear mjg
<heat> what would happen perf-wise if my memcpy just called a function pointer (that would dynamically be set based on cpuid)?
<zid> are you adding AVX SUPPORT
<heat> i'm unbreaking it for non avx2 platforms
<heat> such as god almight zid
<zid> https://www.youtube.com/watch?v=d_gQFDNAtF0 Here is your adding avx support music
<heat> almighty*
<bslsk05> ​'reBirth ft. Takeshi Saito | Made in Abyss: Wandering Twilight Ending (Ver. 1) (Extended Version)' by Sane Guy (00:29:24)
<bslsk05> ​'Trance - 009 Sound System Dreamscape' by Tranceluv (00:03:31)
<zid> Mine's longer look
<zid> just ask gog
<heat> gog not here
<heat> rip gog
<zid> went to bed
<zid> when she wakes up she can confirm that 29 > 3 for you
<heat> i like how we made 0 progress in that call
<zid> who the fuck was trying for progress
<heat> i was
<zid> but at least my mystery 5.13.0 kvm issue went away
<heat> you started showing off your things
<heat> which, fair enough, are cool
<zid> That's what everybody I've shown my thing to has said
<zid> "that's a cool thing"
<heat> i'm proud of you zid
<heat> despite you comparing me to weird water birds
<zid> goose will break your arm
<zid> don't disrespect goose
<heat> sure, they're still weird water birds
FreeFull has quit []
dude12312414 has joined #osdev
<zid> Just be glad you don't live in wales
<zid> or I'd call you a different animal name
<heat> you'd call me a wydayydahd
Turn_Left has joined #osdev
<zid> No, sheepshager.
<heat> ffycin defaid
<zid> how dare you
<zid> fodendo ovelha is what google thinks that says
<zid> verb and object are backwards maybe
<heat> yeah
<heat> google translate bad
Burgundy has quit [Ping timeout: 252 seconds]
<zid> I know a girl who speaks fluent welsh, sorta
<zid> fiance of a schoolfriend
<zid> fiancéeeée
<zid> I met her at a party she was very nice and we spoke about her welsh
Left_Turn has quit [Ping timeout: 256 seconds]
<zid> whether it was worth it because while welsh is fucking useless, if nobody learns it it'll stay useless, so she's sort of a sacrificial lamb to the welsh dragon
<zid> to revive the language
<heat> ooooooooooooh zid met a girl
radens has quit [Quit: Connection closed for inactivity]
<zid> she was already tamed, they don't let me near the wild ones in case I bite
<heat> the welsh dragon consumes the bones of its countrymen
<heat> it's literally nito
<zid> welsh dragon looks too polite to go around screaming
gorgonical has quit [Remote host closed the connection]
xenos1984 has quit [Read error: Connection reset by peer]
xenos1984 has joined #osdev
<kaichiuchi> i want donuts
<geist> DONUTS
<heat> donot
<heat> it seems that adding an extra branch selecting the impl doesn't affect performance
<heat> movq__has_avx@GOTPCREL(%rip), %rax
<heat> movl(%rax), %eax
<heat> cmp $0, %eax
<heat> je memset_sse2
<mrvn> perfectly predictable
<heat> yeah
[itchyjunk] has quit [Remote host closed the connection]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<heat> ok Onyx should work on < avx2 systems
<heat> it now requires SSE4
<heat> not a bad requirement, x86_64-v2
<zid> if I clone it will it build
<heat> if you get the proper dependencies and toolchain installed, yeah
<zid> I have: gcc
<heat> no work
<zid> okay then
<bslsk05> ​github.com: Nightly builds · heatd/Onyx@d50ed28 · GitHub
<heat> x86_64-onyx-linux or onyx-llvm-linux
<zid> what's the difference
<zid> I don't see either of those though
<heat> first one is gcc, the other one is clang
<heat> you should *after the warnings I need to fix*
<bslsk05> ​github.com: Onyx/install_ubuntu_deps.sh at master · heatd/Onyx · GitHub
<bslsk05> ​github.com: Onyx/main.yml at master · heatd/Onyx · GitHub
<zid> I won't be getting deps
<zid> just link me to an up to date iso at some point
<heat> ok I'll hand-feed you my local iso
<zid> not in fucking rar parts pls
<heat> actually i'll just wait for the CI builds
<heat> split(1) best utility
<klange> plz add utf-8 support to your terminal if you're going to have keys that spit out utf-8 qq
<heat> discord nitro going bankruptt
<heat> klange, utf8 is theoretically supported
<heat> with large quotes around theoretically
sympt9 has joined #osdev
<bslsk05> ​github.com: Page not found · GitHub · GitHub
sympt has quit [Ping timeout: 260 seconds]
sympt9 is now known as sympt
<moon-child> heat: careful with 'doesn't affect performance'
<heat> doesn't seem to*
<moon-child> sure
<moon-child> obviously doesn't show up in microbenchmarks. At scale you can have issues with aliasing
<moon-child> somewhat masturbatory, but I straight up overwrote the source to the avx2 thingy with the sse2 thingy early in boot :)
<heat> what
<heat> ah ok
<heat> well I can't do that in userspace can I :)
<moon-child> (hmmm, I guess I didn't know sse2 was baseline at the time)
<zid> bro
<moon-child> heat: why not?
<zid> why is there an iso in this iso
<moon-child> yo dawg
<moon-child> we put an iso in your iso
<heat> moon-child, because .text is RO (so I can't/shouldn't)
<zid> the iso inside the iso boots at least
<heat> I don't know what you're talking about zid
<moon-child> just mprotect it and then mprotect it back i promise no one will notice
<zid> wtf this this crazy keyboard layout lol
<zid> heat: the link you linked is an iso inside an iso
<zid> Onyx ISO.iso -> onyx.iso
<heat> zid, portuguese
<zid> ~ just totally dead key
<zid> ; sends like 3 ?
<zid> ' does too
<heat> it's not fully implemented
<heat> because I don't actually need fancy characters here
<heat> you're wrong zid, btw
<heat> you downloaded a zip that had an iso
<zid> yea is zip
<heat> >xab
<zid> you sent me that
<heat> give me a ping and I'll send whatever you want in split form
<heat> in 8MB chunks
<zid> I'm trying to find ; I had it a minute ago
<zid> ah there it is, <
<heat> it's on the right side of M
<heat> and just to be clear, this is the only right keyboard layout
<heat> all the other keyboard layouts are WRONG and WEIRD
<zid> ; (by pressing <) prints the prompt twice, pressing ; (which prints three ?) breaks backspace by one character
<heat> yeah because it's ç
<zid> doesn't run it as a command if I hit enter, I just can't hit backspace in order to clear the entire input visually
<zid> it prints more ? than exist
<heat> just enter
<heat> fucking hell
<zid> just enter what
<heat> just enter
<zid> I'm pointing out horrendous bugs
<heat> that will clear your ???
<zid> just enter works fine
<heat> I'm well aware of the sort of shitty bugs I have
<zid> even the overprinting bug?
<heat> they are very shitty
<heat> wait what?
<zid> it prints and backspaces unicode differently
<zid> so I can't clear the line with backspace
<zid> [root@Onyx] $ ?????????_ <--- I addd some ; then backspaced them 'all', cursor no longer moves left, three ? show up per ; hit, but I think your curcly-c is actually only two bytes, leading to the weird visual offset
<zid> each ; prints '???' and only accepts 2 backspaces to be removed from the internal buffer, but the onscreen buffer still has one ? left onscreen
<zid> oh and ctrl-r is reboot apparently? heh
<zid> fuck I wish I could find /
<heat> shift-7
<zid> WHAT, \ is on fucking backtick though
<zid> when lspci
<bslsk05> ​github.com: Onyx/vterm.cpp at master · heatd/Onyx · GitHub
<heat> ctrl-r doesn't crash here
<heat> zid, idk why do you need it
<zid> I wanted to see what hw it knew about and stuff idk
<klange> same, I just get ^R echoed, at least in dash
<zid> ah I had lost focus, that's a vmware hotkey, my bad, thought it was focusd
<heat> also do note that this build only includes my base OS
<heat> no fun ports
<klange> where's the fun ports build?
<heat> zid, e1000 or virtio-net work
<zid> it's e1000
<zid> maybe different sub-value
<heat> what devid?
<zid> >where lspci
<heat> (maybe I do need lspci)
<klange> e1000 does not work in qemu it seems, either, though virtio did
<zid> I know it's e1000 because it wrks in boros
<heat> hmm, may be broken
<zid> and boros ONLY supports e1000
<heat> klange, >where's the fun ports build
<heat> it's stuck in disk image format hell
<heat> what the fuck
<kazinsal> mmmmm, VMware PCI
<zid> okay the backspace issue is way more repeatable with tab key
<heat> what's wrong with your acpi tables?
<zid> it prints like 8 spaces but you can only backspace 1
<heat> i know
<zid> Okay so you know that bug then
<heat> I haven't found a way to fix that
<klange> ls vmware pci is _fun_
<heat> the tab issue is kind of annoying
<klange> oh dang I don't have vmware workstation player on the new desktop...
<zid> where is =
<heat> shift-0
<bslsk05> ​github.com: Onyx/vterm.cpp at master · heatd/Onyx · GitHub
<klange> This just reminds me I should probably invest some effort in switchable key maps for toaru...
<zid> just don't set the default to portugoose
<zid> I can deal with enUS
<heat> I can't
<zid> nice, I have pretty colours
<zid> I crashed it
<moon-child> pog
<zid> The pretty colours were a good warning sign I was overwriting lowmem
<zid> but I carried on
<zid> https://cdn.discordapp.com/attachments/417023075348119556/1058245298889162762/image.png When your ascii turns into this, maybe stop holding ctrl-v
<moon-child> did you p yet
<heat> is that onyx?
<zid> yea
<heat> fuck
<zid> okay so pwd and cd are shell builtins, but ls is not? I broke ls nicely
<heat> what's the repro?
<zid> pwd and cd still work
<heat> yeah it's a normal shell
<zid> heat: no buffer length check on shell's stdin
<heat> ah yes I know
<zid> I just held a, then got bored, and held ctrl-v
<heat> that's also "a problem"
<zid> fuck where is : god damnit
<zid> > okay
<zid> export PATH=/bin:/usr/bin hardest thing I ever typed
<zid> had to type export PATH)&bin>&usr&bin
<zid> cat /dev/random appears to be a hardlock
dutch has quit [Quit: WeeChat 3.7]
<heat> yeah found that bug
invalidopcode has quit [Remote host closed the connection]
<bslsk05> ​github.com: vterm: Fix infinite loop when finding bad codepoints · heatd/Onyx@addf621 · GitHub
<zid> is it blocking and then ignoring meh
<zid> ah codepoints
dutch has joined #osdev
<zid> it printed nothing so it didn't look like a hang
invalidopcode has joined #osdev
<zid> but I guess the buffer neer got chance to flush?
<zid> There that's my good deed for the day
<zid> Your iso is out of date.
<heat> it found a bad codepoint and printed ?, but then never set codepoint_length (so it's still 0)
<heat> /* We sub a 1 because we're incrementing on the for loop */
<heat> i += codepoint_length - 1;
<heat> i += -1; i++;
<heat> oopsie :v
<heat> seems like that fixed the ç crashes
<heat> it still doesn't render but that's none of my business
<heat> unicode me is on PTO
<zid> I lost my unicode code I don't know how
<zid> I wrote some braindead simple code for it at least
<heat> thanks for fuzzing my terminal
<zid> I have a screenshot of me printing hungarian text
<heat> deleting tabs is super hard btw
<zid> but no code
<zid> you have code that turns \t into 8 visual spaces right?
<heat> no
<zid> but leaves \t in the input buffer?
<heat> that's not what \t does
<zid> what's causing \t to print visual spaces then?
<moon-child> x += 8 - (x+1)%8
<zid> yea that
<moon-child> or sth like that iirc
<heat> \t aligns to a divisible-by-8 col
<zid> yes that
<zid> but anyway the point is
<zid> you just need a function that does the opposite of what adding special characters does
<heat> problem: the tty layer has no idea if you started to print on col 0 or col 100003232
<moon-child> I guess you can just say x+=8; x&=~7
<zid> if backspac removes \t it needs to move the cursor in a special way
<zid> if I press £ and it adds two bytes to the buffer, and backspace deletes 2 bytes, it needs to move cursor 2
<heat> the alignment is done by the vterm, the tty input buffer just gets a \t
<zid> if I delete \t it needs to.. move the cursor back to wherever the previous character in the buffer lives.. which needs some tracking, so I guess \t sucks
<zid> deleting \t forces a redraw, fuck it
<zid> it'll flicker but meh
<heat> linux has a """fancy""" algo that seems to take care of that
<heat> freebsd doesn't do it right
<heat> I assume the other tty's also don't do it right
<zid> I'd just struct { int pos; char glyph; int codepoint; } or whatever
<zid> and have that be my actual internal buffer
<klange> There is no viable way to handle \t at the tty level as the tty driver has no idea where the cursor is and can not calculate tab stops
<zid> backspace pops one and uses [-1].pos+1 for new cursor position
<heat> yeah but they do it *somehow*
<heat> I don't understand how, but their handling seems mostly ok
<moon-child> hmm, what about vertical tabs?
<zid> are they redrawing the bottom row with vt codes? :P
<klange> I don't bother with a lot of the fancier stuff in my tty line buffer, as I have a nice little rich line editor library available where I can do all the _really_ fancy stuff (like a movable cursor)
<zid> I didn't bother with one cus it sounded hard
<zid> as noted, my OS does no more than it's pretending to do
<heat> ttys and vterms are fucking insane
<zid> you can see dmesg behind my gb emulator, but it doesn't actually support scrolling, or being updated
<heat> it's really nice to see it work but oh god
<zid> it's static pixels in memory from a converted array of strings I built once and rendered once :P
<heat> ok seriously what's wrong with the vmware acpi tables?
<heat> they are wrong
<heat> very
<zid> they work for me
<zid> tm
<zid> you seem to think every device is a bridge, or something
<heat> no
<heat> the PCI routing tables refer to devices that don't exist
<heat> the uart ACPI devices have no IRQ in them
<heat> or it's 0 for some reason
<zid> so it's like a real machine and does things it's not going to get prosecuted for doing
<zid> but will boot windows
<heat> zid, could ya upload your ACPI tables for me?
<zid> nope
<heat> fuck you
<zid> I mean I cannot
<heat> you and your broken ass virtual machine
<zid> I just don't know how
<zid> acpidump from my gentoo?
<heat> yeah
<heat> acpidump -b, targz the results and send them my way
* zid finds acpiutils
<zid> oh I have it nice
<zid> -b is empty
<zid> naked it prints the tables like hexdump -C though
<zid> oh it makes random files in ., fucjk
<heat> *.dat probably
<zid> ye
<zid> figuring out tar lol
<heat> they have random OS-specific hacks in their acpi tables
<heat> what the fuck
<zid> I think maybe I get to pick different tables too? not sure
<zid> there's an option to tell it what OS you're booting, that might give it different acpi idk
<heat> it creates 32 uart devices for good measure
<zid> why wouldn't you, nice round number
<geist> i think i've seen that on vmware
<geist> it has slots for 32 uarts, though most of them aren't active, of course. there's some method you call to determine if the device is actually there
<heat> yes
<heat> I realized thats what I'm missing
<heat> I don't call _STA
<klange> huh, apparently I don't even map \t to \t in my tty driver, it spits out ^I :D - that's one way to avoid the backspace troubles for it!
<klange> The fanciest thing my tty line buffer does is ^V yields ^ with the cursor positioned over it until the verbatim keystroke is received.
bradd has quit [Ping timeout: 268 seconds]
<heat> zid, could ya test https://github.com/heatd/Onyx/actions/runs/3805133478 's iso once it finishes?
<bslsk05> ​github.com: acpi: Skip device registration if not present and functional · heatd/Onyx@df18d79 · GitHub
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
SGautam has joined #osdev
<heat> valuable fuzzing of my OS today
<heat> i'm happy
<zid> no
<zid> link me a real file
<zid> tomorrow
<heat> ok
<heat> np
<heat> geist, btw this is how my acpi code looks now: https://github.com/heatd/Onyx/commit/df18d79ae394eb077acf3625dfb63f7e65a35383
<bslsk05> ​github.com: acpi: Skip device registration if not present and functional · heatd/Onyx@df18d79 · GitHub
<heat> it fits in a lot more
<heat> "This bit field has no affect"
<heat> apparently the ACPI spec has as many typos as the EFI spec
<geist> heh
ZombieChicken has joined #osdev
heat has quit [Ping timeout: 256 seconds]
puck has quit [Excess Flood]
puck has joined #osdev
bradd has joined #osdev
<geist> mind blown: i just discovered accidentally that discord supports s/foo/bar support
<\Test_User> and if you include the trailing /, it will happily add the trailing / to your message
ZombieChicken has quit [Quit: WeeChat 3.7.1]
GeDaMo has joined #osdev
gildasio has quit [Ping timeout: 255 seconds]
SGautam has quit [Quit: Connection closed for inactivity]
sjs has quit [Ping timeout: 252 seconds]
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
xenos1984 has quit [Ping timeout: 252 seconds]
gildasio has joined #osdev
sjs has joined #osdev
pog has joined #osdev
wootehfoot has joined #osdev
elastic_dog has quit [Read error: Connection reset by peer]
elastic_dog has joined #osdev
Burgundy has joined #osdev
<kaichiuchi> hi
Beato has quit [Quit: I have been discovered!]
Beato has joined #osdev
bauen1 has quit [Ping timeout: 265 seconds]
nyah has joined #osdev
Burgundy has quit [Ping timeout: 248 seconds]
dutch has quit [Quit: WeeChat 3.7]
nyah has quit [Quit: leaving]
dutch has joined #osdev
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
[itchyjunk] has joined #osdev
FreeFull has joined #osdev
wootehfoot has quit [Read error: Connection reset by peer]
bauen1 has joined #osdev
heat has joined #osdev
joe9 has joined #osdev
vdamewood has quit [Remote host closed the connection]
<kaichiuchi> where the hell is everyone
vdamewood has joined #osdev
<heat> hel
<kaichiuchi> heat: bazinga
danilogondolfo has joined #osdev
<zid> we were up late last night talking about kvm
<zid> so we're all tired and groggy
<heat> hehe hamsters fancy food
<kaichiuchi> compile-time unit testing is damn cool and I wish I had done it sooner
<kaichiuchi> also google benchmark kind of annoys me
<kaichiuchi> i can’t get any output from it like I can with perf
<zid> I have compile time unit tests, it's called a compiler
<zid> I teach it invariants known as 'types'
<kaichiuchi> no
<zid> seriously, types are basically compile time unit tests
<kaichiuchi> I have unit tests that run each of blargg’s tests against a known good log
<zid> consider it compared to PHP that has bugs like "1e12 is a valid number and string, and your code explodes if it picks the wrong one"
<zid> that's not a unit test
<zid> that's an actual test
<zid> nor is it compile time
<zid> very close, otherwise
<kaichiuchi> i’m testing the CPU unit
<kaichiuchi> and it could be done at compile-time
<zid> but yea, stealing thingy's tests would be cool
<zid> tearoom
<zid> where it compares each rom to a screenshot of each rom
<kaichiuchi> yeah i’d like to have something like that
Burgundy has joined #osdev
theWeaver has quit [Quit: server reboot brb]
<kaichiuchi> honestly though
<kaichiuchi> I’m really concerned about running the CPU instance at compile time
<kaichiuchi> how the fuck would that even work?
<zid> it wouldn't
<zid> unless you turned it into a giant template and ran it inside the compiler
<heat> have you noticed you severely overengineered your emulator
<zid> which I wouldn't put past you
ChaosWitch has joined #osdev
<zid> but would be a huge waste of time and effort
<heat> no need for templates, you could constexpr it
ChaosWitch is now known as EthicsGradient
<heat> people have done similar things
<zid> well you need to expand it a shit load of times
<zid> to run more than one instruction
<heat> no
<heat> constexpr functions can have loops
<zid> nice
<heat> (and memory allocation these days)
<zid> either way, it's still slowly running inside the compiler
<kaichiuchi> the CPU is a template
<zid> (knew it)
<kaichiuchi> and everything is constexpr, yes
<kaichiuchi> the CPU is a template only because I can say “these are the two functions we use to read/write memory forever and ever and that’s never changing”
<zid> I do that with "functions"
<zid> mem_read_byte mem_write_byte
<kaichiuchi> yes
<zid> Fairly sure C++ still has functions
<kaichiuchi> it does
<zid> qed then
<kaichiuchi> it’s not QED when you’re thinking as separate individual components
<zid> parse error
<zid> what's this got to do with thinking or components
<kaichiuchi> mem_read_byte and mem_write_byte are hardlocked to running as if it’s not just the CPU
<zid> it's about whether templates are required to achieve the affect of "these are the two functions we use to read/write memory forever and that's never changing"
<zid> effect
<zid> acpi corrupting me
<kaichiuchi> when I say that I’m testing just the CPU class, I mean that
<kaichiuchi> there’s no knowledge about the system bus/interconnect or the other devices
<zid> nod, I could make fake memory if needed that just does nothing
<kaichiuchi> i may be shot for saying this
<zid> but I don't need to test my cpu anymore, I tested it when I wrote it
<zid> and given it's all encapsulated and read only, nothing can break it
<kaichiuchi> but is the compiler smart enough to see that a pointer is ever only pointing to one thing ever with LTO and optimize accordingly?
<zid> yes
<zid> any C++ optimization needs, C has been doing since the 90s
<zid> sentence A+ order
<zid> either because it wasn't relevent to C++ yet, or because C++ was too complex and had to be limited in scope for the optimization to be applicable
<zid> std::move needed inventing first or whatever
<kaichiuchi> heat: i overengineer everything
<zid> I still stand by my statement that unit tests aren't needed in compiled languages with strong types
<zid> as you an encode the invariants that unit tests cover into annotations directly and stop the thing compiling if they're violated
<kaichiuchi> you’re testing that function F actually does X/Y/Z
<kaichiuchi> sounds reasonable to me
<zid> unit tests are mainly for interpreted languages with dynamic typing where SHA1 hashes can be confused for engineering notation or whatever
<kaichiuchi> nonsense
<heat> nonsense
<zid> note I don't mean test tests
<zid> I mean specifically *unit* tests
<zid> go look at some actual unit tests as used in practice
<kaichiuchi> then I have no idea what you mean
<kaichiuchi> yes, I was staring at one this morning
<bslsk05> ​en.wikipedia.org: Unit testing - Wikipedia
<heat> how do I know if my "append data to tcp socket" creates correct packets without unit tests?
<kaichiuchi> it was “does this module handle the 500 different scenarios that are possible”
Starfoxxes has quit [Ping timeout: 265 seconds]
<zid> heat: By testing it at authorship time.
<kaichiuchi> and leaving it alone after that?
<heat> ok so I test it once, then freeze it
<heat> got it
<kaichiuchi> that’s absolute nonsense man
<zid> In a strong lang it freezes itself
<kaichiuchi> functionality doesn’t freeze itself
<heat> types don't freeze anything
<kaichiuchi> it changes with any project
<zid> I've got code I wrote in the 90s I still use that has never changed, I tested it then
<sham1> Things don't freeze
<kof123> /* i have only tested this code by running it, not by proving it -- htunk dlanod */
<zid> the only thing that can break it is if the semantics of the types it uses change
<zid> which is only possible in dynamic languages
<kaichiuchi> sounds like the
<kaichiuchi> code isn’t that complicated or didn’t have a pressing need to be changed
<kaichiuchi> which is fine
<heat> or if components it uses change
<zid> It is the 'component'
<heat> maybe we should test components individually
<kaichiuchi> but that doesn’t invalidate functional verification
<zid> unit tests != integration tests
<heat> some sort of tests of unit
<bslsk05> ​en.wikipedia.org: Integration testing - Wikipedia
<kaichiuchi> this is like saying you’d build a bridge and think it doesn’t need any additional maintenance once you’ve built it
<zid> unit test -> small pieces of code, integration test -> groups of small pieces of code, system testing -> running the shit
<kaichiuchi> and then you fall into the ocean and drown
<zid> kaichiuchi: if I had made it impossible for the materials to degrade, yes I would believe that.
<zid> I wouldn't feel the need to send an engineer out every two weeks to check for rust on an unrustable material
<kaichiuchi> in this specific case i’m sure it hasn’t needed to be touched
<zid> If you want to test how the bridge is tied down? That's an integration test.
<kaichiuchi> but especially in the context of large scale teams where 400 things change a month
<kaichiuchi> you need unit tests
<zid> No, you need *tests*
<kaichiuchi> otherwise you end up like my old job
<zid> not unit tests
<kaichiuchi> but we are testing a unit, a specific class
<zid> who mentioned classes?
<kaichiuchi> I think you’re hanging on the terminology too hard
<zid> "You're only right because you're relying on what words mean"
<kaichiuchi> fine, a specific module of the program
<zid> sorry my bad
<kaichiuchi> i have a CPU, I have tests for the CPU, I’m testing the CPU module/unit only
<zid> Let's give a specific example then, why does the e1000 code in the linux kernel not have a unit test for checking that setting the MAC address works?
<zid> My answer is that it's fucking pointless, it was tested when it was written, nothing can break it unless someone goes and breaks it.
<kaichiuchi> so then you make sure that someone doesn’t do that
<kaichiuchi> by unit tests
<zid> In which case, they should test their changes
<heat> but that's a driver
<heat> and hardware
<heat> what are you expecting? mocking hardware?
<zid> heat: Well spotted.
<kaichiuchi> so
<kof123> that's what software is, volatized/mocking hardware :D
<heat> unit testing a driver tends to be a poor idea because you spend a lot more time writing tests rather than coding
<zid> If I had written that code in python? sure unit test it in case someone tries to call it with set_mac("fred"); instead of a colon list or whatever. My C code makes that impossible to begin with.
<kaichiuchi> your argument is that tests are fine as a general concept, but unit testing is generally a waste of time
<zid> no
<heat> the linux ELF loader has no unit tests and /because of that/ you cannot make any medium-large changes to it
<zid> I spent about 20 minutes exaplaining it's to do with compiled languages and types
<heat> the code is effectively frozen at the moment
<kaichiuchi> it’s not
<kaichiuchi> that’s only 25% of the battle
<zid> I can rule out *huge* swathes of unit tests by having types
<kaichiuchi> the remaining 75% is making sure it does what it’s supposed to do
<zid> so unit tests are more useful in interpreted languages
<zid> I can rule out another huge swathe by having compile time encapsulation, so that unrelated changes cannot break anything.
<bslsk05> ​twitter: <hyc_symas> Note: LMDB was written by humans, in C, and has no memory safety bugs, nor memory leak bugs. Nor concurrency, isolation, or data persistence bugs, for that matter. [https://twitter.com/pcwalton/status/1106627176986632192 <pcwalton> Humans are incapable of writing memory-safe C/C++. ␤ ␤ The evidence is overwhelming. It shouldn’t be considered a “hot take”. But we refuse to accept it. ]
<kaichiuchi> and, key thing here, making sure it continues to work
<kaichiuchi> if I’d go and say “huh I can make this CPU more efficient” down the road
<bslsk05> ​bugs.openldap.org: 8988 – Undefined Behavior in slapadd
<zid> It *will* continue to work, unless someone changes it, and if they're changing it without testing their changes, then they're committing nonsense, and we're not optimizing for people who deliberately commit nonsense I hope
<kaichiuchi> all I have to do is say “run tests” to make sure that shit still works
<zid> "I use unit tests in case someone changes one of the lines of my project to 40 characters from /dev/random"
<heat> do you seriously think you can singlehandedly manually test every change?
<zid> is not a very exciting take
<dh`> oh ffs
<zid> heat: *UNIT* test.
<zid> We're talking about *UNIT* tests, for the 800th time, guys.
<heat> exactly
<zid> tsting is good, unit tests are less required in compiled languages.
<kaichiuchi> heat: i’m telling you he’s getting hung up on the word unit
<zid> that's all I've said
<zid> because you guys keep going "Yea but you're wrong, because that means you can't do integration test"
<zid> and I keep telling you to shut the fuck up
<kaichiuchi> …i’m not
<dh`> unit tests are a bad use of your (necessarily limited) testing budget
<kaichiuchi> no
<zid> couldn't comment, they're a personal waste of my time at least
demindiro has joined #osdev
<kaichiuchi> please I was a test engineer at a company who had no unit tests at all for a machine accurate to a speck of dust
<zid> whether that applies at scale is up for bean counters
<kaichiuchi> do you know what happened?
<zid> what was it written in?
<demindiro> I write unit test for code I find hard to get right
<kaichiuchi> everything broke repeatedly every release
<kaichiuchi> C++
<demindiro> Like my filesystem
<zid> Found your proble
<demindiro> Otherwise I just run it and see if it works
<kaichiuchi> yeah i’m sure that was the problem
<zid> honestly? It probably caused a great deal of problems, if they were allowed to actually write C++.
<zid> It's hard to stop changes from infecting other things, hard to read, hard to audit
<heat> not true
<kaichiuchi> i’m sure bjarne himself came through my PC and told me not to test my code
<demindiro> What you try to unit test also matters
<demindiro> e.g. I'm not going to bother unit testing my hardware drivers
<heat> thank you
<kaichiuchi> that’s what we’ve established
<zid> which I also said many many times
<kaichiuchi> no one disagreed
<zid> I was argued against, naturally, "that doesn't count, you can't say you don't need to unit test drivers, that's too obvious"
<zid> like no shit, that's my entire point
<kaichiuchi> what I’m trying to say is: automated testing is important, otherwise you will end up a manual tester wishing you were dead
<zid> yes, testing is good
<zid> not sure what it has to do with anything I said, but completely agreed.
<kaichiuchi> i don’t even know where this is going anymore
<heat> zid do you consider a unit test that calls malloc a unit test or an integration test?
<zid> heat: could not possibly give an answer
<zid> does it free it before it returns? does it call leaf functions?
<zid> is this a public function?
<zid> The more other shit it involves, the exponentially less chance it has of being a unit test
<heat> imagine its some sort of crypto thing that allocates a temporary buffer to calculate something, then frees and checks for $result
<kaichiuchi> if my old company had done something simple: “fix a bug and write a test”, we wouldn’t have had the same bug show up every
<kaichiuchi> fucking
<kaichiuchi> release
<zid> heat: Sounds highly likely not to be a unit test then, that's basically the full api of an entire .so file
<zid> libmd5 or whatever
<demindiro> wrt difference between unit and integration test: I'd consider doing a few select operations a unit test, whereas an integration test does a whole bunch of things.
<heat> don't overthink it
<kaichiuchi> when I start running PPU tests, i’d consider that an integration test
<heat> think of a bullshit_hash_calc()
<kaichiuchi> because I need both the CPU and PPU
<zid> I'd test that when I wrote it using "unit tests"
<zid> then delete the tests
<demindiro> So something like "make file delete file done" would be unit test, whereas "try to build a project" would be an integration test
<zid> (in a compiled language)
<heat> demindiro, yes, exactly
<zid> nobody's breaking that code once I verify that it works without changing the code itself, and code changes should be tested.
<heat> it's hard to define unit and integration
<heat> if you take unit literally you're just wasting time
<kaichiuchi> mmmm
<heat> if you take it too liberally it's not a unit but integration
<kaichiuchi> the way I’d define it
<heat> if you test calls malloc are you integrating with malloc and vm and page allocation and ...
<kaichiuchi> unit = one thing with a single responsibility
<zid> they can do their own md5("") == d41d8cd98f00b204e9800998ecf8427e after they 'update' the code to verify it still runs, and put it in their commit message to show how cool they are :P
<dh`> arguing over whether tests are "unit" or "integration" tests is also a waste of time
<kaichiuchi> i agree
<heat> i find lots of moving parts in tests to be fucking annoying
rein-er has quit [Quit: ZNC - https://znc.in]
<heat> and very frequently don't give you the information you need
<kaichiuchi> that sounds like a bad test
<heat> how do I test if my tcp stack outputs good shit, from userspace?
<demindiro> integration test, I guess
<heat> if they're bad packets, they never hit the rx tcp socket (imagining loopback) and you never know it was bad
<kaichiuchi> something I do have to stress though: i am not saying that automated testing is 100% effective
<demindiro> For unit test userspace or kernelspace distinction doesn't matter IMO
<heat> it absolutely does
<zid> yea for unit test there can't be a difference
<kaichiuchi> you can’t test a AAA game without manual testing
<kaichiuchi> or most games at all really
<heat> userspace testing can see a lot less of the kernel and it interacts with 500 different components
rein-er has joined #osdev
<heat> if I actually tried to test tcp out manually from userspace, I'd need to 1) create a tcp socket 2) bind it 3) connect 4) send something (with copyin/out and vm involved) 5) create a raw socket for the loopback device 6) bind 7) attach a bpf filter 8) use the 1-2K lines of raw socket code to get my data and copyin/out 9) hope the loopback device isn't broken 10) test the packet manually in userspace
<zid> https://www.youtube.com/watch?v=Uo3cL4nrGOk These are the people who need (and use) unit tests :P
<bslsk05> ​'Interview with Senior JS Developer' by Programmers are also human (00:05:28)
<kaichiuchi> C developers must be cyborgs then
<heat> if I did this in a simple kernel test, 1) create a tcp output stream 2) send some data to a mocked buffer 4) test that it expands into something proper
<heat> s/4/3/
<kaichiuchi> no keep 4
<kaichiuchi> powers of two
<heat> s/3/4
<kaichiuchi> that’s better
rein-er has quit [Quit: ZNC - https://znc.in]
rein-er has joined #osdev
<dh`> you can't test any of the difficult things in a filesystem without running it live
Turn_Left has quit [Read error: Connection reset by peer]
Turn_Left has joined #osdev
demindiro has quit [Ping timeout: 260 seconds]
<heat> dh`, maybe an odd question but why did the BSDs never (actually) use glibc?
<heat> considering they use/used the rest of the GNU toolchain
<zid> Theo Van Der Walls didn't like it
<kof123> what is the license? which existed first?
<heat> the original cc(1) existed first and that didn't stop all the BSDs from migrating to it
<heat> my options are 1) licensing 2) pride 3) ???
<kaichiuchi> god i’m sleepy
<heat> err s/to it/from it/
<heat> the olde glibc releases had BSD4.3 support
<kaichiuchi> i really do wonder if I should just go home
<heat> go
<kaichiuchi> i’m literally the only one in the office
<heat> wtf are you doing then
<heat> go
demindiro has joined #osdev
demindiro has quit [Client Quit]
<kaichiuchi> but it’s not a WFH day :(
<dh`> heat: because glibc is crap
<dh`> is the short answer
<dh`> why would they/we? it has an adverse license and it's full of gnuisms
<dh`> even before it became the poster child for the linux development model
<heat> gcc is also a poster child
<heat> but you used it
<dh`> yes, but there wasn't any realistic alternative to gcc in 1993
<dh`> why berkeley didn't write their own, idk
<kaichiuchi> glibc is crap, one sect says
bauen1 has quit [Ping timeout: 252 seconds]
<kaichiuchi> freebsd is crap, the other says
<dh`> they reimplemented vi and quite a few other expensive things
<kaichiuchi> everything is terrible
<sham1> As a part of the "glibc is crap"-sect, it's not like there aren't other projects that aren't also crap
<kaichiuchi> no i know
<dh`> as they say, all software sucks, except maybe for /usr/bin/true
<dh`> (but /usr/bin/false definitely sucks, it fails all the time)
<kaichiuchi> i’m just saying that I’ve just… never seen anyone ever say “god i really like this”
<sham1> /bin/true does suck though. So much effort just to get a return value of 0
<epony> getting a large program to print a bit value of 1 is as stupid as it can get
<sham1> Did that spam the 0x11s again?
<kof123> re: "never seen anyone" ...yes, it is surely defined as least and most pessimum </story of mel>
bauen1 has joined #osdev
<j`ey> sham1: there was a weird thing at the start
<sham1> Aight
<GeDaMo> 0011
<dh`> at one point there was an asm-only true and false for linux
<sham1> I'll try to see if I can make it so that the Matrix bridge can turn them into something more reasonable
<sham1> That's still too much. The only acceptable size for /bin/true is 0 bytes
<epony> next, you'll be doing digital circuitry as elementary logic gates with "programs" that implement complex way to spin the entire computer to flip a level (stupid is never enough, it can get absurd)
<dh`> my recollection is that if you make true an empty file it does work but it actually ends up running the shell
<heat> yes but only on execvp/execlp
<heat> we actually talked about this yesterday
<heat> the True Portable true is #!/bin/true
<heat> er
<heat> #!/bin/sh
<kaichiuchi> i think i’ll wait for another 15 minutes
<kaichiuchi> and if I don’t hear anything back from my boss
<kaichiuchi> peace
<dh`> the best available is a statically linked binary that fits in one filesystem block
<heat> sounds like its worth revisiting the smallest elf file thing
<dh`> at least on a system small/slow enough that you actually care about the overhead
<dh`> it doesn't have to be that, since one block is a good bit of space, it just has to not link against libc
<bslsk05> ​www.muppetlabs.com: A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux
<heat> dh`, btw re libc and gcc, maybe libc was seen as too much of a pridepoint to migrate to another one. cc(1) is whatevs
<heat> what's a UNIX without its libc?
<dh`> possibly
ghostbuster has joined #osdev
jafarlihi has joined #osdev
<dh`> but you also underestimate what a mess glibc was before it became the linux libc
<dh`> nobody took it seriously, almost as much as hurd
<heat> why was it a mess?
<dh`> usual gnu problems coupled with lack of anyone caring
<jafarlihi> Sirs, I'm trying to make a BFS implementation for FreeBSD here: https://github.com/jafarlihi/freebsd-bfs / when I mount a BFS partition it executes all the way to printf that logs "Either not a BFS volume or corrupted" then kernel crashes with "page fault while in kernel mode". Any idea what I am doing wrong?
<bslsk05> ​jafarlihi/freebsd-bfs - [WIP] BeOS filesystem (BFS) implementation for FreeBSD (is fork /0 forks/0 stargazers/NOASSERTION)
<jafarlihi> It tries to read data at virtual address 0x18 for some reason
<epony> technically you don't need to call it UNIX unless you plan(10) to use its specific properties, one of which is small languages and compiler construction toolkits for their creation, tuning and testing.. and using a minimally reliable hardware programming suitable portable language in the algol family
<heat> dh`, what usual gnu problems?
<heat> overengineering and overportability?
<epony> so, it's not UNIX the term that makes it have these properties, it's having these properties and interfaces than can be similar to a UNIX-like design
<dh`> bloat, inventing weird new bolt-ons, bizarre internals
<epony> the standard library for C is a set of functions and interfaces to provide important abstraction to be able to reach that, but it starts from specifications of the system properties, not from the name of what they are called
<dh`> it was full of #defun cpp macros, for example
<heat> i'm looking at 1.09 right now and it's very interesting how it supported around 20 different configs
<epony> since GNU say they are not UNIX, they can have their own principles and implementation specifics, how well it matches or carries the ones of a system of those particular principle properties is a very special "embrace, extend and extinguish" version of it
<heat> this seems to be pre-linux, I assume linux possibly used the sysv target, although maybe it's too early for linux glibc
<epony> the g in glibc is for GNU
<epony> comes from the GCC
<epony> https://en.wikipedia.org/wiki/Glibc#Functionality "In addition, glibc also provides extensions that have been deemed useful or necessary while developing GNU." --'ziŋ
<bslsk05> ​en.wikipedia.org: glibc - Wikipedia
<sham1> Alongside some abhorrent code
<heat> the glibc code looks fine to me
<dh`> you haven't found the #defuns yet then
<dh`> or maybe they'd ripped them all out by the version you're looking at, idk
<dh`> I remember looking at it at some point in the mid-90s
<dh`> I think to decide whether to use it or netbsd's for a research system
<bslsk05> ​'Unix50 - Unix Today and Tomorrow: The Languages' by Nokia Bell Labs (00:59:32)
<heat> dh`, what's a defun?
<heat> i only see the lisp meaning of that
<dh`> yes, a macro to do that in C
bauen1 has quit [Ping timeout: 268 seconds]
<dh`> something like DEFUN(int, main, int argc, char ** argv)
<dh`> except worse in some way I can't remember
<heat> ah wait yes I've seen that
<heat> yeah but it makes sense cuz of K&R decls vs C99
<bslsk05> ​elixir.bootlin.com: ansidecl.h - Glibc source code (glibc-1.09) - Bootlin
<heat> I agree it looks horrific but its the price you have to pay for i n f i n i t e p o r t a b i l i t y
jafarlihi has quit [Ping timeout: 268 seconds]
danilogondolfo has quit [Remote host closed the connection]
<epony> lisp is not very portable, and about infinity, no such thing
<epony> either that or there are no photons, pick your options
Matt|home has joined #osdev
vdamewood has quit [Remote host closed the connection]
vdamewood has joined #osdev
<dh`> it is not a sound or conventional way of handling K&R vs. c89
<mjg> heat: it is bad dawg, indirect function calls always suck
<mjg> heat: consider ifunc instead
<heat> mjg, musl ldso doesn't have ifunc, I didn't implement it yet and that doesn't work in static progs
<heat> the branch seems to work (tm) (r)
<dh`> and notice that AND macro in there
<heat> dh`, what would be the conventional way?
<kaichiuchi> hi
<mjg> heat: yer suck bro
<heat> why
<mjg> you would not have the problem in RUST
<heat> i would
<mjg> this reminds me to check wtf are they doing for stirng ops
<heat> in fact rust always static links
<mjg> rust is a panacea motherfucker
<heat> well, almost always
<mjg> lock.rs: a [allow(unused)] script, ASCII text executable
<mjg> thanks file(1)
<heat> lol
<mjg> #![allow(unused)]
<heat> brilliant
<mjg> anyhow the lolbinaries i got are all dynamic
<mjg> and in particular they link against libc
<heat> hmm, I had the impression it loves static linking
<heat> maybe only against its own rust stuff
<mjg> ldd mofo
<mjg> that would be my guess
<j`ey> yup
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
xenos1984 has joined #osdev
<kaichiuchi> so
<kaichiuchi> i think i'm going to get a cat
<zid> this ur cat
vdamewood has quit [Remote host closed the connection]
<kaichiuchi> maybe
vdamewood has joined #osdev
<heat> zid, i'm getting lspci
<kaichiuchi> hm
<zid> nice
<zid> getting it from where?
<kaichiuchi> i wonder what's the equivalent for perf on mac
<heat> zid, pciutils
<kaichiuchi> ah, Instruments
<zid> wow what a thief
<zid> I assume that just is a bog standard C program, but needs a random part of /sys to be populated how it expects
<heat> more or less bog standard yeah
<EthicsGradient> bog standard is a fuckin weird idiom when you think about it
<heat> i'm not going down the sysfs route, i'm implementing freebsd pci(4)
<heat> true
<EthicsGradient> fuckin brits istg
<heat> should be gog standard
<EthicsGradient> XD
<EthicsGradient> true
<EthicsGradient> or pog standard
<zid> 'bog' means toilet in this context, EthicsGradient
<zid> not swamp
<EthicsGradient> zid: i mean sure but that doesn't make it any less weird
<EthicsGradient> like
<EthicsGradient> "toilet standard"
<EthicsGradient> that's still fuckin weird
<zid> not if you've ever taken over india
<EthicsGradient> what makes a thing "loo standard" ?
<EthicsGradient> ok wait what does us taking over india have to do with it
<zid> lack of toilets
<EthicsGradient> so we went and installed a bunch of standard bogs?
<zid> ofc, they just used their hands before, it's nice to get back to blighty and the bog standards
<EthicsGradient> but how did this lead to declaring bits of hard or soft engineering "bog standard"?
<EthicsGradient> zid: idk seem tenuous
<zid> I did infact, make it all up afterall
<EthicsGradient> XD
<EthicsGradient> you almost had me tho
<EthicsGradient> zid: there was a chunk of time during my teens when I thought "bog standard" was "box standard"
<EthicsGradient> which actually would make more fuckin sense
<EthicsGradient> like
<EthicsGradient> "out of the box"
<EthicsGradient> "standard"
<EthicsGradient> but nope
<zid> https://web.archive.org/web/20120412194929/http://use.perl.org:80/use.perl.org/_Aristotle/journal/33448.html I'm 10 years late but we're busy making fun of PHP in another channel
<bslsk05> ​web.archive.org <timeout>
<zid> The more the merrier imo
<heat> mjg, why do the freebsd man pages lie to me?
<heat> pci(4) is also a fucking lie
<heat> where's PCIOCGETBAR???
<zid> OC?
<heat> hm?
<heat> you mean in the name? it probably should read like PCI IOCTL GETBAR
<heat> but in all honesty I don't know
<heat> sortie: where's your sweet mdoc now
<sortie> heat, you okay bro?
<mrvn> be happy it's no PCCGTBR
<heat> sortie, man(7) never lied to me, that's all i'm saying
<sortie> HEAT, THAT'S WHAT THE MAN WANTS YOU TO THINK
eroux has quit [Quit: Textual IRC Client: www.textualapp.com]
Starfoxxes has joined #osdev
<mrvn> man only lies when the number isn't prime
* kof123 leaves a tip for the mrvn oracle and goes on his way
<kaichiuchi> the mrvn oracle...
<mrvn> I always tell the truth. You just have to figure out what question I answer.
<dh`> heat: the conventional way is either #define __P(x) x or #define __P(x), then declare functions like int main(__P((int, char **))); and always define them K&R-style
<dh`> nowadays that would likely generate warnings on the K&R-style syntax, but it worked for all known compilers in 1995
epony has quit [Quit: QUIT]
epony has joined #osdev
<kaichiuchi> hi
<heat> why do you keep saying hi
<heat> you say hi like 3 times a day
bauen1 has joined #osdev
<kaichiuchi> nothing wrong with being courteous
<kaichiuchi> ?:)
<kaichiuchi> (the real answer is I get bored)
<pog> hi
<mrvn> timezone appropriate greetings to you too
<heat> pog pog pog pog pogpo gpog pog
<zid> when I get bored I usually repeat an old meme about vaginas to myself, you're lucky I hit ^A^H and not \n
<kaichiuchi> [[nodiscard]] __attribute__((flatten_)) constexpr auto Step() __restrict__ noexcept -> int
<kaichiuchi> what kind of monstrocity is this
<moon-child> oh god oh fuck
<moon-child> it's c++
<zid> I like my anime waifus like I like my Step functions
<mrvn> why are you mixing pre and post c++22 attributes?
<moon-child> this is strictly a RUST channel
<zid> attribute flattern
<heat> RUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
<heat> SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
<heat> T
<kaichiuchi> mrvn: ...can you do [[flatten]]?
<heat> kaichiuchi, probably gnu::flatten
<mrvn> kaichiuchi: I would think its [[gnu::flatten]]
<zid> waifu::flatten
<kaichiuchi> huh
<moon-child> flat is justice
<zid> correct.
<kaichiuchi> so I literally just [[nodiscard]] [[gnu::flatten]]?
<kaichiuchi> neat
<moon-child> also who came up with the ugly [[]] syntax
<zid> [[fallthrough]]
<kaichiuchi> C++ committee
<heat> i like it
<mrvn> moon-child: there are only so many parent types
<zid> I like that /* fallthrough */ is a valid token now
<heat> wait, is it?
<heat> per C standard?
<kaichiuchi> (honestly, I didn't know there was an attributes namespace)
<zid> yea it's a legal alternative to [[fallthrough]]
<heat> wtfffffffffffffffffF???????
<moon-child> isn't that a gcc-specific thing?
<zid> given how 99.9% of the source used the comment, not the [[]] thing which hadn't been invented yet
<heat> so you legitimately need to parse comments to be C std compliant?
<zid> they made all existing source legal
<moon-child> I mean, [[fallthrough]] is meta-syntax; it doesn't have any semantics
<kaichiuchi> moon-child: i mean, sure
<moon-child> I don't see why the c standard has to care whether you write /* fallthrough */ or not
<zid> whether it supresses warnings or not, diagnostics are normie anyway though
<zid> non-normie? chad?
<mrvn> moon-child: making comments not comments would be very bad
<mrvn> moon-child: how would you comment out "/* fallthrough */"? nested comments?
<moon-child> I'm confused
<moon-child> /* fallthrough */ doesn't have any semantics
<moon-child> so it doesn't matter if you comment it out or not
<zid> it supresses diagnostics
<zid> -Wfallthrough
<moon-child> sure
<mrvn> does "break; [[fallthrough]]" give a warning?
<moon-child> so, why would you want to ... temporarily suppress diagnostic suppression?
<mjg> heat: i'm pretty sure i discouraged manpages?
<zid> You're temporarily supressing diagnostics
<heat> mjg, it's either reading manpages or reading freebsd code
<zid> not temporarily supressing diagnostics supression
<heat> none of which I'm particularly a fan of
<zid> becaus the fallthrough is intentional in this case, you *don't* want a warning generated
<mjg> read openbsd pages
<pog> heatheatheatheat
<heat> pog, foobarbaz
<kaichiuchi> hey i like man pages
<zid> Peg.
* mjg likes info pages
<heat> GNUUUUUUUUUUUUUUUUUUUUUUUUUUUUuu INFOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO > RUUUUUUUUUUUUUUUUUUST
<pog> RUST 2024
<heat> gnu info 2023
<moon-child> zid: mrvn wants to comment out a /* fallthrough */
<moon-child> heat: lmao
MrPortmaster has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
<moon-child> heat: what about gnu rust
<zid> moon-child: good for him I guess
<heat> do you count its gnu info pages as a part of gccrs?
<mjg> did you mean GNU/rust
<mrvn> moon-child: more like I'm concerned what /* /* fallthrough */ */ turns into
<mrvn> or what abou /* fallthrough */?
<moon-child> same as /* /* eat my ass */ */, no?
<mrvn> moon-child: No, that would be a syntax error.
<mjg> no to kink shame, but is this the right channel for this messaging?
<mjg> maybe try on discord
<moon-child> mrvn: exactly. Shouldn't /* /* fallthrough */ */ be the same?
* moon-child is more curious about /* it is vitally important that we _not_ fallthrough here */
<mrvn> moon-child: it would be ugly if it was. Say you have a nice big switch {} and you want to comment it out. Now you have to remove all the /* fallthrough */. And when you comment it back in you have to restore them all.
<moon-child> then use //fallthrough
<mrvn> moon-child: but that's not what 99% of sources use
<mrvn> (as you pointed out)
<moon-child> when did I point that out?
<heat> guys new mailing list for ass eaters everywhere: tech@openbsd.org
<mrvn> you as in the channel
<mjg> openbsd is defiintely ass
<moon-child> anyway, if they're using /* */ for fallthrough comments, then they're probably also using it for other comments, so you're screwed regardless
<moon-child> could use #if 0
<mrvn> heat: I don't eat equines
<mjg> but does rust #if 0?
<heat> you can always run cpp on .rs files
<heat> that would be fucking mint
<clever> heat: haskell has a compiler flag to make it do exactly that
<clever> ive noticed it also breaks multi-line strings
<zid> heat: php*
<mrvn> Ocaml has nicer comments. You are allowed to comment out any valid expression and it is a valid comment. Which includes comments in the expression.
<clever> in haskell, its perfectly valid to do "foo
<clever> bar"
<heat> zid, does php stand for phap
<clever> but when you pass it thru the c pre-proccessor, those strings break for some reason
<mrvn> of "*/"
<mrvn> or
<dh`> nested comments make the lexer non-regular
<moon-child> poor lexer
<mrvn> dh`: only if you want to lex comments into single tokens
<mrvn> also: who cares?
<mrvn> it's not like c++ lexer/parser isn't full of exceptions anyway
<epony> heat, so someone told you that rust is useless for kernel programming and that happened to be someone riding the OpenBSD mailing list pony?
<epony> you that's true
<epony> "know"
<epony> it's a half-ass language, one half is Java-reactionary the other is Haskell-impromptu
<epony> and it pretends to fix something in the C languages, but falls short on its nose as an LLVM frontend with disabilities
<epony> you can get told the same thing anywhere else
<epony> ^ proof
<dh`> it doesn't matter but it does make life more difficult
xenos1984 has quit [Read error: Connection reset by peer]
<moon-child> for whom?
<dh`> though on the scale of issues parsing C++ it's about -5 on a log scale of 1-10
<epony> it's like a hybrid without fuel
<moon-child> it makes life more difficult for the implementors, and easier for the users. That's _always_ the right 'tradeoff'
<epony> that's not entirely wrong ;-)
pog has quit [Quit: byee]
<dh`> meh. actually about the only time the issue has impacted me noticeably in the past 30 years was when I needed to count lines of ocaml code
<epony> see how well C improved over Assembler
<dh`> there's no easy way to strip out comments
<dh`> (and there's no equivalent of "run cpp on the sources")
<moon-child> qualify 'easy'?
<dh`> can't do it with shell tools
<moon-child> if (*c == '(' && c[1] == '*') nesting++, c+=2; else if (*c == '*' && c[1] == ')') nesting--,c+=2; if (!nesting) break;
<mrvn> counting lines is kind of stupid anyway. One should count expression complexity.
<dh`> interesting shell, that
<heat> holyC
<mrvn> moon-child: wrong. comments in strings are still esacped
<mrvn> moon-child: (* "*)" *)
<dh`> you can remove C comments with sed, though it's a pain in the ass
<mrvn> dh`: including // */?
<dh`> hmm
<moon-child> posix is first alternation, isn't it?
<moon-child> so that should work fine
<mrvn> I guess you can just do a first pass and remove all //
<dh`> that might actually pose a problem
<dh`> no you can't, because of /* // */
<mrvn> right,
<kaichiuchi> god help us
<\Test_User> just remove all /* ... */ first, // ... on second pass?
gog has joined #osdev
<moon-child> no, because // /*
<mrvn> can POSIX sed do any multi-line stuff at all?
<\Test_User> ah...hmm
<epony> after you learn escape nesting recursively
<moon-child> gog
<gog> gog
<dh`> it's very limited but you can do some things
<Ermine> gog
<mrvn> moon-child: remove all [^(//)] /* ... */ first
<epony> no, sed is not multi-line
<epony> but what makes you think awk is
<dh`> if you're willing to abuse the hold space and branch you can do a lot more than one might think with sed
<dh`> not that one should
<mrvn> maybe awk it?
<mrvn> or just cpp it
<dh`> for C comments the obvious thing to do is to remove #'s from the file then run through cpp
<epony> there is one step to go between shell, sed/awk, step here, and C
<mrvn> nod
<epony> it's called perl
<dh`> for ocaml comments there's no easy way so I had to write a support program
<dh`> I'm not saying this was a large burden
<mrvn> dh`: I think I would have written a pp plugin and pretty printed the AST
<dh`> but it was also the only time I can think of when I needed to really care about nested comments, and it was on the user and not implementor side
<epony> each of these steps has a more "friendly" and more 'serious' variant (and in-between variety)
<dh`> perl is never the right answer
<gog> moon-child: Ermine
<mrvn> I don't know any other language that has ocamls nested comment behavior but it's just so convenient for the user
<epony> but mostly the """multi-line""" variants are slightly odd-weird-lesser
<moon-child> moon-child: moon-child
gog is now known as pog
<mrvn> are you a full moon child or new moon child?
<kaichiuchi> i hate medicine.
<epony> what you have in the US is not called that
<kaichiuchi> no I just almost forgot to take my meds again
pog has quit [Quit: byee]
<sham1> “Medicine”
gog has joined #osdev
<kaichiuchi> yes
<kaichiuchi> i'd probably need double the dose if I was working on java
<epony> writing depressing comments under the influence of java ;-)
xenos1984 has joined #osdev
<epony> (nested, escaped, recursive, in cursive, of course-ive)
<epony> you can use some other frontend for the bytecode (opcode / intermediate respresentation)
<epony> or some other IR / BC application VM engine
<mrvn> Why is ebay still running adds for buying x-mas gifts instead of selling unwanted gifts?
<epony> multi-level marketing is like multi-staged compilation, you never know what horrors happen in the middle, why do you think anyone wants these gifts ;-)
<epony> a gift is supposed to be "free".. these are purchases or, trade contracts which rarely fill the obligations
<epony> a gift would be something like "flawless logic" or "advanced nesting" or "performance optimisation" or "infinite memory" or "abstract thinking" or "precision control" or "endless loop shortener"
<epony> .. or "perfect continuation"
ZombieChicken has joined #osdev
<epony> "universal entropy repository with a time slider"
<epony> you know for sliding time under it (not like the slide ruler but like the unsolicited mail deposit slot)
<gog> pog
<heat> gog pog
<heat> gogchamp
gog is now known as pogchamp
TkTech has joined #osdev
FreeFull has quit []