‹ BackHN Continuity

Thread

C's Flexible Integer Sizes Were Not a Design Mistake

113 points · 166 comments · ibobev

  1. quelsolaar · · focus · HN ↗
    Good article.

    C would probably not have survived unless it had this flexibility.

    But its not justa historical thing. Today there are modern platforms like DSPs that have 32bit sized char, because that is the smallest addressable type. These platforms depend on C for tool chains, even if most "portable" C wont run correctly on them. The fact that you can build hardware like that, and not have to invent a new language / dialect to program them is a huge win for the world.

    <edit> I didnt see the footnote about DSPs at first read </edit>

    1. rurban · · focus · HN ↗
      You probably never did embedded and small devices. They still rule the world. Most CPU's I work on are 8-bit or 16-bit still. avr-gcc is one of the most important compilers still, behind arm-gcc. Having 32 or 64 bits available is nice, but not granted. We spend <2€ on a typical CPU.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.