Remix.run Logo
▲ creata 3 hours ago

I don't want syntax conveniences, I want fewer footguns. C has so many ways to trip you up that aren't inherent to its domain. Are any of these new languages better in that regard?

▲npn an hour ago | parent | next [-]

please. think about it a little more.

it is true you dont want to trip you up by the language you use, but look what people actually use the languages, not by theory.

almost nobody writes the high performant code directly, usually they just call some libraries that do the job instead. if you are the library writers, then sure, that's a different matter (but people have been doing it forever using c/c++), but for people who use the libraries to write the code, they don't care about any of that.

many people rather pick python, lua, ruby to write applications, even games, despite the low performance of the scripting language, but they don't care. and if it is only the scripting aspect of the whole framework (implemented in C++) then the speed lost is even less.

heck, even for rust, the core libraries always need unsafe blocks, despite they do not recommend user code to use them. it is the same story everywhere. the hard part will be write by more experienced people (and with more effort), the typical users just write domain logic instead.

so, for most people, they indeed need simpler languages with lot of syntactic sugars for better developing experiences.

▲program_whiz 2 hours ago | parent | prev [-]

Somewhat, in terms of macro munging vs actual templates and other conveniences yes, however its still very possible to have unsafe memory operations and to accidentally create unexpected behavior. They have their own footguns in some ways, for example Jai's use of arenas can be tricky in more complex programs (e.g. you stored a value with a reference or array, the arena expired). Great for games, bad for most normal code.

Hence why I say, if you are doing complex / multi-threaded code, good luck to you.

This is why the GC and memory safe languages have mostly taken over. They have even more ergonomic syntax, and none of the footguns. You can still do all the normal pointer casting / abuse type stuff in most of these languages too.