5 ms·
I'd love a language that feels like a more convenient C. C as it is, with some niceties like built-in containers with some nice syntax sugar. Maybe someday Zig
by skocznymroczny 7y ago
I'd love a language that feels like a more convenient C. C as it is, with some niceties like built-in containers with some nice syntax sugar. Maybe someday Zig will get there.
- gnode 7y agoWhy would conservative use of C++ not meet this mark? It's highly compatible with C, has container types, ranged for-loops, operator overloading which makes use of container types more sugary.
- DagAgren 7y ago"Conservative use" introduces a massive cognitive load of trying to figure out what you are and what you aren't using. And the ergonomics of modern C++ look absolutely horrid compared to actual modern languages.
- humanrebar 7y agoHow is it a massive cognitive load? Use clang libraries and error out if there are any operator declarations, for instance.
- AndrewGaspar 7y ago"How is it a massive cognitive load? Just write a bunch of tooling to enforce your rules!"
- humanrebar 7y agoIt's simpler than the tutorial example for python-clang. It's strictly less work than a responsible unit test suite, and there's not much downside to getting some details wrong on this particular application.
- heinrich5991 7y ago>tutorial example for python-clang Do you have a link? Your comment is the highest Google result for that quote.
- gnode 7y agoYou can just use features of C++ which improve the ergonomics of C; it's not necessary to buy into modern C++ wholesale. If you want to write a C program but with generic container types, just use the features of C++ which facilitate that. > And the ergonomics of modern C++ look absolutely horrid compared to actual modern languages. True, but if you want to write "C as it is, with some niceties", then you're not talking about modern languages.
- BubRoss 7y agoI disagree heavily with that. Templates, classes, move semantics and destructors make for very tight and elegant programs I have found. No inheritance.
- ktkization 7y agoHave you looked at Crystal language? Its slogan is fast as C, slick as Ruby
- giancarlostoro 7y agoD is pretty darn nice and you can write code as if it were a C project, you don't have to use classes if you don't need them. I also view Go as very C-like honestly. People complain about things missing in Go that are technically not in C either, except it has a lot more batteries included stuff out of the box.
- coldtea 7y agoAnd preferably part of Clang and GCC collection...
- olah_1 7y agoYou may also want to look at Odin: https://odin-lang.org/ https://odin-lang.org/ I found it by hyping up Jai's "using" keyword. Then someone told me that Odin has the same thing: https://odin-lang.org/docs/overview/#using-statement https://odin-lang.org/docs/overview/#using-statement
- BubRoss 7y agoA language called clay was basically this. With better marketing and follow through it could have taken off. It had templates and move semantics and was interchangeable with C. The author was using it to write parts of a program that was already written in C.