4 ms·
Just one counterexample: Texas instrument C28x core is 16-bit addressable. Each byte is 16 bits. >The TMS320C28x byte is 16 Bits. By ANSI/ISO C definition, th
by nabla9 11y ago
Just one counterexample: Texas instrument C28x core is 16-bit addressable. Each byte is 16 bits.
>The TMS320C28x byte is 16 Bits. By ANSI/ISO C definition, the sizeof operator yields the number of bytes required to store an object. ANSI/ISO further stipulates that when sizeof is applied to char, the result is 1. Since the TMS320C28x char is 16 bits (to make it separately addressable), a byte is also 16 bits.
http://processors.wiki.ti.com/index.php/Byte_Accesses_with_the_C28x_CPU http://processors.wiki.ti.com/index.php/Byte_Accesses_with_t...
C is the closest thing to universally portable assembler.
- pjmlp 11y agoI fail to see how C is more portable than any other memory safe systems programming language, other than having the fortune that for 30 years OS and hardware vendors decided to only support C compilers.
- nabla9 11y agoCompilers. Compilers for everything. You can hype your favorite systems language all you want, but if there is no compiler, it wont compile. >OS and hardware vendors decided to only support C compilers. If you want your favorite language X to work everywhere C does. Just make X-to-C compiler.
- dietrichepp 11y agoX-to-C compiler isn't as nice as it could be, because you're writing code for some weird chip and need to twiddle some bits for IO using a macro defined in a header somewhere, and that doesn't play nicely with your pet X-to-C compiler. Not an ideal situation, for sure, but a real one.
- nabla9 11y agoIt's possible for translator understand headers and macros and generate bindings for them. Even for function macros. For example, GNAT has macro binding although it's not complete. Btw. There is nothing "pet" in X to C translators. You pay good money for a good Ada to C compiler.
- Roboprog 11y agoOr an RPG II to C translator/compiler :-) A job I had in the early 90s, maintaining and extending such...
- pjmlp 11y agoOf course, but that is an issue of implementation availability not language quality. I remember the days when using C meant getting an account to the university (or work) UNIX system.
- dietrichepp 11y agoBut that's the most important thing, isn't it? Being able to compile and run your code? I mean, the English language sure isn't popular for its intrinsic merits either, but here we are.
- pjmlp 11y agoSure, but in a way C is the JavaScript of systems programming languages, in a deep need of a "The Good Parts" book as well.
- benbenolson 11y agoI'm sorry, but is this comment a joke? Have you ever read "The C Programming Language", and seen how simple C is? These arguments that the two OPs are having are important, but only when faced with obscure architectures that nearly nothing but C will run on. Conversely, JavaScript's failures are not because of the wide variety of architectures that it supports (a tiny fraction of C's), but instead on the monolithic and bad design of the language. If you read "The C Programming Language", you'll realize that in the ~240 pages of text, you know basically every feature of the language. It's small, and it's elegant, and it's portable. JavaScript is none of those.
- pjmlp 11y agoIt is not a joke, rather the conclusion of someone that was already dismayed with C back in the mid-90's. > If you read "The C Programming Language", you'll realize that in the ~240 pages of text, you know basically every feature of the language. Except for those little compiler specific little issues, it seems: http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html http://blog.llvm.org/2011/05/what-every-c-programmer-should-... http://blog.llvm.org/2011/05/what-every-c-programmer-should-know_14.html http://blog.llvm.org/2011/05/what-every-c-programmer-should-... http://blog.llvm.org/2011/05/what-every-c-programmer-should-know_21.html http://blog.llvm.org/2011/05/what-every-c-programmer-should-... http://blog.regehr.org/archives/213 http://blog.regehr.org/archives/213 http://blog.regehr.org/archives/226 http://blog.regehr.org/archives/226 http://blog.regehr.org/archives/232 http://blog.regehr.org/archives/232 > It's small, and it's elegant, and it's portable Have you had the pleasure to port C code across multiple C compilers and OS in the mid-90's?
- hamiltonkibbe 11y agoEvery TI DSP I've worked with uses 16-bit bytes
- f00fc0d3 11y agoc6x has 8-bit bytes.