:: Re: [DNG] C vs C++
Page principale
Supprimer ce message
Répondre à ce message
Auteur: kc-devuan
Date:  
À: dng
Sujet: Re: [DNG] C vs C++
6 Oct 2024 02:44:37 Erik Christiansen via Dng <dng@???>:

Glad you aren't trolling then. Have you tried Ada?

> It seems clear that your experience is in the "cotton wool" environment
>
> of coding on top of a protective OS, with support for all sorts of HLLs.
>
> Coding on "Bare Iron" is a different world. It is much more DIY, with


You shouldn't make assumptions. I have spent around 17 years on bare metal mostly with C and I can tell you that writing non portable functions in C to reduce the chances of overflows for array access and conversions is far less fun than using Ada where everything is done nicely and portably. The light Ada runtime is very small. Just because jumps etc. are used in hardware is no argument for controlling those jumps manually. You don't write the bits without a compiler or write everything in assembler or use gotos often unless you are reckless. The compiler creates separation of concerns. Ada does so for bit shifts too. Though you can shift also. Ada was designed for embedded and has better bare metal and portability support than C. Cs aim was just to get something easier than assembler working quickly and that is why it has a history of security issues and devices that need turnng off and on again. Yes I can write simple very reliable code in C but it is a pain and Ada allows me to move things that I would normally do server/OS side to the bare metal with confidence.