GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    pistolero :thispersondoesnotexist: (p@freespeechextremist.com)'s status on Thursday, 05-Oct-2023 06:22:16 JSTpistolero :thispersondoesnotexist:pistolero :thispersondoesnotexist:
    in reply to
    • Dire Sock :verified:
    • SuperDicq
    • Iron Bug
    @SuperDicq @iron_bug @diresock

    > However, we tend to want the most optimized solution.

    "I can give you the answer as fast as you want, as long as it doesn't have to be correct."

    I mean, everyone wants their code to run fast, but they want it to be their code. You don't want something the compiler hallucinated that may or may not resemble what you wrote. Since the 70s, one of the points stressed about C was that you could tell what it was going to do: no fuzziness, you can basically see the instructions the compiler will emit. So gcc emits some SIMD stuff when it spots your for loop adding two arrays together, that's fine, it's emitting code that behaves the same as what you wrote, but changing printf() to puts() or optimizing away an infinite loop is way beyond the pale.

    You end up coming across a lot of "No, goddammit, do what I wrote" directives in code. `___this_is_actually_used___`, people introducing side effects to fool the compiler into emitting code that executes their loops, a sea of #defines and #ifdefs and underscore-rich symbols. "No, actually inline this, I really mean it this time, this function is only called once and there's no reason not to inline it." 4kB of `-fstop-doing-retarded-shit` passed to the compiler. (I made up the option name but try compiling qt4 some time if you want to see a compiler invocation that is longer than the text of the file it's compiling.)

    > they are technically correct that skipping the if statement is valid because according to C integer overflow is considered "undefined behavior",

    This is not remotely the case. "The spec says that it won't say what to do about this" does not mean "It's safe to ignore" and it's no excuse to write a bad compiler.

    > It's probably better if the compiler shows a warning and executes it anyway or something like that.

    A warning would be fine. "If someone digs a signed magnitude machine out of a museum or maybe someone writes a C compiler for old-timey analog computers, this code probably won't work the way you expect." I mean, "x+100" even handles one's complement.
    In conversationThursday, 05-Oct-2023 06:22:16 JST from freespeechextremist.compermalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.