News for hackers. Stuff that matters.
Re:Modern C [pdf] by stinos on Monday November 28, 2016 @08:53AM (#13055368)
In the end giving in the same (or even more efficient) CPU instructions.

We both know that is not always true and heavily depends on the type of software though.. Take https://github.com/micropython/micropython for instance: what higher level language but C would allow that to run with the same performance as it has now, on as much different devices? C++ would be a viable answer, but when used e.g. as C + templates it's basically still a form of C and anyway your complaints have been raised in nearly the exact same wordings about C++ laguage as well..

Re:Modern C [pdf] by pjmlp on Monday November 28, 2016 @08:55AM (#13055380)
Turbo Pascal, Think Pascal, Quick Pascal, FreePascal, Modula-2, Ada, Delphi, MikroElektronika Pascal

The availability of compilers for a specific architecture is orthogonal to the language.

Re:Modern C [pdf] by stinos on Monday November 28, 2016 @09:43AM (#13055652)
hmm got me there I guess. Never looked closely into those, can you summarize in what way thay are better than C? Less shoot-yourself-in-the-foot maybe?
Re:Modern C [pdf] by pjmlp on Monday November 28, 2016 @10:01AM (#13055786)
Yes.

Pascal dialects already in the late 80's, early 90's, allowed for:

- type safe sub ranges

- proper strings

- type safe enumerations, enumerations as vector indexes

- type safe allocation (new vs malloc)

- type safe out parameters via references instead of pointers

- bounds checking and checked arithmetic (you can explicit disable them if required for performance)

- real modules via units

- pointer arithmetic is more explicit

As for MicroPython, MikroPascal from MikroElektronika supports all those tiny chips.

http://www.mikroe.com/mikropascal/