3 ms·
Sir, while the gentlemen and ladies of this fine organization are infinitely pleased with your research into the black magic of the nether regions and the treat
by kbenson 10y ago
Sir, while the gentlemen and ladies of this fine organization are infinitely pleased with your research into the black magic of the nether regions and the treatise you have presented from aforesaid research, we would ask you please be even more strident in your warnings about practicing this subject. It seems a number of neophytes have disappeared under odd circumstances in the weeks since you presented your work, and the interruption to the experiments they were assisting with has become quite burdensome. Additionally, we expect training and recruitment costs to be quite a bit higher than normal next year, and as you well know our coffers are not unlimited.
- catnaroek 10y ago> black magic of the nether regions Or plain abstraction violation. “Black magic” gives it an undeserved good reputation: “I must aspire to be clever enough to understand and actively make use of this.”
- kbenson 10y agoMaybe. Given it relies on the calling convention of the OS you're on, the CPU architecture you're on, and knowledge of assembly, it could very well be both.
- int_19h 10y agoIt also relies on implementation-specific behavior in the compiler, since the latter is not actually required to follow established the convention for argument passing, so long as it can prove that the only place the function is called from is the same translation unit. In fact, so far as I can tell by looking at the first example, the compiler can circumvent this whole thing by noting that: 1. DoubleToTheInt is only ever called in the same unit, so it can be inlined - no need to generate the function. 2. Pointer to DoubleToTheInt is created, but is then immediately cast to an incompatible function type, which is undefined behavior - and so it can be substituted with any random value, say, whatever happens to be in EAX at that moment (any U.B. is substitutable for any other U.B.!), and the compiler can still avoid generating the actual function.
- chriswarbo 10y ago> “Black magic” gives it an undeserved good reputation From http://catb.org/jargon/html/B/black-magic.html http://catb.org/jargon/html/B/black-magic.html > black magic: n. > [common] A technique that works, though nobody really understands why. More obscure than voodoo programming, which may be done by cookbook. Compare also black art, deep magic, and magic number (sense 2).
- ChuckMcM 10y agoNicely done. The first time I came across the information of punning vs code was during the SPARC ABI standards work where the test code was working but the test case was supposed to fail. It happened to be a vendor compiler that optimized certain four parameter function calls in a similar way. I was rather perplexed how a compiler could "work" and "not work" at the same time.
- david-given 10y ago...I once wrote a program to summon demons. It didn't work, mind. But I was really proud of my doubly-linked-list pentacle, each node of which contained a pointer to the summoning point in the centre. I thought that was really elegant. Incidentally, if anyone is thinking of trying this for yourself: always remember to mlock() the memory containing your summoning. The last thing you want is some demon of the pit getting swapped out to disk. Not only is swap notoriously insecure, but sulphur buildup on the disk platter will cause a disk crash. And for heaven's sake, make sure your pentacle is properly aligned. If it's split across two pages, they may end up not being next to each other in physical ram, and then it won't work! Ideally, use an embedded device where you know what every cycle does. Don't be put off by the low power. You'd be surprised how much evil you can do with an Arduino.
- jschwartzi 10y agoI've found that my demon summoning programs work much better if I sacrifice the ram beforehand.