Earlier quoted context omitted.
Ada. 83 or 95
Interesting choice, but Ada is probably even less popular than Zig. Even just requiring users to integrate my hypophetical Ada library source distribution into their project's build system files would most likely drown me in support tickets ;)
The Development of the C Language (1993)
261–270 of 536 posts
Re: The Development of the C Language (1993)
#262Earlier quoted context omitted.
Tell me an alternative which ticks all the checkboxes and I'll switch immediately. C++ isn't it because the committee has completely lost focus since ca C++11, Rust isn't it because they completely forgot about ergonomics, simplicity and elegance on their quest to fix memory safety (and both C++ and Rust suffer from "design by committee"). Zig looks perfect so far, but it's too early to switch over yet. Any other pro…
Ada. 83 or 95
Re: The Development of the C Language (1993)
#263Earlier quoted context omitted.
> I used to think "C presents the most honest representation of the low-level mechanisms of the computer", but... even this is shaky. I've been programming for almost 15 years now, and I don't think I've ever seen a computer where memory is actually a continuous array of bits sorted by memory address. The C representation of memory (and all the pointer arithmetic) is not a real representation of your hardware, and th…
>>I don't think I've ever seen a computer where memory is actually a continuous array of bits sorted by memory address. I may be being pedantic or outright wrong (since it's been a while since I used C), but I don't think C can address memory by individual bit. You have to read one or more bytes from memory, twiddle the bits in them, using C's bitwise operators (like !, &, | and tilde), and then write the changed byt…
Re: The Development of the C Language (1993)
#264People who still write C, honest question: Why? C is full of quirks. From cryptic "undefined behaviors" to a type system that isn't really a type system (more like "size hints for the compiler"), the language doesn't feel easy to use/debug. Add to this CPP macros, a universally recognized bad idea, a clunky import system, and lack of a single reference implementation of the compiler/libC, and you have a language that…
Microcontrollers exist. Their libraries are written in/for C. The programs running on them are small and need tight, efficient memory management. I also like the minimalist nature of the language itself. I get that for desktop applications, you usually want more integration with the operating system so you can say "I want a window here and a button here" rather than having to manually build the window from scratch, b…
Hint, might check their libraries/SDKs before answering.
Re: The Development of the C Language (1993)
#265Earlier quoted context omitted.
Tagged memory architectures don't match the C model of linear memory. They're essentially obsolete now but C is still designed to accommodate them. A lot of the UB the people grouse about can generally be ignored because 99% of the platforms out there have the same behavior in areas where the standard is extra permissive for obsolete exotic hardware. Tagged memmory is dead, 1's complement is dead, big-endian is mostl…
Does the C machine model in fact consist of a single linearly addressable memory space? I think the spec mostly talks about "objects" that are linearly addressable -- not about the whole "memory" (there might not even be such a thing). Technically you aren't even allowed to compare two pointers other than for equality (relational comparisons are possible only within the same array). Just making up pointers is probabl…
Re: The Development of the C Language (1993)
#266Earlier quoted context omitted.
Through in-built assembly, or some compiler-specific annotation. None of them is vanilla C , which was my point.
Part of what makes C touted as a 'low level language' is the relative ease of inlining assembly.
Re: The Development of the C Language (1993)
#267Earlier quoted context omitted.
I have grown somewhat tired of these ChatGPT responses. It's a tool...not a panacea. C is a fantastic, albeit somewhat complicated, language. The problem is a C programmer knows the quirks and ChatGPT will dump you some code that could have undefined behavior depending on the compiler. Will ChatGPT always use restrict correctly (for example)?
Why not? You seem to underestimate the ability of AI tools to understand code. Undefined behavior is something that a good AI tool may avoid without major problems.
Re: The Development of the C Language (1993)
#268Earlier quoted context omitted.
my point was that k&r used c++ for it superior type checking (and because the C++ compiler could actually compile C89 code, which no commercial compuilers at the time could) - obviously in a book about C they did not use C++ features. so i am not sure what you are going on about here. i learned assembler and fortran, then abandoned them for C, and then abondoned C for C++. i did all that progression because it self-e…
Couldn't care less about the type checking differences (apart from using abstract classes with virtual methods, but that's not C syntax), they're quite small and the C++ way is in fact an annoyance e.g. when interfacing with straightforward void pointer APIs. That reminds me of enum class, another feature that brings something nice to the table (properly scoped enum names for better IDE completion) but is almost made…
changes to what? they don't clash with the original horrible enums at all - all your code that used original C-style enums will still work.
Re: The Development of the C Language (1993)
#269Earlier quoted context omitted.
Couldn't care less about the type checking differences (apart from using abstract classes with virtual methods, but that's not C syntax), they're quite small and the C++ way is in fact an annoyance e.g. when interfacing with straightforward void pointer APIs. That reminds me of enum class, another feature that brings something nice to the table (properly scoped enum names for better IDE completion) but is almost made…
> like enum class introducing at least 3 changes at once changes to what? they don't clash with the original horrible enums at all - all your code that used original C-style enums will still work.
Re: The Development of the C Language (1993)
#270Earlier quoted context omitted.
> like enum class introducing at least 3 changes at once changes to what? they don't clash with the original horrible enums at all - all your code that used original C-style enums will still work.
I should say differences -- in behaviour when compared to traditional enums.