|
I have been overinflating my ticket time for the last 3 months and not only has nobody caught on, but I just got a glowing review. I've been working ~25 hours a week for the last 3 months and nobody cares. Moral of the story: Never ever work free overtime, and lie about ticket times.
|
# ? Mar 13, 2020 17:12 |
|
|
# ? May 30, 2024 13:08 |
|
C’s strength is that it is implementable as a mostly literal translation of code into the lowest-level abstraction expressible by programmers. It also tends to have essentially every lower-level hardware capability directly surfaced in it in some way, often as some sort of builtin. This means that you can write a C program that does essentially anything the hardware can do without worrying too much about the implementation interfering with what you’re trying to do, although compilers do sometimes make that difficult. (It also means, of course, that is very difficult to make holistic, high-level guarantees about correctness, which is usually much more important to your program.) This is much less true of higher-level languages, where there are almost always limitations or unavoidable abstraction costs.
|
# ? Mar 13, 2020 18:03 |
|
Dr. Stab posted:Which language has the most torque? Fortran, unironically.
|
# ? Mar 13, 2020 18:36 |
|
NtotheTC posted:can't argue with that. footguns are just as powerful as regular guns Just try to line up your foot with the problem <taps noggin> Munkeymon fucked around with this message at 21:11 on Mar 13, 2020 |
# ? Mar 13, 2020 19:18 |
|
So node.js is the most powerful since it has a V8?
|
# ? Mar 13, 2020 20:28 |
|
if c was meant to be a portable assembly, then c compilers wouldn't do any optimising, since assemblers don't do any optimising it also wouldn't have types
|
# ? Mar 14, 2020 03:09 |
|
redleader posted:if c was meant to be a portable assembly, then c compilers wouldn't do any optimising, since assemblers don't do any optimising There is a huge difference between C as it was first created and modern C as standardized.
|
# ? Mar 14, 2020 05:59 |
|
OddObserver posted:There is a huge difference between C as it was first created and modern C as standardized. i refuse to acknowledge this fact
|
# ? Mar 14, 2020 06:44 |
|
redleader posted:if c was meant to be a portable assembly, then c compilers wouldn't do any optimising, since assemblers don't do any optimising Many c compilers have the option to print the C lines has comments next to the assembler it would generate. Is was not a 1:1 and not even a perfect 1:2, but it was generally similar enough to follow. I saw a compiler do this (it was a Wacom compiler with all the optimizations enabled): c = 0; c ++; printf("%d",c) this would print 0. looking at the assembler code would tell you what the gently caress is going on and what the compiler is doing wrong.
|
# ? Mar 14, 2020 11:13 |
|
redleader posted:
listen it's trying as hard as it can
|
# ? Mar 14, 2020 12:59 |
|
Tei posted:Many c compilers have the option to print the C lines has comments next to the assembler it would generate. Is was not a 1:1 and not even a perfect 1:2, but it was generally similar enough to follow. What the gently caress is going on there?
|
# ? Mar 14, 2020 13:22 |
|
Soricidus posted:What the gently caress is going on there?
|
# ? Mar 14, 2020 13:24 |
|
Soricidus posted:What the gently caress is going on there? A compiler error. Lowering the optimization level fixed it. Tei fucked around with this message at 18:02 on Mar 14, 2020 |
# ? Mar 14, 2020 17:54 |
|
Volte posted:Looks like that compiler didn't support c++
|
# ? Mar 14, 2020 18:01 |
|
Phobeste posted:listen it's trying as hard as it can Volte posted:Looks like that compiler didn't support c++
|
# ? Mar 14, 2020 18:57 |
|
Volte posted:Looks like that compiler didn't support c++ Dammit I wanted to do that one. Tei posted:A compiler error. Lowering the optimization level fixed it. Optimization levels: Medium: If the value is not used after assignment, don't perform any calculations on it. High: If the value is just used for bullshit like printf after assignment, don't perform any calculations on it.
|
# ? Mar 14, 2020 21:05 |
|
Ola posted:Optimization levels: I wish I remember more of the details, but It was 20 years ago.
|
# ? Mar 14, 2020 22:51 |
|
seems to me that optimisations shouldn't change the observable behavior of a program, but then my brain is far too small and inadequate to comprehend the glory of c/++
|
# ? Mar 15, 2020 03:34 |
|
Optimizing C++ is very hard because it requires the compiler to be able to reason about arbitrary program behaviors. Good optimizing compilers do it well, but not every compiler is good, and this is one of the more common sources of compiler bugs. I remember an instance where a compiler optimized one of my destructors to something like this:code:
|
# ? Mar 15, 2020 03:37 |
|
GCC's -O3 optimization level is also historically known to break the standard and often even break programs in the quest for more optimization. Officially it no longer performs standards-breaking optimizations (those have been moved to -Ofast) but it also makes some assumptions about variable lifetime, caching and side-effects that can cause you nasty problems in, say, kernel or driver code. Also -O3 sometimes unrolls loops enough that they won't fit into your instruction cache anymore and as a result your program is both bigger AND slower on -O3 than on -O2.
|
# ? Mar 15, 2020 04:17 |
|
redleader posted:seems to me that optimisations shouldn't change the observable behavior of a program, but then my brain is far too small and inadequate to comprehend the glory of c/++ It's a bug.
|
# ? Mar 15, 2020 05:03 |
|
Ola posted:Optimization levels: code:
|
# ? Mar 15, 2020 12:24 |
|
Optimizing compilers for C is in essence running contrary to its design philosophy, its entire purpose was to just simplify some common asm patterns and to give the programmer all the power to do the optimization himself. There are tons of features that even in the 80's they knew hosed with automatic optimization: C calling convention forcing copy to stack, random bullshit that can be linked in from literally anywhere and of course the aliasing problem compounded with arrays degenerating to pointers. There is a reason, beyond legacy, that FORTRAN is still common in numerical applications. Most of the compiler advancements for decades was in that space and only later awkwardly ported to C/C++. All the UB bullshit is mostly to allow the compiler to make some assumptions to get any decent optimization done. There are plenty of instances of "faster than C" in other languages for certain workloads. Don't mind me, I'm just venting, I spend a lot of time these days looking at asm output and screaming abuse at the compiler.
|
# ? Mar 15, 2020 14:09 |
|
NihilCredo posted:
This is why professor code is so blistering fast and has no bad side effects.
|
# ? Mar 15, 2020 15:46 |
|
Plorkyeran posted:It's a bug. My brain has the same bug
|
# ? Mar 15, 2020 15:59 |
|
Beef posted:Don't mind me, I'm just venting, I spend a lot of time these days looking at asm output and screaming abuse at the compiler. Here's a recent compiler horror of that nature... How does this switch get compiled? All the inputs and cases are chars and their range is limited. Pretty easy right? I'm practically whispering into the compiler's ear to use a jump table. code:
code:
code:
|
# ? Mar 15, 2020 18:34 |
|
Is it any smarter if you do this?code:
|
# ? Mar 15, 2020 19:16 |
|
Spatial posted:lol same. I often have to go to assembly for speed critical stuff on embedded. Try putting in a few dummy cases? That might bias the compiler towards using a table. Comedy option: do it by hand using GCC's computed goto. Slightly less comedy option: if these are just simple function calls, use a table of function pointers.
|
# ? Mar 15, 2020 19:54 |
|
In reality they're all different cases with different code, the thingxyz stuff is just filler to make it easy to read. There is a way to get it to behave and that's to offset the cases so they range from 0-N. Then it'll generate the table. I imagine GCC will do a perfect job here. This is IAR ICCARM which is enterprise grade software: slower, worse, and several thousand dollars e: Yup! Spatial fucked around with this message at 21:06 on Mar 15, 2020 |
# ? Mar 15, 2020 20:07 |
|
I'm seeing relative jumps to the next instruction being generated by the compiler, which is interesting.
|
# ? Mar 15, 2020 21:09 |
|
Beef posted:I'm seeing relative jumps to the next instruction being generated by the compiler, which is interesting. Did you check the relocation records? Sometimes those are placeholders till dynamic linking.
|
# ? Mar 15, 2020 21:15 |
|
Good suggestion, I'll check. The whole thing is statically linked, and in this case I think it's libm being statically linked into the object file.
|
# ? Mar 15, 2020 21:42 |
|
'switch' has always been a weird wart in C, since it is not at all obvious what kind of assembly it's going to turn into (unless you assume a chain of conditionals). And of course, the ease with which case fallthrough has lead to bugs (although I think all modern compilers now warn by default).
|
# ? Mar 15, 2020 23:21 |
|
https://github.blog/2020-03-16-npm-is-joining-github/ Can github make npm great?
|
# ? Mar 16, 2020 21:55 |
|
rip github
|
# ? Mar 16, 2020 22:13 |
|
GitHub is Microsoft right, so npm is Microsoft?
|
# ? Mar 16, 2020 22:30 |
|
It's been a long time since Microsoft has done the whole embrace-extend-extinguish thing but I wouldn't mind if they brought it back just this once
|
# ? Mar 16, 2020 22:36 |
|
Kazinsal posted:It's been a long time since Microsoft has done the whole embrace-extend-extinguish thing but I wouldn't mind if they brought it back just this once What if they replaced nuget with npm though?
|
# ? Mar 16, 2020 22:48 |
|
leper khan posted:What if they replaced nuget with npm though? other way 'round
|
# ? Mar 16, 2020 23:02 |
|
|
# ? May 30, 2024 13:08 |
|
JawnV6 posted:other way 'round How sure are you that we live in the good timeline?
|
# ? Mar 16, 2020 23:44 |