lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, 2019-05-13 at 09:49 +0200, Lorenzo Donati wrote:

[snip]
I'm not a big fan of C (and C++ either: C++ it has almost the same 
definition of UB as C), but I had to reconsider my views in the last 5 
years, since I had to cope with microcontroller (MCU) software development.

I agree that, in an ideal world, no sane high level application should 
be developed in C (or C++) because they are intrinsically unsafe, thanks 
to UB. C++ mitigates that a little by providing high level constructs 
that a programmer can use to avoid the most common cases where a mistake 
can cause UB (e.g. dynamic memory management).
C in the right hands (e.g., folks who understand language standards and how to avoid or allow for undefined behavior) is incredibly useful for high level applications, especially where performance is an issue.  It's a matter of understanding the tools you're using.  And in fact, many of the "higher" level languages have implementations written in C.  Does that mean it would be "insane" to code a "high level application" in any language whose underlying implementation was written in C?  I'd think not.

Will