<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?
<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>
'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*
<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)?
<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
<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
<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.
<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: 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
<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
<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
<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?
<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
* 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>
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)