Earlier quoted context omitted.
The idea is mostly that we shouldn't worry. The user of the lib on an arduino will feed it arduino sized problems and the amd64 user will likewise larger problems. Again I think just think of the transition from 32 to 64 bit. Most ranges are "input"/"user " dependent and it would have been needlessly messy to have to even with automatic conversion help rewrite say every i32 to i64 or which ones to convert.
That's size_t. What about counting milliseconds?
C isn't a programming language anymore (2022)
131–140 of 217 posts
Re: C isn't a programming language anymore (2022)
#132Earlier quoted context omitted.
First of all C did not had any generics, so same playing field. C has a runtime, even if tiny. That is what calls into main(), handles floating point arithmetic when none is available, functions that run before and after main(), nowadays also does threading. Heap memory handling in Pascal, Modula-2, Ada, is much safer than C, first of all no need to do math to calculate the right size, arenas are available on the sta…
C uses pointer casts all over the place to fake generics. If you don't have that (in Pascal or MODULA-2) then life becomes very unpleasant. There is a quite a bit of C code that makes creative use of the size of allocations. For example linked lists with a variable sized payload. Again one of the things that would prevent a C programmer from switching to Pascal. I don't expect the Zig user base to become larger than…
Creative use of the size of allocations are also possible in those languages, the BIG difference is that they aren't the default way everything gets done.
Re: C isn't a programming language anymore (2022)
#133Earlier quoted context omitted.
Lets play a game of what ISO C can do, and no other systems programming language has similar feature available? If language extensions to ISO C are allowed, then same goes for my selection on competing systems languages.
Yes, most languages allow C type code, if that’s what you are trying to do. Java with only primitive values, arrays, and classes only with fields and static methods. But that wouldn’t be idiomatic Java, so typically non-explicit abstractions such as polymorphism have code generated for them that you don’t have explicit control over. C is consistently low level because that’s all you get. Down to direct access to addr…
Being idiomatic or not doesn't matter, what counts are what language features are available.
Re: C isn't a programming language anymore (2022)
#134Earlier quoted context omitted.
Yes, nowadays with Panama, and before Rust was around, JNA was already there so using JNI wasn't strictly necessary.
JNA is a whole dependency of its own, shame it's not built into the JRE
Unless one is stuck with Android Java, Google's J++.
Re: C isn't a programming language anymore (2022)
#135Earlier quoted context omitted.
Don't forget about branch prediction (GCC may have __builtin_expect, but that's not standard C).
The compiler usually can't do anything about branch prediction. Expect is more about keeping cold paths out of the cache.
Re: C isn't a programming language anymore (2022)
#136Earlier quoted context omitted.
I wonder why there aren't many successful European hardware products.
I would assert any company that doesn't go bankrupt is successful, doesn't need to be late stage capitalism. Other than that, Nokia until Microsoft placed an agent on it, Phillips that contributed to CDs, ASML...
Re: C isn't a programming language anymore (2022)
#137Earlier quoted context omitted.
That's size_t. What about counting milliseconds?
Like fucking what? If you do any TS.. you just use unsigned whatever fastest type you have on targeting platform, and you do NOT care. 16bit? wrapping at 1 min? Thats eternity even on 2MHz 6502... You just count and substract to get difference. Usually you are If you target about 32bit and 16bit, you either think about and using long (on 16 bit is more costly) or you just count seconds.. Or ticks.. or whatever you ne…
Re: C isn't a programming language anymore (2022)
#138Earlier quoted context omitted.
> why C gets to be the foundation for how systems software is written. Is there an answer here more interesting than "it's what Unix and Windows were written in, so that's how programs talked to the OS, and once you have an interface, it's impossible to change"?
It wasn't a coincidence, or an accident. C was specifically designed to write Unix, by people who had experience with a lot of other computer languages, and had programmed other operating systems including Multics and some earlier versions of Unix. They knew exactly what they were doing, and exactly what they wanted.
Re: C isn't a programming language anymore (2022)
#139What languages does this author like which has a written spec?
This article isn't about languages. It's about the protocol for two or more languages to talk to each other. There is no specification for this. The System V ABI is as close as we get to an actual specification but not everyone uses it and in any case it only covers a small part of the protocol.
> I’m trying to materially improve the conditions of using literally any language other than C.
Re: C isn't a programming language anymore (2022)
#140Earlier quoted context omitted.
I would assert any company that doesn't go bankrupt is successful, doesn't need to be late stage capitalism. Other than that, Nokia until Microsoft placed an agent on it, Phillips that contributed to CDs, ASML...
Three is not many