Following
0
Followers
0
Posts
122
Imported by PSI
Reply to @[email protected]
Reply to @[email protected]
@georgia@netzsphaere.xyz @pernia@freespeechextremist.com @meowski@fluf.club @pasture@pl.gamers.exposed @rdr@posting.lolicon.rocks @user@freespeechextremist.com > your initial position of gpl software sucks was indefensible It's a perfectly defensible position because all software sucks. Take the Al Viro pill.
Reply to @[email protected]
@meowski@fluf.club @georgia@netzsphaere.xyz @pasture@pl.gamers.exposed @pernia@freespeechextremist.com @rdr@posting.lolicon.rocks @user@freespeechextremist.com The end of the rabbit hole is just that you make peace with the compiler being terrible like compilers were in the 80s but for different reasons and with no escape and periodically someone says "Actually, this is good."
Reply to @[email protected]
@shironeko@fedi.tesaguri.club @georgia@netzsphaere.xyz @meowski@fluf.club @pasture@pl.gamers.exposed @pernia@freespeechextremist.com @rdr@posting.lolicon.rocks @user@freespeechextremist.com > debugging behavior is not relevant to optimization. If you've got a bug that only manifests with optimization on, it is. > you told compiler to do it and it did what you asked. This happens with -O0, no optimization, which I keep forgetting because it's too egregious to make sense. (On the other hand, since this is not an optimization, it makes a kind of perverse sense.) Here's this from the note I made about it last time:
Reply to @[email protected]
@Wrest@audiochad.xyz That is an excellent domain name.
Reply to @[email protected]
@meowski@fluf.club @georgia@netzsphaere.xyz @pasture@pl.gamers.exposed @pernia@freespeechextremist.com @rdr@posting.lolicon.rocks @user@freespeechextremist.com > the trade off there would be memory usage vs speed. There's actually no trade-off there. It boils down to "deref address in register into other register" a few times, then increment, store result, then a comparison. It doesn't need to reload before the comparison. > puts vs printf example is pretty innocuous. if you don't wnt to disable them entirely, you can also generate a report of which optimizations were used In this case, it's "-fno-builtin", and it happens with optimization off.
Reply to @[email protected]
@meowski@fluf.club @georgia@netzsphaere.xyz @pasture@pl.gamers.exposed @pernia@freespeechextremist.com @rdr@posting.lolicon.rocks @user@freespeechextremist.com Yeah, I'm just saying, this is bad, the compiler should not do this, and should not have to be told not to do this. Messing with stuff around function calls is bad but it does the pointer-chase twice for something like "x->y->z++; if(x->y->z > 10) stuff();". Memory traffic's what gets you nowadays but the dragon book is about register allocation and compiler authors apparently would rather stick to that kind of thing.
Reply to @[email protected]
@coin@asimon.org @pernia@freespeechextremist.com It looks bigger given that it's fixed-width, but that's mostly incidentals; .status-content being 140% makes the posts' text bigger and the rest is names and buttons and stuff.
Reply to @[email protected]
@pernia@freespeechextremist.com Beware, it is sloppy and haphazard: body { font-family: "Bitstream Vera Sans Mono"; font-size: 9px !important; } .status-uname, .status-reply-to-link, .status-reply-container .fa, .status-reply-text, .status-reply-link, .status-visibility, .remote-link, .more-link { font-size: inherit !important; } textarea, input, button, select { font-family: inherit !important; font-size: inherit !important; } .status-content { font-size: 140% !important; max-width: 60em; } .status-action { background-color: rgba(128, 128, 128, 0.3); font-size: 80% !important; } .page-title { font-size: 1.1rem !important; font-weight: bold; } .post-form *[type="reset"] { margin-left: 50%; } .post-form *[type="submit"] { font-size: 1.3em; }
Reply to @[email protected]
@pernia@freespeechextremist.com It is slightly riced, like I highlighted the buttons and I set the fonts to be fixed-width and adjusted sizes and moved the "Reset" button so it's not RIGHT NEXT TO "Post".
Reply to @[email protected]
I'm actually pretty okay with a pyramid scheme that makes Moon wealthy.
Reply to @[email protected]
@socjuswiz@spinster.xyz @georgia@netzsphaere.xyz @meowski@fluf.club @pasture@pl.gamers.exposed @pernia@freespeechextremist.com @user@freespeechextremist.com > The produced executable does not behave differently when run. I gave two examples of it behaving differently, I can give more. > looks into implementation details. Have you never used a different libc? > A process in a UNIX environment should be seen as a blackbox with the following inputs and outputs: This is not a rule for a Unix environment. This is also a pants-on-head stupid non sequitur. A C compiler is not a Unix environment. C runs in several places that are not Unix environments. gcc is used in many of those places. "Unix" is not an acronym. (According to BWK, the small-caps style was due to excitement over adding small-caps to the typesetter.) If including an example of something as wild as "using the debugger and expecting that the program will do what you wrote" makes the example "wonky", I don't know how to help you. (Apparently v7's adb had breakpoints. But nobody was around to standardize the OS back then so I suppose Unix didn't exist until some time in the late 80s. One wonders how they got anything done!) gcc is a program inside this environment, I have executed it, and when I did, gcc has read some files and has written some files and I did not like its output. The output is not special simply because it's not text and the compiler is not special simply because it's a compiler: it's reading and writing and it has performed a bad transformation at one point. > The functions in the C and POSIX standards aid in ultimately producing this blackbox. This is the absolute worst way of viewing a standard. You have joined some sort of cargo cult: "Don't rely on implementation details remaining constant" is a very different thing from "Your environment is a black box." What you have described is not what a standard is for, it is not what this standard is for, and it is Even with your idiosyncratic rules, this is not the goal of a standard, and the standard is a guideline for implementors, and I am using a C compiler, not writing a POSIX-compliant system. POSIX is not the only OS standard, it is not the only Unix standard, it is not the C standard—of which there are also many–a standard is not the word of God, and POSIX is garbage anyway. *Should* the C compiler do this? I don't know, apparently unless I join a standards body, I'm not allowed to ask that question! "Not all that is lawful is honest" is a better way to approach this. "Is it the right thing to do?" is a very different question from "Is it legal?" If it's stupid behavior and the standard allows it, then the standard is not relevant for discussion of the behavior. If it's stupid behavior and the standard *requires* it, then the standard is stupid. In either case, "It's allowed to do this" is not a relevant point. Try, even once, writing a performant compiler or bytecode interpreter, or writing embedded software. Which functions the thing calls matters. It matters whether or not it translates to the same number of syscalls. Even if you're in a completely normal-looking Unix system, syscall overhead matters in any case where performance matters. If you are making anything, anything at all, that thing's dependencies are going to matter if you want it to actually work. If you write C, you will, sooner or later, have to stop pretending that you don't know how the stack works, or how paging works, or how syscalls work, or how your system lays out its memory, or how it works on other systems on which you expect your code to run, or endianness, or any of that. Go do whatever you people do: write another clone of grep in Rust, write an impassioned blog post defending Haskell's excessive memory usage, opine on Hacker News about how nobody but you really *gets* Dijkstra, or something. Adults are talking in this thread.
Show more
@10grans@fedi.cc beg I'm a co-conspirator!
Reply to @[email protected]
@user@freespeechextremist.com @georgia@netzsphaere.xyz @meowski@fluf.club @pasture@pl.gamers.exposed @pernia@freespeechextremist.com > Tf? It's got to alter the string constant in order to cut the newline off so that it can use puts() instead of printf(): echo '#include int main(int argc, char **argv) {printf("Hello, World!\n");return 0;} '>/tmp/hello.c && gcc -O3 -S -o /tmp/hello.s /tmp/hello.c && grep Hello /tmp/hello.s # This prints '.string "Hello, World!"' rather than '.string "Hello, World!\n"'. It's different behavior, so it's not an optimization any more.
Reply to @[email protected]
@meowski@fluf.club @pernia@freespeechextremist.com @georgia@netzsphaere.xyz @pasture@pl.gamers.exposed @rdr@posting.lolicon.rocks @user@freespeechextremist.com gcc takes some excessive liberties. As far as I'm concerned, swapping out function calls by relying on knowledge about the stdlib (the way I found out it was doing this was it changed a printf() to a puts(), but it does this with a lot of libc functions) is way over the line.
Reply to @[email protected]
@pernia@freespeechextremist.com @user@freespeechextremist.com @georgia@netzsphaere.xyz @meowski@fluf.club @pasture@pl.gamers.exposed Yeah, it even changes function calls and then changes string constants to fit the new calls. It's ridiculous.
Reply to @[email protected]