<bslsk05>
electronicarts/EASTL - EASTL stands for Electronic Arts Standard Template Library. It is an extensive and robust implementation that has an emphasis on high performance. (855 forks/7175 stargazers/BSD-3-Clause)
<mcrod>
also, debug performance is a big problem
<heat>
mutexes are slow, condvars are slow, rw locks are slow
<heat>
iostreams suck ass
<heat>
stringstreams are horrendous
<rnicholl1>
heat: that's hardly even true, you must be talking about a specific implementation of the C++ standard library, so first, which one?
<mcrod>
we're not.
<heat>
for what assertion?
<heat>
the threading primitives? libstdc++, libc++
<heat>
they use pthreads
<rnicholl1>
yeah, pthreads isn't fast. That is lazy on the part of libc++/libstdc++
<heat>
good
<rnicholl1>
but hardly an argument against C++ itself
<heat>
i merely use what the implementations give me
<heat>
std::map is also terribad, std::vector isn't great outside of userspace
<heat>
operator overloading makes me sad
<rnicholl1>
What's wrong with std::map?
<mcrod>
operator overloading _can_ have a use, if careful
<heat>
operator[]
<rnicholl1>
that's hardly slow
<mcrod>
hahahahah
<heat>
this is not about performance
<rnicholl1>
so you just.. don't like C++ style
<rnicholl1>
vector is pretty fast for what you get
<heat>
many people don't like "C++ style", hence EASTL, folly, abseil, fbl, libkj, etc etc
<heat>
the STL is not a one-size-fits-all as much as they try to, which makes it a size-fits-no-one. not good for size, horrendous for compile time, interfaces are mediocre at best
<mcrod>
here's what we're not saying, we are not saying C++ doesn't have good features (e.g. RAII)
<rnicholl1>
There's nothing wrong with adding additional data structures on top of the ones the STL provides
<rnicholl1>
but you have no demonstrated any flaws in the STL
<mcrod>
the requirements set forth by the standard are garbage
<rnicholl1>
yet there are plenty of people who use c++
<rnicholl1>
it's funny how
<rnicholl1>
the people involved in high speed trading
<rnicholl1>
use C++
<mcrod>
we went over this
<rnicholl1>
the only case where it truly, genuinely matters
<mcrod>
a) here's what we're not saying, we are not saying C++ doesn't have good features (e.g. RAII)
<mcrod>
b) they do NOT, no matter what you say, use any of the "fancy" shit that you are saying that they do
<mcrod>
i.e., exceptions, RTTI, dynamic dispatch
<rnicholl1>
Funny
<mcrod>
even if it *wasn't* for a performance reason regarding exceptions, it is difficult to write truly exception-safe code
<rnicholl1>
Because
<rnicholl1>
I worked at a finance company
<rnicholl1>
and they did
<mcrod>
don't care what they did
<heat>
for the high performance paths?
<heat>
hidden memory allocations in fast paths LOL
<mcrod>
can guarantee stuff like the NASDAQ/NYSE doesn't run off of the standard library and exceptions
<mcrod>
and yes, memory allocations are slow
<rnicholl1>
LOL
<rnicholl1>
funny
<rnicholl1>
I worked for intercontinental exchange
<rnicholl1>
the company that owns the NYSE
<mcrod>
you're just making shit up now
<rnicholl1>
idk about the exchange itself
<rnicholl1>
because I didn't work on that
<mcrod>
then what on earth are you even saying
<heat>
etoro uses exceptionz!
<rnicholl1>
but we had a "trading engine" that ran on C++, used exceptions
<rnicholl1>
I am not sure if it's the same one NYSE ran on
<rnicholl1>
because NYSE I think was an acquisition
<rnicholl1>
so they could have used a different stack
<mcrod>
listen to me
<rnicholl1>
obviously, they don't throw exceptions inside hot loops
<mcrod>
you walk into this place, a place full of low level developers, people who work close to the hardware on a regular basis, people who do write their kernels in C++, and it's a shock that none of them use 'x', 'y', or 'z' features of the language
<rnicholl1>
I mean its not a shock since it's not implemented?
<mcrod>
what isn't implemented?
<rnicholl1>
C++ exception handling in kernelspace on armv8a
<heat>
getting a C++ runtime for my kernel would be trivial
<rnicholl1>
only for x86
<rnicholl1>
there is none for arm
<heat>
for any arch
<rnicholl1>
there isn't one... you gonna write it yourself?
<heat>
yes
<heat>
i wrote an entire kernel plus some C++ runtime bits
<rnicholl1>
I'm not sure I'd consider that trivial but ok
<heat>
why would it need to be trivial?
<rnicholl1>
[18:38:48] <heat> getting a C++ runtime for my kernel would be trivial
dutch has quit [Quit: WeeChat 3.8]
<heat>
i could write one, i could port one
<heat>
libc++abi + libunwind should not be hard to make work, or at least the relevant bits
<rnicholl1>
I will say this, in non-performance critical parts of the code
<rnicholl1>
like loading config files
<heat>
kernels don't load config files
<mcrod>
please don't tell me you're throwing exceptions for that
<Mutabah>
C++ requires exceptions for allocation failure handling
<rnicholl1>
it seems like you want to make the vector a pointer
<Mutabah>
but that doesn't mean all languages do
<rnicholl1>
C++ also uses value oriented containers and not reference oriented containers
<heat>
my failure-prone containers have operator bool
<Mutabah>
IMO, implicit copies like that are bad - too much hidden cost
<heat>
or operator!
<Mutabah>
a `try_clone` would be nicer
<Mutabah>
(mixed with `clone` that just aborts on OOM)
<rnicholl1>
Mutabah: how is it implicit? you used operator=
<rnicholl1>
that means copy
<rnicholl1>
imo, languages that mix reference and value types, like java, are dumb
<heat>
int a = b;
<heat>
compare the cost of a vector operator= with an int operator=
<heat>
or the operations involved even
zaquest has joined #osdev
<rnicholl1>
so... vector shouldn't have the same semantics as an integer because you might be too dumb to realize that vectors are big and copying them is more expensive than copying an int?
<Mutabah>
rnicholl1: It's worth noting, I'm a professional C++ dev by day, and a rustacean by night :D
<heat>
yes, everyone that doesn't agree with you is dumb, well noted
<Mutabah>
I've fixed too many performance issues in my professional carreer caused by inexpirenced (or expirenced) devs copying vectors when it wasn't needed
<Mutabah>
although, a lot of that is mitigated by modern C++ having the `explicit` specifier
<rnicholl1>
I mean, forgive me for wanting to be able to read code and understand the semantics of what it is doing
<rnicholl1>
not 75% boilerplate
<Mutabah>
In rust, that's avoided by the `?` operator (that propagates errors)
<Mutabah>
Exceptions, in my experience, make writing good code harder because try-catch blocks have to be so wide
<Mutabah>
you can't keep the error handling localised, without also having types that can be potentially invalid
<rnicholl1>
if you're writing lots of try catch blocks you are doing something wrong
<Mutabah>
Where do you put your try-catch blocks then?
<rnicholl1>
but e.g. throw invalid_packet_format somewhere in a deserializer, catch (std::exception & er) { log_exception(connection, er); connection->close(); ... }
<rnicholl1>
good example of a valid way to use them
<rnicholl1>
try to do something they can't? throw invalid_access()...
<rnicholl1>
etc
<rnicholl1>
you don't have to handle them anywhere in your code except one centralized place that will log the error and shut down the particular context
<rnicholl1>
if you plan on doing something other than return err, you shouldn't be using exceptions
<rnicholl1>
how much go code I write that is like
<Mutabah>
Except if someone else decided to use exceptions, you have to handle them
<rnicholl1>
foo(); if (err) { return err; }
<rnicholl1>
and the function that calls that is liek
<rnicholl1>
err = bar(); if err { return err }
<rnicholl1>
like seriously
<Mutabah>
exceptions are not the only or the best solution
<rnicholl1>
THAT is when you use exceptions
<Mutabah>
rust code: `foo()?`
<Mutabah>
it's like exceptions, except they're normal values (in the function signature and in how you handle them)
<rnicholl1>
I also use result stuff
<rnicholl1>
it can be good, but it also has issues
<rnicholl1>
it is slower in the case where you rarely if ever throw exceptions
<rnicholl1>
syntax sugar around "if err {" does not change the fact you are doing a compare after every return
<rnicholl1>
that is a branch and it can make your code slower
<Mutabah>
benchmarks needed
pog has quit [Ping timeout: 250 seconds]
<Mutabah>
Worth noting: I see unwinding ("exceptions") as having their place, but only for truly exceptional cases - e.g. allocation failures
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
radens has joined #osdev
<radens>
Has anyone had much success with kernel asan on aarch64? I'm seeing some very strange behavior out of gcc and clang, and am wondering if I'm configuring my compiler incorrectly
<heat>
what strange behavior?
<heat>
i don't have it on arm64 (just didn't wire things up), but I have it for x86
<rnicholl1>
than putting a bunch of "if" statements everywhere to handle errors
<rnicholl1>
this is standard knowledge that you should have if you are going to optimize things
<rnicholl1>
there is a huge difference between throwing exceptions as part of regular control flow and using them to handle rare edge cases
<rnicholl1>
if exceptions are rare, it IS faster than error codes
<rnicholl1>
that "if" check is not free
<radens>
thanks heat
<mcrod>
you might want to run your benchmark with -O2 on clang and gcc
<mcrod>
and then reconsider your position
<rnicholl1>
Always amuses me that C programmers will claim C++ is slow, but all the benchmarks seem to show C++ being faster. qsort vs std::sort, exceptions vs error codes, (It begin, It end) vs T* data, size_t count, etc
<rnicholl1>
so... turning down the optimizations makes performance arguments more valid?
<mcrod>
here's a secret: -O3/-Ofast does not necessarily guarantee improved performance, it can actually produce worse code gen
<sakasama>
rnicholl1: Invalid comparison: you never catch the exceptions `foo` might throw, nor do you compile without exceptions to allow further optimisation.
<mcrod>
that too.
<radens>
programs are slow, not languages
<mcrod>
depends on what you mean by that
<mcrod>
people don't use FORTRAN over C++ for heavy, heavy heavy numerical computations for no reason
<rnicholl1>
-fno-exceptions wont affect the performance
<rnicholl1>
all the functions are noexcept
<mcrod>
a) they are very clearly not, and;
<mcrod>
b) the burden of proof is on you through the benchmarks that -fno-exceptions won't affect the performance
<rnicholl1>
You're free to disagree. I know you are wrong, there's extensive literature on this topic. The fact you haven't read it or at least created your own benchmarks is amusing
<rnicholl1>
I'm not going to do any more work to enlighten you
<mcrod>
lol
<rnicholl1>
I don't have enough time for this idiocidity
<rnicholl1>
I already wrote a benchmark for you
<mcrod>
idiocity*
<rnicholl1>
if you wanna say "but under this other circumstance it wouldn't be true" go test it yourself
<mcrod>
yes, and I told you that if you try it with -O2, no_exceptions is faster
<innegatives>
-fno-idicidity
<heat>
kernal
<Mutabah>
Interesting benchmark, looks like exceptions (in that case) is around 6% faster - on a very short bit of tested code
<mcrod>
optimizations greater than -O2 are dangerous without testing
<rnicholl1>
They're only dangerous if you write UB code.
<rnicholl1>
which you shouldn't
<mcrod>
right, you shouldn't write UB
<mcrod>
i don't think anyone disputed that
<innegatives>
whats the fun in it if you dont write UB
<mcrod>
also, you still haven't acknowledged that the benchmark goes wildly in the no_exceptions favor with -O2
<mcrod>
my guess is the branch predictor is doing its job.
<mcrod>
and for the record, you still have no idea what you're saying
<bslsk05>
bugs.debian.org: #571572 - blas: compiled with -O2 in amd64 (errors occur with -O3) - Debian Bug report logs
<heat>
there have been and still are longstanding bugs against strict aliasing in GCC and llvm
<heat>
where they very rarely miscompile code
<rnicholl1>
I've see errors in -O2 as well
<rnicholl1>
those are rare just like with -O3
<mcrod>
are you going to acknowledge that the benchmark is faster with -O2 or not
<mcrod>
faster for no_exceptions*
<rnicholl1>
it appears to be on that particular circumstance yes
<mcrod>
good. i'm glad we've had that settled.
<rnicholl1>
if you make the call graph deep enough exceptions will be faster
<mcrod>
[citation needed]
<innegatives>
who bases their decision whether to use exceptions or not based on performance
<rnicholl1>
The criteria to use -O3 instead of -O2 is not that an optimization is buggy, but that the optimization takes a long time.
<mcrod>
if you compile your benchmark with -Ofast on gcc, the benchmark tips heavily in the favor of exceptions, on clang it tips more in favor of no_exceptions
<sakasama>
rnicholl1: You're also doing some other worrysome things, like two `if` statements to check for `err` and `err2` instead of one (and this might not be optimised well), and you're catching outside the loop and not doing anything with the exception or errors, so why even bother?
<mcrod>
so, what is truth
<rnicholl1>
sakasama if you catch inside a hot loop you are doing something wrong
<rnicholl1>
the point of exceptions is to move error handling outside the hot path
<Mutabah>
catch and rethrow to add context?
<sakasama>
rnicholl1: The point of a benchmark is moot when you don't have equivalent behaviour.
<rnicholl1>
it's equivalent since the error never occurs in both cases
<sakasama>
Then you can delete the error handling code altogether and this is solely about tricking the optimiser.
<rnicholl1>
which is why I used
<rnicholl1>
int input = 9;
<rnicholl1>
benchmark::DoNotOptimize(input);
<sakasama>
This is not a realistic appraisal of the performance properties of exceptions.
<rnicholl1>
it's a realistic appraisal that exception handling is faster than error codes *when errors do not happen*
<rnicholl1>
which, if your errors are things like, I/O error, out of memory, etc
<rnicholl1>
is something that will hopefully hold true
<sakasama>
It might be, depending on how that code is written. It also incurs other costs.
<sakasama>
Note anyways that the main arguments against using exceptions aren't performance-related.
<rnicholl1>
I've seen people call them confusing.
<rnicholl1>
I'm not sure I'm convinced given how many fewer security errors I see in projects that use them
<rnicholl1>
I think people are just not willing to learn another style of programming
<bslsk05>
www.open-std.org: P2544R0: C++ exceptions are becoming more and more problematic
<rnicholl1>
you don't have to like lisp, but it does not make lisp bad
<mcrod>
and if that doesn't convince you, nothing will
<rnicholl1>
Single threaded the fib code using std::expected is more than four times slower than using traditional exceptions. Of course the overhead is less when the function itself is more expensive, as in the sqrt scenario. Nevertheless the overhead is so high that std::expected is not a good general purpose replacement for traditional exceptions.
<rnicholl1>
I mean, it doesn't convince me of your point
<rnicholl1>
especially quotes like that
<mcrod>
do you even know what the open-std.org website is
<rnicholl1>
that's a quote from the website...
<mcrod>
i know what it is
<rnicholl1>
Anyway... exceptions are not perfect. And it sounds like there are some implementation issues with a global unwind table
<rnicholl1>
I'm not really sure why a global unwind table is needed
<mcrod>
here's the reality: you are defending something in absolute terms, while calling everyone else idiots and stupid etc when even the fucking *experts* publicly acknowledge it is not a good model
<mcrod>
and then show us a benchmark that isn't representative of any real-world use case at all.
<rnicholl1>
Some gurus like exceptions and others do not
<mcrod>
that benchmark if nothing else was textbook confirmation bias
<rnicholl1>
*shrugs* they aren't that problematic
<rnicholl1>
there is room for LLVM/gcc to improve exception handling performance
<rnicholl1>
but that would require an ABI break
<mcrod>
I give up
<rnicholl1>
which is probalby why they do not
<heat>
kernal
<mcrod>
I've done all I can people
<mcrod>
have a good night
<sakasama>
imho, the real problem with exceptions is that their mere presence makes it much more difficult to reason about code without inspecting every function used to see which might throw, and in some cases it is impossible to write exception-safe code.
<sakasama>
> It is impossible to write a strongly exception-safe functionthat has two or more unrelated side effects, of any kind, that cannot be performed atomically.
innegatives has quit [Ping timeout: 240 seconds]
<zid>
Main issue for me is just that it's horrendous to debug
<zid>
which sort of defeats the points of *doing* anything in an error case
<zid>
might as well crash and get a better backtrace
<Mutabah>
^
<kof123>
"so, what is truth"
* kof123
throws ouroborus at sleeping mcrod
<Mutabah>
They _might_ be faster, but exceptions are a pain for debugging and code analysis
<zid>
I'd rather it oom and deref null, than it return to main suddenly, delete every local, and print "out of memory somewhere? I think?"
<zid>
you could fix the deleting all the locals issue, and still get the printf if you used you know, error handling
<Mutabah>
zid: Try debugging code with `catch(...)` everywhere :)
<Mutabah>
Bonus points if it uses the MSVC flag that makes the above catch SEH exceptions...
<zid>
I swear the #1 most potent obfuscation DRM uses is exceptions
<zid>
"Oh, I'm in a SEH handler, I guess I give up"
<sakasama>
The musings on exceptions safety by C++'s core designers are particularly enlightening references for why one should typically avoid using them.
<zid>
which thankfully means you have an excuse to not use iostream ever ever? :P
<sakasama>
You'll just end up using something like raw_iostream instead, or iostream with exceptions disabled.
<sakasama>
Your fate is sealed. Let yourself sink into the abyss.
<rnicholl1>
iostream is horrible tbh
<rnicholl1>
nobody should argue against that
<rnicholl1>
it was designed for floppy disks and stuff when I/O was so slow CPU use simply didn't matter
<zid>
It was designed?
<zid>
I find that hard to believe
<rnicholl1>
for a single threaded, slow I/O world, yes
<rnicholl1>
Iostreams are fucking awful
<zid>
It's bad at that too though
<sakasama>
The interface itself doesn't seem that bad until one discovers the existence of io flags.
<zid>
it looks like it was 'designed' to use as much C++ grammar as it could
<zid>
to show off the "types of useful things C++ is good at"
<zid>
and just.. that's what you get, if you try to use C++ features
<heat>
<< std::hex << num << std::dec is peak C++
<rnicholl1>
iostreams are terrible examples. they are what not to do with c++ imo.
<zid>
left shifted cout that can't error and has masses of hidden state :P
<rnicholl1>
oh it does error
<zid>
Right, I take the view that this should be extended to its logical conclusion
* sakasama
merges with boost.spirit for incomprehensible power.
<rnicholl1>
std::cin >> foo;
<rnicholl1>
if (!std::cin) { // handle error
<rnicholl1>
yeaaaaa
<zid>
but it's a bool, so it can *signal* 'error', but can't actually transmit AN error
<rnicholl1>
yeah it's horribly designed
<sakasama>
It's not actually a bool, horrifyingly enough.
<zid>
void *?
dude12312414 has joined #osdev
<sakasama>
It's an implicit conversion from void*. Would you like to know more?
<zid>
yea I don't acutally use C++
<zid>
due to the afformentioned "Take this to its logical conclusion"
* sakasama
dances.
<rnicholl1>
it's not an implicit conversion from void*
<zid>
"the object has overloaded operator void*, and void* is convertible to bool."
<rnicholl1>
no...
<zid>
>since C++11 that says, might be relevent
<sakasama>
rnicholl1: Oh, nice, they changed it in C++11.
<zid>
heat: you forgot std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
<rnicholl1>
I mean, it was "/* unspecified-boolean-type */" before
<rnicholl1>
I guess maybe someone implemented that as void*
<sakasama>
I didn't even notice. I feel even older now.
<zid>
does it being a numeric context matter
<zid>
like, does it use different operators depending on context, idk C++
<sakasama>
rnicholl1: It *had to be* implemented that way, until they added explicit conversion operators.
<zid>
It sounds like it just starts as void *, then the if tries to evaluate it as a bool, and the cast to bool is overloaded
<zid>
rather than implicit, like it was before
<sakasama>
> Until the introduction of explicit conversion functions in C++11, designing a class that should be usable in boolean contexts (e.g. if(obj) { ... }) presented a problem: given a user-defined conversion function, such as T::operator bool() const;, the implicit conversion sequence allowed one additional standard conversion sequence after that function call, which means the resultant bool could be converted to int, allowing such code as obj << 1; or int i =
<sakasama>
obj;.
<rnicholl1>
most of C++'s major issues were fix in 11, 14, 17 and 20
<zid>
no?
<rnicholl1>
I mean, they're not fixed in the sense that
<rnicholl1>
they leave crap in for backwards compatibility
<zid>
It still has no encapsulation, and exceptions, those are the major ones
<zid>
the rest has been paper shuffling
<rnicholl1>
what do you mean "no encapsulation"
<zid>
pimpl exists
<rnicholl1>
pimpl is an implementation detail
<zid>
it's not a detai
<rnicholl1>
that only matters because of how some implementations implement C++
<zid>
It's an implementation of encapsulation, beacuse the languag doesn't have it
<rnicholl1>
with Shared objects/dll
<zid>
C does, which is why it doesn't
<rnicholl1>
I mean, C++ is more abstract than C.
<zid>
Get this, in C, I get the cool encapsulation .dll files offer, *without* having to use pimpl!
<zid>
You recognised exactly why it's useful, but failed to appreciate it's useful for writing *every* file
<zid>
not just ones that turn into .so
<rnicholl1>
uh, what do you mean?
<sakasama>
zid: Don't try to understand this from the perspective of C. Implicit conversions in C++ have more rules and context sensitivity (ADL for instance).
<rnicholl1>
encapsulation to me is putting a variable inside a class to encapsulate it.
<zid>
putting it in a class exactly unencapsulates it immediately
<rnicholl1>
sounds like you are talking about something else entirely
<zid>
because classes aren't opaque, like structs are
<rnicholl1>
classes are the same as structs?
<rnicholl1>
the only difference is default privacy
<zid>
privacy is *exactly* the issue
<rnicholl1>
not sure I follow
<zid>
You need special rules and keywords to determine whether a thing is private or not, rather than just.. flat out not making it visible
<sakasama>
If only that were true. msvc feels otherwise. :(
<rnicholl1>
what do you mean by
<rnicholl1>
"not make it visible"
<rnicholl1>
header files don't have visibility
<zid>
C doesn't require you to have the tag definition in order to use a pointer to struct
<rnicholl1>
neither does c++...
<zid>
It does for classes
<zid>
hence pimpl
<rnicholl1>
class foo; foo * fl
<rnicholl1>
no, that's not why pimpl exists
<zid>
It literally is
<rnicholl1>
pimpl is used in C as well as C++
<zid>
*everything* is pimpl already in C
<rnicholl1>
no, no it is not
<sakasama>
zid: No, you're confused about classes here.
<rnicholl1>
the point of pimpl is so you can recompile only *part* of the code
[itchyjunk] has quit [Read error: Connection reset by peer]
<rnicholl1>
if the return value is a pointer, then new fields can be added to the implementation without my user code needing to recompile
<zid>
sakasama: idiomatic C++ puts classes in header, then every file compiles the thing independently and relies on them matching, being successfully dedupped, then implementation details leak into every single consumer
<zid>
so changes require recompiling all of them, i.e no encapsulation
<dh`>
what are we arguing about?
<zid>
nothing
<sakasama>
rnicholl1: It's mainly used to hide struct definitions from users, tbh.
<dh`>
C++ standard adding more workarounds for self-inflicted problems introduced in the last set of changes as workarounds for...?
<rnicholl1>
zid: you can encapsulate in C++ as well. that is a compile time vs performance tradeoff. pimpl isn't free
<zid>
Good news, in C it is :P
<rnicholl1>
no it isn't
<zid>
In what way is it not?
<rnicholl1>
You fundamentally misunderstand how it works
<rnicholl1>
The struct in C and class in C++ is the same thing
<sakasama>
zid: How is that any different from C? There's very little difference between classes and structs in C++.
<zid>
great, tell the C++ people then
<zid>
Because I've literally never seen them do it
<zid>
They use the C++ language features instead
<zid>
What I have seen though, are 200kB headers full of code included into 80 files
<zid>
repeatedly
<rnicholl1>
C and C++ both allow you to put structs/classes in headers
<rnicholl1>
C++ programers do it more often sure
<sakasama>
Many of C++'s core features are identical to C anyways.
<rnicholl1>
But that doesn't mean C++ *can't* do it the C way
<zid>
yea you're going to have to assume when I say "C++ does blah"
<zid>
that I mean
<zid>
the parts of C++ that they added, and people use
<sakasama>
Ah, yes, enormous headers full of templates are great fun.
<rnicholl1>
Well, templates do compile slow
<zid>
not "The subset that I swear I use and nobody else must do too"
<rnicholl1>
that is a weakness of C++
<zid>
everybody*
<rnicholl1>
the strength is that they are usually faster once compiled than using other methods like function pointers
<zid>
and not "The parts that C also share"
<rnicholl1>
c++ is more like a toolbox
<sakasama>
C++20 modules are a decent solution now, though still a bit irritating to use.
<rnicholl1>
if you use the tools wrong, that is your fault
<zid>
C++ is a language for writing ad-hoc domain languages
<zid>
There is no right or wrong
<rnicholl1>
Every C++ feature has a proper time to use it
<zid>
there is just "how people use it"
<rnicholl1>
including exceptions
<rnicholl1>
there are also times when exceptions are dumb
<rnicholl1>
I don't like hand holdy 'do it this way' languages.
<rnicholl1>
sure it might be nice 90% of the time
<rnicholl1>
but for 10% of the time you are fighting the language its not worth it
<zid>
meta-language for*
<zid>
That is, you write gobs of templates and classes and stuff, shove it all in a header file, so that your main.cpp can look like BASIC
<rnicholl1>
I will never tell you use to exceptions in every case for all error handling. I just want the option to use it when it makes sense.
<rnicholl1>
If you get errors frequently, error codes perform better
<zid>
Or when someone else forces them on you
<heat>
sakasama, wake me up when C++20 modules are usable and stable in GCC or clang
<zid>
like say, the C++ spec :P
<rnicholl1>
they are usable
<heat>
if i'm dead please don't open my grave thanks
<zid>
"Yea but we don't ue that part" is no excuse
<zid>
I will shout from the rooftops how much I hate C's bitfields, not being able to dereference pointers to incomplete types, enums not being strong, etc
<rnicholl1>
I was actually working on a solution to that
<heat>
how would you deref a pointer to an incomplete type?
<zid>
C++ people "It has its place, trust in the creator, this pain is cleansing"
<dh`>
what would it mean to dereference a pointer to an incomplete type?
<zid>
heat: because they don't have to be *fully* incomplete
<dh`>
that's inherently malformed
<rnicholl1>
dh` a compiler that does recursive graph resolution to solve the grammar
<zid>
struct beep { int a; int b; struct kitten k; }
<sakasama>
heat: They are already.
<rnicholl1>
i've been working on one of those
<rnicholl1>
it's painful
<rnicholl1>
to write
<rnicholl1>
the compiler
<zid>
You can't do beep->a without the definition for kitten
<dh`>
"solve the grammar"?
<rnicholl1>
like
<heat>
sakasama, "G++’s modules support is not complete." direct quote
<zid>
kitten being incomplete makes all of beep incomplete, not beep->k
<rnicholl1>
you solve the type structure when the type is defined later in the code
<dh`>
zid: ah I see what you mean
<rnicholl1>
you have to take the abstract syntax tree and start building a dependency graph
<zid>
It means you end up having to do struct bob { int a; struct kitten *k; }
<zid>
for no real reason
<rnicholl1>
it's fucking painful to write
<rnicholl1>
there is a reason C/C++ don't bother
<zid>
or you have to break all the encapsulation
<zid>
and just grab a copy of the definition you don't actually need
<rnicholl1>
zid: it has more to do with how difficult it is to write a compiler that doesn't have that issue
<zid>
It's actually really easy
<sakasama>
heat: It's not complete in clang either. e.g. -MDD fails to extract import dependencies. It's still usable though: I ported my build scripts last winter.
<rnicholl1>
it's not
<zid>
you just need sizeof to cooperate
<dh`>
or you do struct beep { int a; int b; }; struct beep2 { struct beep beep; struct kitten k; }; and hide only the larger one
<zid>
dh`: Yea but then you get no type safety :(
<rnicholl1>
I've been trying to write one for a toy language, writing recursive compilers is painful
<dh`>
you get some
<zid>
The point is the compiler *wants* to be recursive, but I need it *not* to be
<dh`>
but you can also just define an accessor for b and move on
<zid>
plan9C can apparently do this btw dh
<zid>
maybe I should switch
<dh`>
being able to reference ->b directly only matters in a small fraction of cases
<zid>
It's very very useful for tagged unions :P
<heat>
what you really want to do is to have a super struct and then have multiple other structs that overlay it, and you use those
<heat>
*cough cough struct page*
<rnicholl1>
yeah it's not complete but mostly usable
<zid>
struct object { int weight; int sell_value; }; struct sword { struct object o; int sword_length; }; Inverting it like this works most of the time at least
<zid>
struct sword * and struct object * are compatible types
<zid>
but it puts casts everywhere, and you can get into trouble
<dh`>
of course the desire to be able to do that is what gave rise to C++ in the first place
<zid>
C++ does the exact opposite though
<heat>
-fno-strict-aliasing + struct object { int weight; int sell_value; int __data[1]; }; struct sword { int weight; int value; int length};
<zid>
why no-strict-aliasing heat
<zid>
they're already compatible types
<heat>
are they?
<zid>
yes
<rnicholl1>
yeah
<heat>
ew
<zid>
A pointer to a
<zid>
bit-field, then to the unit in which it resides), and vice versa
<zid>
structure object, suitably converted, points to its initial member (or if that member is a
<zid>
They're both also int *
<rnicholl1>
pointer to first member conversion is allowed if the type is pod
<heat>
C is ew
<zid>
so you do what I did earlier
<zid>
> struct object { int weight; int sell_value; }; struct sword { struct object o; int sword_length; }; Inverting it like this works most of the time at least
<dh`>
my experience has been that when you get into real systems with real implementation concerns, both ordinary subclassing in the C++ or Java style and this lightweight C-style variety break down
<zid>
C's breaks down because you need the incompelte deref almost immediately *somewhere*
<zid>
so then you end up just exposing every definition
<zid>
to stop you needing the extra deref
<dh`>
no, it breaks down because it gives too simplistic a data model
<zid>
It doesn't nest, granted
<dh`>
what you end up needing is struct sword { struct object object_info; struct speaker speaker_info; struct magicitem item_info; ... }
<zid>
well, linearize? I mean, you can't do struct object { int weight; struct kitten k; struct bob b; }; and expect to be able to do anything useful
<rnicholl1>
inheritance isn't my favorite part of c++
<dh`>
because a sword is-a object with a sale value, but it's also (for certain magic swords) a thing that talks
<rnicholl1>
but I still find it rarely useful
<dh`>
as well as a magic item whose magic aura information you need to keep track of
<dh`>
and a dozen or two other things
<dh`>
all of which are independent, not a neat hierarchy of properties
<zid>
maybe
<dh`>
and so inheritance comes unstuck and what you end up with is instances of a whole variety of interfaces
<heat>
DIAMOND INHERITANCE
<dh`>
since this is #osdev, consider vnodes
<zid>
Once it gets complicated enough you just add a dictionary
<dh`>
if you have multiple filesystems, then you have different vnode instances for each filesystem
<zid>
f = get_property(object, "talk_function");
<rnicholl1>
I think the main difference between people who like C++ and people who hate C++ is that people who like C++ appreciate that it has the tools for every situation, whereas people who hate C++ don't like that it gives people the wrong tools as well
<dh`>
but there's also a bunch of shared fs-independent logic for all directory vnodes, all symlink vnodes, all device vnodes, all socket vnodes, etc.
<rnicholl1>
or that C++ gives you a tool that is dangerous and only useful 1% of the time
<dh`>
and that gives you two entirely independent and incompatbile subclass hierarchies and it doesn't work in C++, even with multiple inheritance
<zid>
rnicholl1: It's impossible to tell which is which, is the problem
<rnicholl1>
multiple inheritance is dangerous and only useful 1% of the time
<zid>
"Am I the 1%?" is massively over-estimated.
<dh`>
what I don't like about C++ is that it gives me a bunch of power tools that are all vibroblade and no handle
<dh`>
you can't use them safely
<zid>
C++ weenie: You were supposed to use a vice and remote-starter, idiot.
<zid>
C weenie: "Why not just include a vice?"
<zid>
C++ weenie: "Someone might WANT a machine to remove all their fingrs"
<heat>
me: kernal develop
<zid>
I am playing factorio, it's way better than kernal
<zid>
I am doing dumb things with uranium, presently
<zid>
Crap joke I just invented: C++ user sees a decaying rope bridge across a crocodile infested river, "Wow, what a powerful rope-bridge!"
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
rnicholl1 has joined #osdev
<rnicholl1>
mostly I just want exceptions to work so I can use the same code in kernel and userspace without "undefined reference to _Unwind_start"
<rnicholl1>
life is so much easier when you can debug code in userspace
<zid>
People do do exceptions in C++ kernel code afaik
<zid>
you just need to write your own libunwind or whatever
<zid>
like how you write your own libgcc when you port to a bizzare platform
<rnicholl1>
there is an implementation but it's x64 only
<rnicholl1>
no arm support
<heat>
i don't know a single kernel that does
<zid>
I mean the weird hobby stuff you see here like templeos heat
<rnicholl1>
someone made virtualization drivers for linux that use C++ exceptions
<rnicholl1>
non-mainline
<rnicholl1>
obviously
<rnicholl1>
linus would never let that in
<zid>
impractical stuff that won't go anywhere
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
rnicholl1 has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<rnicholl1>
I guess I should start by writing a dwarf library for the kernel...
<rnicholl1>
that sounds like fun... I'll save it for another day
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
Arthuria has quit [Ping timeout: 250 seconds]
heat has quit [Ping timeout: 240 seconds]
mi7 has quit [Read error: Connection reset by peer]
GeDaMo has joined #osdev
randm has quit [Remote host closed the connection]
xenos1984 has quit [Read error: Connection reset by peer]
randm has joined #osdev
xenos1984 has joined #osdev
randm has quit [Remote host closed the connection]
randm has joined #osdev
gmacd has joined #osdev
gmacd has quit [Ping timeout: 248 seconds]
<immibis>
did you try linking with the usual whatever is usually required? it shouldn't be completely different... with the possible exception of interrupt stack frames (mark your interrupt entry point noexcept so it doesn't have to unwind those)
<immibis>
disclaimer: I did not try this
<immibis>
it reminds me of people asking about __aeabi_udivmod or whatever and the correct solution is not "write your own version of __aeabi_udivmod" but rather "link with libgcc"
<zid>
nah it's write your own libgcc but with bugs
<zid>
variety is the spice of life
randm has quit [Remote host closed the connection]
randm has joined #osdev
xenos1984 has quit [Ping timeout: 265 seconds]
xenos1984 has joined #osdev
gmacd has joined #osdev
xenos1984 has quit [Ping timeout: 246 seconds]
<immibis>
your own libgcc could become wrong when you upgrade gcc
gmacd has quit [Ping timeout: 250 seconds]
<zid>
yea that didn't really need a good takedown :P
<GeDaMo>
So they can show people how smart they are :|
gmacd has joined #osdev
<mcrod>
they're not
<mcrod>
that's the thing
<mcrod>
people who "grind" these problems are usually idiots in my experience
gmacd has quit [Ping timeout: 265 seconds]
slidercrank has joined #osdev
pog has joined #osdev
<pog>
hi
<zid>
hi gop
<mcrod>
hi pog
goliath has joined #osdev
<pog>
hi zid
<pog>
hi mcrod
gmacd has joined #osdev
<immibis>
mcrod: to develop problem-solving skills
<mcrod>
they don't really do that
<mcrod>
developing problem-solving skills involves solving real problems
<immibis>
idk, don't they? this one probably shouldn't be labeled as "hard" though
<immibis>
does it?
<mcrod>
if you want to develop problem solving skills, write projects
<zid>
This actually has some fairly interesting optimizations
<mcrod>
the vast majority of people who are 'grinding' leetcode are doing it only to try and get through interviews
<zid>
depending on what size your input is
<zid>
it changes
<mcrod>
i've done leetcode problems but I've never viewed them as anything but crossword puzzles on the front page of the newspaper
<immibis>
do you not think that doing crossword puzzles develops skills relevant to solving crossword puzzles?
<mcrod>
sure
<zid>
gotta get your 10k hours in somewhere
<mcrod>
but i also wouldn't hire someone based on their ability to most efficiently do a crossword puzzle that people do because they're bored and sipping tea somewhere
<zid>
tbh I am rusty as shit at writing actual code currently
<mcrod>
i'm not saying they're bad problems for what it's worth
<mcrod>
i'm saying that the only time people pick up leetcode problems is to prepare/pass interviews, and then never touch it again, which really defeats the point.
<mcrod>
also, it assumes that solving these problems == good, well rounded programmer
<mcrod>
and that's... can tell you from my previous job, not the case at all.
<zid>
I think you're saying a lot about it that most people don't say
<mcrod>
yeah, and I wish I knew why people *didn't* say it
<zid>
Like you're reading the back of a box of cereal and loudly proclaiming how you didn't fall for their free toy strategy
<immibis>
^
<zid>
ofc leetcode itself is going to say "We're a great website that will get you hired"
<mcrod>
i just get deeply annoyed at the word "leetcode" or "hackerrank"
<mcrod>
for a variety of reasons :p
<immibis>
then you acknowledge you aren't annoyed by the actual problems
<mcrod>
i'm annoyed by the culture around it
<immibis>
<mcrod> this is such a weird fucking problem
<immibis>
no it isn't
<mcrod>
it's a weird problem in the sense of "who the hell would need to do this"
<zid>
never done anythign related to graphs, or graphics?
<immibis>
most exercises are.
<zid>
This sort of code comes up constantly, just not phrased exactly like this
<immibis>
who the hell would ever need to solve 3x=6 for x?
<immibis>
who the hell would ever write a class Car extends Vehicle?
<immibis>
(or class Dog extends Animal)
<mcrod>
that's... not where I was going with that at all, but okay.
<immibis>
you're in #hamradio, so tell me, who the hell would ever need crude analog modulation in the age of the internet?
<mcrod>
people can have hobbies yknow'
<immibis>
why would you need to calculate a VSWR?
<immibis>
don't waste your time calculating VSWR - make react.js apps instead
<mcrod>
to refine my position more clearly: most people i've seen who "grind" out leetcode aren't doing it for learning, they're doing it to pass interview 'x' and then never touch it again; despite companies knowing this, they consistently ask the same questions that you can just google for the answers and then memorize
<zid>
hiring is shit in tech, yes
<mcrod>
good, glad we've got that settled
<zid>
doubt anyone will argue that
<immibis>
capitalism is shit, yes
<zid>
also that
<immibis>
it does not optimize for things like productivity or knowledge, despite what its adherents claim
<immibis>
it's not a meritocracy, it's a power game
<mcrod>
further, the problems are just fine if and only if you're doing it to learn, but you can be a good programmer without in fact ever touching leetcode, *despite what some evangalists think*
<immibis>
they are evaluating how well you will fit into the box they set for you
<mcrod>
evangelists*
<mcrod>
again, I get upset at the notion of some people, particularly corpoate people, that you must do these sets of problems on some website to classify yourself as a decent programmer
<zid>
needing to do bullshit to get jobs is nothing new to tech, mind you
<immibis>
it's not even exclusive to tech
<immibis>
mcrod: you must submit to their power over you to show that you are sufficiently submissive to have a job
<immibis>
we don't want slaves who get uppity
<mcrod>
when I was interviewed for my current job (embedded), I was asked to talk through how I would design an alarm clock
<zid>
"I'd buy them in bulk from china"
<zid>
:D
<mcrod>
i thought that made perfect sense
<mcrod>
but I was scared they'd give me leetcode problem #9342934792349 for a concept I've never seen before which _isn't relevant to my job at all_
<zid>
glop top rtc module and 4 badly soldered wires
<mcrod>
fortunately, that didn't happen
nyah has joined #osdev
<immibis>
if you are unable to solve the water capture problem, then I'm sorry, you are a shit programmer
<zid>
what if I solve it by rasterizing it and doing a search left and right for each pixel
<zid>
to see if it should be white or blue
<immibis>
if you consistently apply the contrapositive law incorrectly you are probably also a shit programmer
<immibis>
logic is pretty important for programming
<immibis>
the correct reversal of "X implies Y" is "not-Y implies not-X" and isn't "not-X implies not-Y"
<mcrod>
"if you are unable to solve the water capture problem, then I'm sorry, you are a shit programmer", see that's the crap I don't like
<zid>
why? it has like 10 solutions that work
<mcrod>
i didn't say it didn't
<zid>
it's a fairly basic problem for a non-shit programmer
<zid>
even shit solutions are solutions
<immibis>
mcrod do you think anyone who can't solve fizzbuzz is a shit programmer?
<zid>
I solved it TWICE
<immibis>
or do you think there are good programmers who can't solve fizzbuzz?
<mcrod>
you're going to point and laugh
<mcrod>
but paradoxically
<mcrod>
there are somehow decent programmers who cannot solve fizzbuzz
<immibis>
[citation needed]
<zid>
[citatin neeeded]
<immibis>
i can imagine some get stuck in analysis paralysis, since fizzbuzz has this paradox that while it's easy to come up with a few different solutions, all of them feel a bit shitty; not being able to decide the best way to solve it isn't really the same as not being able to solve it at all
<bslsk05>
EnterpriseQualityCoding/FizzBuzzEnterpriseEdition - FizzBuzz Enterprise Edition is a no-nonsense implementation of FizzBuzz made by serious businessmen for serious business purposes. (740 forks/19076 stargazers)
<mcrod>
in my last job, we had some guy give the "best answer" my boss ever heard to a leetcode question, but then was fired 2 months later because he proved himself to be woefully incompetent when it came right down to it
<mcrod>
that's the shit I'm talking about for the most part
<zid>
also nothing new, that CS programs were churning out mathematicians and not programmers for 20 years
<mcrod>
somehow did not know what a function was, what the command prompt was
<immibis>
cs is literally a mathematics program
<zid>
yea, but it was "the" degree that unis offered
<zid>
and google wasn't even hiring anybody without a degree
<immibis>
mcrod: would you hire someone who couldn't write fizzbuzz?
<mcrod>
probably not
<mcrod>
but it would also depend on the situation at hand (i.e., stress makes you stupid)
<mcrod>
my first interview I was shaking and damn near pouring sweat through my shirt
<mcrod>
almost forgot everything
<mcrod>
people forget the psychological component to these things 99% of the time
<bslsk05>
github.com: BadBuzz/zid2.c at master · AbstractBeliefs/BadBuzz · GitHub
<zid>
Had to look through my followers, apparently some guy named PEDRO FALCATO follows me
<mcrod>
immibis: now, if someone's been in the field for any decent amount of time and they can't solve fizzbuzz, that's a different matter, they're gone
<zid>
I mean.. I could solve it within a week of learning basic
<mcrod>
but interviews are stressful.
<zid>
even if I had to write nonsense
<mcrod>
and people gravely underestimate what stress can do
<zid>
like if(a - (a / 3)*3 == 0)
<mcrod>
my interview at my current job was 4 hours long
<immibis>
we are not talking about couldn't write fizzbuzz during the interview. We are talking about couldn't write fizzbuzz
<mcrod>
oh couldn't write fizzbuzz at ALL
<mcrod>
yeah, then no
<immibis>
ok now what about people who can't solve this water problem
<mcrod>
can you solve every single problem on leetcode though
<mcrod>
have you tried
<immibis>
I don't know all the problems on leetcode. I just know this one and I know that it's labeled "hard"
<mcrod>
the answer is going to be "no, I haven't, and I wouldn't"
<mcrod>
but I never said you were a shit programmer because of it.
<zid>
I'm sure one or two are beyond me to write *reasonably* but I could probably get *a* solution to all of the ones I can understand without having to ask follow-up questions
<mcrod>
not saying you said that
<zid>
I'm sure one or two are worded weirdly
<zid>
or use a math term I don't know
gmacd has quit [Ping timeout: 240 seconds]
<mcrod>
i don't know anyone who _didn't_ solve the water problem that I showed this to, but it took them a minute
<zid>
I can solve it like 5 different ways :D
<mcrod>
congratulations
<zid>
we should COMPETE
<zid>
AT LEET CODING
<mcrod>
here's my overall point: I would sooner take the guy who had projects on his github that he could talk through and explain, rather than some dude who grinded out problems with solutions that either leetcode gives you, or ones that you can just google
<zid>
same
<zid>
mainly because people who are "into" code golf
<zid>
tend to be very specialized nutjobs
<zid>
I'm not sure I'd want to be friends with the guy who comes first in advent of code's leaderboards
<zid>
even though they're probably a better programmer than me
<zid>
don't like that level of sweaty :P
<zid>
I like a cool consistent 60%
<mcrod>
at least with projects that you can show off and talk about, it proves that you can start at 0 and work your way up, truly 0
<zid>
Why do I have no blue science packs!?
<zid>
oh I fucked up a belt
<mcrod>
cmake toolchain files are annoying
<mcrod>
there are like 5000505050050 cmake variables and they only show you like 20 in the manual for the toolchain
<zid>
cmake is a project unto itself
<zid>
It's like the old addage about using regex
<zid>
"I had a problem so I used a regex, now I have two problems"
<mcrod>
the jamie zawinski quote
<mcrod>
yes i knew that was coming
<zid>
"I had a build issue so I used cmake, now I have two build issues" :p
<immibis>
or wrote your own build system
<immibis>
the ideal build system is just a shell script with automatic memoization
<zid>
Worked for the kernel
<immibis>
or perhaps on the other extreme, labview
<zid>
kconfig is a beauty
<zid>
it builds in tree in seconds, works great
<immibis>
the kernel's build system is just make, but objs-${config_option} is pretty weird
<pog>
if you've got build problems i feel bad for you son, i've got 99 problems but cmake ain't one
<zid>
poogle
<zid>
what cha doogle
<pog>
chllin
<pog>
wife is making fritatta
<zid>
is that a sex thing
<mcrod>
no...
<pog>
it's an egg thing
<zid>
so a sex thing
<mcrod>
then yes
<zid>
I tried to do an egg thing earlier it didn't go well
<pog>
dang
<clever>
immibis: it basically just builds ${obj-y} into the kernel, and ignores ${obj-n}, so that trick lets you easily make things conditional without if statements
<pog>
style opinion, i want to eliminate my if (EFI_ERROR(blah)) {return blah;} blocks, so i started making a macro but idk about hiding a return in a macro
<pog>
seems smelly
SerHack has joined #osdev
<SerHack>
Is there any example of using grub with armv8-cortex?
<zid>
grub exists for non-x86?
<zid>
oh, efi grub?
<zid>
install it, gg, you're welcome :P
<immibis>
clever: yes, and that is weird. normal people write something along the lines of if(config) objs += :)
<immibis>
pog: why is it smelly?
<immibis>
is it because someone told you "no return inside macros" or is it because you think it is the wrong way to handle errors?
<pog>
it's because it seems a little hinky to read and not see that a control flow change might happen
<immibis>
then call the macro RETURN_IF_ERROR
<pog>
this isn't a dogmatic thing, it's just something that irked me when i started writing it
<pog>
makes sense i guess
<immibis>
bam, now you know it returns if there's an error
<pog>
true
<zid>
same pog
<zid>
It feels gross but probably works nicely
<pog>
it's definitely less annoying to write
<clever>
immibis: ive run into problems with such a macro, when i try to use it in a void function
<clever>
but maybe thats more a problem of not being able to return an error when i should
<pog>
i looked up some other ideas and maybe i could write two macros, one that accepts a "what do" param and one that has a default return whatever
<immibis>
"i should return an error" is more of a smell than using a macro to do it
<pog>
hmmmm
<immibis>
is it really a useful thing to do with the error?
<immibis>
when you do some high-level action in windows and a dialog pops up that says "invalid parameter"... is that really useful?
<pog>
in this specific case yes because the error isn't necessarily fatal
<immibis>
e.g. drag a file from one window to another and it says "invalid parameter"
<immibis>
that is totally useless and it would actually be more useful if each layer in the call stack would replace it with its own error, then at least you would get something like "opening destination file failed"
<immibis>
then you'd at least have an area to focus on
<zid>
veni, veni, venias, ne me mori facias
puck has quit [Excess Flood]
<mcrod>
you can't start the fight zid, i don't have my buster sword
puck has joined #osdev
<zid>
estuans interius, ira vehementi?
<zid>
sors immanis, et inanis
<pog>
hvað the fuck are you að talar um
<GeDaMo>
Sic gorgiamus allos subjectatos nunc
<mcrod>
my shell scripting knowledge is growing stronger
<mcrod>
like a cancer
<pog>
carcinification
<pog>
become crab
<zid>
correct
<bnchs>
hi
<mcrod>
the script can build cmake and ninja now
<mcrod>
now... onto the true evil
<mcrod>
LLVM
<zid>
Noli manere, manere in memoria
<zid>
saevam iram, iram et dolorem
<zid>
^ cmake song
<bnchs>
is this a joke about how outdated cmake is?
<mcrod>
well the way this is going to work, you can just say `cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE:STRING=Release -DSAMETHING_USE_COMPILER_SUITE:STRING=GNU -DCMAKE_TOOLCHAIN_FILE:STRING=cmake/toolchains/unix.cmake -DSAMETHING_BUILD_QT_FRONTEND:BOOL=ON` like the monstrocity it is.
<zid>
simples
<mcrod>
discord is dead
<mcrod>
zid: hey, how would you feel if an emulator implemented autovectorization in their JIT
elastic_dog has quit [Ping timeout: 240 seconds]
elastic_dog has joined #osdev
<zid>
mcrod: fine?
<zid>
why?
<mcrod>
i forgot where i was going with that
<mcrod>
forget it
<pog>
hi
<zid>
My emulator implements antivectorization
<zid>
by refusing to do anything in batches
<zid>
I need to write scheduler for it at some point
<zid>
I don't *really* care about speed though so I never bothered
<immibis>
mcrod discord has killed everything that's not discord or reddit, just like every capitalist endeavours to do
<zid>
entiritey of human knowledge is now relegated to discord pins :P
<GeDaMo>
Reddit is currently trying to kill Reddit :|
<pog>
it's doing a great job
<mjg>
reddit? :p
<mjg>
brah
<pog>
bruh moment
<mjg>
reddit is a massive shithole
<mjg>
besides it is kind of passe now i think, with all the youngsters on discord
foudfou has quit [Remote host closed the connection]
<pog>
don't tell violentacrez about the youngsters on discord
foudfou has joined #osdev
<mjg>
GeDaMo: so what's happening?
<mjg>
(really though, reddit is not good for anything but shitposts and that's only if you are generous)
<pog>
there were some decent hobby subs
<pog>
like i used to be on r/aquariums a lot when i kept a tank
<pog>
but the default subs, all trash
<mjg>
by default all subs go to shit past certain size
<pog>
yes, there's a critical mass of shit
<pog>
after which it becomes a shit reactor
<GeDaMo>
They want to charge for accessing their API, it may mean independent Reddit apps closing down
<mjg>
can you name some?
<pog>
baconreader
<pog>
baconreader was actually good
<GeDaMo>
"Reddit is Free", I think
<mjg>
i thought reddit has dogshit interface, then i was gifted some gold and it turned out the less dogshit is hidden behind it
<mcrod>
i have two things blackholed at router level: fox news, tiktok
<mcrod>
reddit might be nexet
<mcrod>
next*
<pog>
and every time since i've become some kind of moderator in an online space i end up having to deal with the type of people that made me quit reddit
<pog>
i don't have the stomach for that kind of thing
<zid>
badwomensanatomy is a good badsub
<immibis>
mjg: reddit is banning every way to access reddit except for the steaming pile of adware garbage
<immibis>
pog: oh so you're probably the person who banned me for saying genocides are still bad if the people doing the genocide call themselves socialist
<pog>
no
<pog>
those are the people that drove me away
<zid>
The main sub I browse has a no politics rule
<immibis>
there's this group of people called tankies, who are basically nazis that call themselves socialists and wave socialist flags instead of nazi ones, but still follow thinly disguised nazi ideology
<immibis>
they control several subreddits that you'd think would be socialist
<pog>
yep
<zid>
we had a tankie in one of the discords I was in
<zid>
he's the only person ever to have been banned
<pog>
they're very stupid
<immibis>
by not being one and leaving, you contribute to them being the only moderators of that subreddit
<pog>
lol ok
<zid>
or you're complicit
<zid>
there's no winning
<zid>
If the alt right infiltrates, you remove it or you become a nazi bar, there's no middle ground
<zid>
if you stay you're just a member of a nazi organization
<mjg>
pog is sitting in a swastika t-shirt
<pog>
there was a power play at the time i was there. the tankies got their way
<pog>
mjg: that's not funny please don't
<zid>
I only do power-bottom plays
<zid>
aka laziness
<zid>
but still demanding
<immibis>
zid: tankies seem to have more power than actual communists/socialists
<pog>
most of them are just chronically online
<zid>
where the hell are you hanging out such that you're *regularly* exposed to tankies
<immibis>
it's much more common to be thrown out of a space because you think voting for biden in 2024 is a good idea, than to throw a tankie out of your sensible space
<immibis>
zid: the internet
<zid>
Like, I've never *personally* met a q-anon/trump/gop person
<zid>
because I just don't hang out anywhere they would
<zid>
standards and all that :p
<immibis>
internet political spaces means mostly reddit and twitter, and sometimes discord spaces associated with reddit and/or twitter
<zid>
well yea, I wouldn't touch those with a 1000ft pole
<mcrod>
zid be grateful.
<mjg>
pog: aight
<zid>
mcrod: I knew a mormon once, he was funny
<zid>
we just used to give him shit about his magic underwear
<mjg>
i am saying insisitng people are clearly only on either extreme of any issue
<immibis>
zid: you can't just ignore politics either, that's how the nazis (including tankies) win
<mjg>
is the classic of internet discourse
<pog>
yes
<mjg>
which reminds of shitwehraboossay or similar
<mjg>
that sub or another in that vein had a great picture once
<mjg>
lemme try to find it
<zid>
Good news, you can, and by ignore I mean blanket ban. And no that isn't susceptible to infiltration, because I mean blanket ban, not "allow things that are non-controvertial"
<zid>
which is infact, politics
<immibis>
what you are describing is not apolitical, it is anti-change politics
<zid>
It's the complete non-engagement of.
<pog>
is osdev political
<mjg>
shiet, can't do it
<zid>
Yes
<mjg>
anyhow bottom line was that any time people bring up ww2, there is this weird respect to wehrmacht and/or ss
<immibis>
the current trajectory is heading towards a second holocaust. by prohibiting anything relating to changing that trajectory, you are helping to enable a second holocaust
<pog>
mjg: "are we the baddies"
<zid>
see, I told you
<zid>
I just got called a nazi
<mjg>
pog: :]
<immibis>
no, you got called incredibly naive
<mjg>
that was a good skit
<pog>
yes
<mjg>
pog: have you seen peep show?
<zid>
immibis: sorry I don't talk to tankies, bye
<pog>
i have, with mark's weird wheraboo thing
<immibis>
now you are trolling... in a way indistinguishable from how the far right trolls
<pog>
in any case, getting involved in political stuff online is a waste of time because there's nothign i can do to affect change that way. i just try to do what i can to affect change locally on the small scale
<mjg>
looking for the elusive person who changed their mind after an argument on the internet
<pog>
i might have a discussion here and there but it's so easy for that to devolve into feeling misunderstood or jacketed with something i neither said nor implied and yeah
gmacd has joined #osdev
<zid>
mjg: occasionally people are just misinformed, occasionally
<mjg>
that person will be the missing link between humanity and the next species
<mjg>
the only thing people seem to agree on is that by default humanity is full of shit
<immibis>
pog: maybe you can't change a nazi's mind by arguing with them, but banning them is useful and effects change
<pog>
i mean yeah absolutely ban them
<immibis>
also anything that embarasses them is good. They don't care about logic, they do care about power and face
<zid>
pog: please don't feed the tankies
<immibis>
zid keeps using that word; I don't think he knows what it means
<immibis>
zid is what's sometimes called an Enlightened Centrist, perfectly summed up by that comic... Nazis: "We want to gas the Jews!" Jews: "We don't want to be gassed!" smug looking guy in the middle: "Can't we compromise?"
<immibis>
zid is the smug looking guy in the middle
<zid>
immibis: keep calling me a nazi, I'll keep calling you a tankie
<zid>
it's literally that simple
<zid>
stupid fucking tankies
<zid>
can't even do 1+1
<pog>
i'm sorry that my confession about reddit started this conversation
<pog>
i'm gonna bounce
pog has quit [Quit: byee]
<immibis>
zid: you are very quick to find excuses to be outraged. Can you point to the part where I called you a Nazi?
<zid>
Can you point to the part where I called you a tankie?
<zid>
You are very quick to find excuses to be outraged.
<mcrod>
i go downstairs to make a sandwich
<mcrod>
and I come back to this
<zid>
mcrod: I'm busy starting a holocaust apparently, dw, immibis will save us, probably by letting china roll tanks over me if I had to guess
<mcrod>
reality: nazi-ism is very very bad, but it will take probably another 100 years before it is eradicated
<mcrod>
people are astonished, astonished I tell you that nazis are still around, hasn't even been 100 years since WWII
<immibis>
zid: you are being the troll you claim to not allow in the spaces you moderate
<zid>
immibis: I don't moderate any fucking spaces
<zid>
why the fuck would I put up with twats like you *anywhere*
<mjg>
aight
<immibis>
ah my mistake. you are being the troll you claim is not allowed in the main subreddit you browse
<mjg>
i think this has gone long enough
<mjg>
i'm gonna play channel police and tell both of you to STFU kthx for cooperation and have a nice day
<zid>
I'll accept a permaban if he does
<zid>
I don't wanna be here if he's going to stay here calling people nazis (not just me, gog too) because I refuse to not hang out with nazis on reddit like he does
<zid>
which is the dumbest fucking reason I've ever heard for being a tankie
<mcrod>
"you are helping to enable a second holocaust"
<zid>
"I want to hang out with nazis"
<mcrod>
only on IRC could I have witnessed something like that
<mcrod>
this is pretty much the reason why I'm partially convinced the world at large was not ready for the internet
<immibis>
mjg: sadly you are not a channel op
<zid>
checking over your shoulder?
<mcrod>
plenty of people are ops here that don't maintain op status regularly
<mcrod>
they only elevate when needed
<immibis>
he is also not someone with the +o chanserv flag
<mcrod>
but yeah, i'm of the opinion that you implicitly called zid a nazi too
<zid>
I'm not allowed ops because there'd be me and like 4 other people left in any channel :D
<mjg>
if you want to keep discussing this shit take it private
<mcrod>
well i have nothing more to say
bgs has joined #osdev
zxrom has quit [Quit: Leaving]
<sham1>
immibis: I'd just like to point out that what you call "enlightened centrism" is mostly a strawman concucted by terminally online people
gmacd has quit [Ping timeout: 240 seconds]
<immibis>
sham1: in what way is it not a description of a thing that is actually happening here?
<sham1>
By not being a description of such
<sham1>
You read motives and such into the actions of others without evidence for such
kfv has joined #osdev
<bnchs>
wtf happened here
<bnchs>
i see "nazi", i see other shit
gmacd has joined #osdev
Left_Turn has joined #osdev
heat has joined #osdev
<heat>
mjg, ok so is there a downside on spinlock vs rw spinny?
xenos1984 has quit [Read error: Connection reset by peer]
<heat>
i see the linux xarray stuff (and in 4.0 the lock in address_space (your vm_object for the page cache)) uses normal spinlocks
<heat>
for Some Reason
heat has quit [Read error: Connection reset by peer]
<bslsk05>
github.com: Onyx/main.c at io-queues · heatd/Onyx · GitHub
<heat>
note: ASAN so results are not entirely representative, particularly on allocs
<mjg>
mcrod: do i look like gog
<mcrod>
you have a g
<mcrod>
so partially
<heat>
s/mj/go/g
<mjg>
you reminded me there was absolute bullshit i wanted to patch in linux
<heat>
anyway in that flamegraph you can see i have a mutex and it's choking everyone out. although I have slightly different temporary constraint there where threads actively sleep for IO with it
jjuran has quit [Remote host closed the connection]
<mcrod>
is that kcachegrind
<mjg>
heat: what i see is your mutex unlock keeps taking a spinlock
<mcrod>
i swear there's something k sounding that is used to generate flamegraphs
jjuran has joined #osdev
<mjg>
which shoudl only happen if you have fuckers to wake up
<mjg>
DO YOU
<heat>
mcrod, no it's Flamegraph.pl + my own tracing "infra"
<mcrod>
ah
<heat>
see brendangregg/flamegraph on github I think
<heat>
not to be confused with dicksites
<zid>
If I ever do smp stuff I'm not sure if I should just let mjg do it, or do it myself and refuse to fix it just to get a rise out of mjg
<mjg>
that's known as openbsd
<heat>
mjg, yeah my mutex is still kinda wank
<mjg>
there you go
<mjg>
spoken like an actual developer
<heat>
i'm way prouder of my rwlock
<mjg>
i take it back
<mjg>
here is the first rule of being a real developer
<mjg>
ALL CODE IS CRAP
<heat>
fully adaptive spinning, tries to deal with the garbage problem with spinning on readers, etc etc
<mjg>
<heat> i'm least unfond of my rwlock
<mjg>
there
<mjg>
now write it 3 times
<zid>
ar eyou making heat do lines now
<mjg>
i'm doing full stack mentoring here
<zid>
I mean bart simpson style, not his usual nose candy
<mjg>
heat: do you even lift?
<heat>
yes
<mjg>
how much do you benchpress
<mjg>
or was that a joke :(
<zid>
bench press is for posers
<heat>
hmm, i'm not sure, not much though
<heat>
like 40kg or so
<zid>
mjg how big of a boulder can you put ont a barrel
<mjg>
wtf why is get_file_description 1. named like that 2. taking as pinlock
<heat>
i started going regularly to the gym like a month ago
<heat>
1) because a file descriptor points to a file description
<heat>
2) because I still don't have a weird RCU-like hack for it
<mjg>
1) i forgot you are a c++ person
<mjg>
fd2fp would be a true unix name
Arthuria has joined #osdev
<heat>
_____fd_get
<mjg>
but they went with fget
<mjg>
i'm saying the name is verbose as your mom and for nothing
<heat>
ok i'll change it when I rework that stuff
* mjg
takes notes
<mjg>
do you also have a comment above it saying it translatetes from a fd?
<heat>
i dont think so
<heat>
i didn't doxygen that stuff
<mjg>
this reminded me of a paper on automagic code quality assessment
<mjg>
part of their methodology was to count comment to code ratio
<zid>
I forget if my gb emu has a comment or not
<mjg>
bigger being better
<mjg>
they missed the part where beginners are told to write dumbfuck comments
<zid>
It has a couple of annotations, but I'm not certain it has a single comment
<mjg>
so you get codebases with tons of useless commentary
<mjg>
and which by that metric is A+
<zid>
shit, it has comments :(
<zid>
/* Any write to this register resets the timer */
* mjg
slaps zid
<zid>
/* Delays the counter reload by a tick */
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
gmacd has joined #osdev
<mcrod>
i am sleepy
<mjg>
lord of the cores: spinlocks of slower
<heat>
mjg, does freebshitd also have a rw lock for inode read/write
<mjg>
yes and no
<heat>
it seems that writing to a single file cannot be done concurrently in linux, they usually lock the inode
<mjg>
there is a sleepable rw lock but most filesystems only support write locking
<heat>
I can't exactly tell why, i don't think POSIX requires that writes do not tear?
<mjg>
posix requires writes to be atomics
<mjg>
but you could still have parallelism for non-conflicting writes
<mjg>
... which almost never happen
<mjg>
the real lock, which is handrolled around it, is range lock
<mjg>
again most likely turbo waste of code
<mjg>
and cpu cycles
<heat>
ohhhhhh ok i see, this sucks then
<mjg>
this understates it quite a bit
<heat>
i can't explain any of the contention I have with the mutex
<heat>
since it's all wrapped in the inode rwlock
<mjg>
and is that a write lock?
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
<mjg>
it really should not be hard to find who owns the lock when you are waiting for it
* geist
yawns
<geist>
mjg is back! the flamegraphs shall continue until performance improves
<bslsk05>
chromium.googlesource.com: Chromium Docs - LLD for Mac builds
<geist>
mcrod: good question. normally i think apple uses their own ld, since you can LTO compile all you want
<geist>
but lld maybe is behind with LTO + macho binaries, etc
<mcrod>
right, I was just wondering if LTO is enabled and you're on a mac, if you should just use the system linker instead of lld, otherwise if LTO isn't enabled then just use lld
<geist>
yah. system linker
<mcrod>
ok, neat
<geist>
since LTO i know seems to work fine with system clang + system linker
<geist>
it begs the question as to why you'd want to use lld instead of the system linker in the first place
<geist>
but there may be advantages
<mcrod>
speed
* geist
nods
<mjg>
fentanyl
<mjg>
speed is passee
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
<heat>
i had crippling bugs in my rw lock implementation
thatcher has quit [Remote host closed the connection]
<mjg>
they just let everyone through? :d
<heat>
yes
<mjg>
does that account for osmeo f the speed increase :X
<geist>
you just pessimized your locks by making them work. congratulations
<heat>
PESSIMAL
<geist>
i bet they work great on ITANIUM
<heat>
ITANIUM RUUUUUUUUUUUUUUUUST CARGO
<zid>
what about x86s
<zid>
(itanium 3)
<geist>
x86 is dead mang. ITANIUM
<zid>
it's dead already!? It's not even out yet, itanium is getting MORE EFFICIENT
<geist>
they're gonna remove x86 support in linux
<mjg>
's that a real remark tho
<mjg>
linux has a rather spotty record with removing obsolete garbage
* mjg
does not mention ITANIUM MOTHERFU^W
<heat>
ofc not
<heat>
x86 shall remain forever
<mjg>
believe it or not freebsd wants to remove it
<mjg>
:d
<heat>
that's why freebsd sucks
<mjg>
you are right for wrong reasons!
<zid>
"But, rest assured, this will be the third time we have destroyed it, and we have become exceedingly efficient at it." Intel talking about itanium.
<GeDaMo>
I can't place that reference :|
<zid>
the architect says it to neo about zion
<GeDaMo>
Ah
<geist>
yah matrix 2 or 3 movie
thatcher has joined #osdev
<mjg>
i pretend they don e
<mjg>
don't exist
<bnchs>
hi
<zid>
They're not bad, they're just.. not the same genre as the matrix
<zid>
they're action movies that has to fit some exposition in for a weird dark city remake
<jimbzy>
I guess you can adjust the opacity. It sucks how the best passes are in the evening because the satellites always switch from day mode to night mode.
<zid>
is that one of those new fangled japanese ones
<zid>
The lines look less like they're over the clouds once the clouds are animated
<zid>
TIL florida has a hole in it
<zid>
I mean, lower portugal*
<jimbzy>
South Portugal?
gmacd has quit [Ping timeout: 268 seconds]
<zid>
no I mean lower
<zid>
north is up is british imperialism
<zid>
(germany is upside down btw)
<zid>
lower germany is in the north
Turn_Left has joined #osdev
<jimbzy>
One thing I do need to do is 'glue' my SDR to a heat sink. It gets pretty warm working 137MHz with the LNA, so I can only imagine when it's receiving 1.69GHz.
gmacd has joined #osdev
<zid>
is it actually dependent on input freq?
<bslsk05>
cdn.star.nesdis.noaa.gov <no title>
<zid>
Like, is it doing sampling at a lower rate, or just always capping at MAX_HZ then sampling it down, etc
<jimbzy>
I think it's max all the time.
<zid>
plus hardware accel on the demodulation might be a thing too? So the cpu only sees the 20kB/s of actual data or whatever, too
<zid>
sounds like it's fine then
<zid>
but a tube of thermal glue off amazon is cheap and it sounds fun
<jimbzy>
It'll be ok. I might actually get a down converter when I get to that point, too.
Left_Turn has quit [Ping timeout: 240 seconds]
<zid>
SDR is useless now btw, kennedy steve retired
Left_Turn has joined #osdev
<jimbzy>
The ATC?
<zid>
ground controller, but yea
<zid>
Who knew listening to a parking attendant would be so fun
Turn_Left has quit [Ping timeout: 250 seconds]
dude12312414 has joined #osdev
innegatives has joined #osdev
dude12312414 has quit [Remote host closed the connection]
<Ermine>
and Popov Backup Center, which you know as tar
<zid>
how dare you imply I know what tar i
<zid>
is
<zid>
some of me is stupid
<innegatives>
i bet he even left a crude malware in
<GeDaMo>
It had Windows too? :P
<innegatives>
windows is epitome of engineering as evidenced by its unwillingness to let there be unused ram in system
<Ermine>
innegatives: I tried it in a VM, didn't find anything suspicious
<Ermine>
Not that I looked hard
<Ermine>
But I don't think he ever knew how to do anything nasty
<mjg>
Ermine: i just rememebered a game mostly consisting of stolen music and art pieces
<mjg>
the game itself was shit af too
<mjg>
i'll try to find it
<innegatives>
windows literally crunches something on background with 8gbs of ram and windows users justify it by saying unused ram is wasted ram, no one stops to ask, "what is it really crunching?"
<Ermine>
Anyway, that tv channel released a debunk several months later
<mjg>
oh they did?
<mjg>
heh
<jimbzy>
Windows is only bad if you try to use it. You're supposed to "experience" it, or something.
<mjg>
fwiw i have 0 trust in interviews in mass media
<mjg>
same with articles about people
<mjg>
it's fact-less garbage
<zid>
jimbzy: Can I experience windows 7 again, I hate windows 10
<zid>
I did finally figure out how to make it shut the fuck up though
<mjg>
can't find the freakin game
<mjg>
:/
<mjg>
it stole everything
<mjg>
from numerous games
<zid>
You can tell it your machine is critically important and should not be nagged about updates for the next few days
<zid>
then edit that value in the registry to 2 billion days
<zid>
:D
<mjg>
>
<mjg>
Story confirmed. The guy is 16 years old, and still in high school. Basically, it is the media hype and the outrage that the people aware of the Linux world have felt that has come to this discussion. Overall, I believe a letter of warning and a call to acknowledge his fraud would suffice. Thank you
<mjg>
:d
rnicholl1 has joined #osdev
luke86 has joined #osdev
<zid>
Hmm, does anybody want to buy a lion, I massively misunderstood pride month