3 ms·
Pointers hell and static typing.... No chance to replace Clang. Only a C-like lang without pointers and type inference would lure programmers to replace C. Some
by huqedato 4y ago
Pointers hell and static typing.... No chance to replace Clang. Only a C-like lang without pointers and type inference would lure programmers to replace C. Something less hostile to the developer.
- extropy 4y agoJust a nitpick Clang is a specific C/C++ compiler implementation using LLVM, not the C language. Names are hard :) https://en.wikipedia.org/wiki/Clang https://en.wikipedia.org/wiki/Clang
- flohofwoe 4y agoHow would a language that wants to compete with C even work without a feature to directly address memory locations (i.e. "pointers")? I don't understand the "static typing vs type inference" argument, so I'll not comment on that :) (there are plenty of statically typed languages with type inference)
- zozbot234 4y ago> How would a language that wants to compete with C even work without a feature to directly address memory locations (i.e. "pointers")? "Pointer" types could just be library-based and architecture-specific. It doesn't really need to be part of the base language. This would make it easier to support things like GPU-bound code where general memory addressing isn't really a thing, or other features like multiple address spaces, segmented memory or the CHERI memory tagging extension.
- jitl 4y agoI don’t know… after working around the performance limitations of JavaScript and Ruby for a decade, I am happy to have an option that allows me to control (at least to some degree) memory layout of my program. All(ish) code used to be written in C and shell. To what degree had eg JavaScript replaced C already? I think quite a bit.
- euclaise 4y agoC can't be replaced by a language without pointers. If a language without pointers was attractive, a language other than C would already be used. C code is generally used with the intent to make use of pointers and such - we've had less pointy (and more abstract) alternatives forever for use cases that are suited to it.