Live data from Hacker News

To become a good C programmer (2011)

fabiensanglard.net

131–135 of 135 posts

Re: To become a good C programmer (2011)

#131
post #58

Earlier quoted context omitted.

Rust isn't viable for embedded platforms, at least not yet. It's not as easy to compile it to the most obscure ISAs as C, and the little support it has for stuff like STM32 is restricted to just that group of microcontrollers and doesn't support the entire ARM range. Maybe in the future? I'm looking forward to that day! Go is probably never going to run on microcontrollers due to its very big overhead. C perfectly ma…

> Every single design decision about C was made with the computer in mind. The only problem is that computers have changed a bit in the last 50 years, and C largely hasn't. There are a couple issues: First, C was designed for single-pass compilers, because the PDP-7 it was designed for was too small to actually run much fancier of a compiler. So C is seriously sub-optimal for optimization in a lot of ways (because th…

> The only problem is that computers have changed a bit in the last 50 years, and C largely hasn't. There are a couple issues:

The problem with this line of argument: assembly has also not changed. If the things you talk about mattered, we would be using a different assembly.

Re: To become a good C programmer (2011)

#132

Earlier quoted context omitted.

>see how powerful and versatile GPUs have become because they didn't carry that legacy. GPUs are the best example for why C is a good lower-level high-level language, seeing how CUDA is programmed in C/C++. Do you have any examples of architectures that could exist if only they weren't constrained by legacy C?

> GPUs are the best example for why C is a good lower-level high-level language, seeing how CUDA is programmed in C/C++. CUDA is not C or C++. That you can program GPUs in a C/C++-like language does not entail that C/C++ is a natural form of expression for that architecture. > Do you have any examples of architectures that could exist if only they weren't constrained by legacy C? Turing tarpit means that every archit…

> CUDA is not C or C++.

Cuda is a C++ API. On modern hardware, it's programmed in purely standard C++.

Re: To become a good C programmer (2011)

#133
post #129

Earlier quoted context omitted.

just curious. this is not relevant nowadays right?

It's relevant for any computer with a BIOS, it's relevant for the coreboot project (although these days in diminishing value).

Agreed. I need to get some time-off/tech resort to study the fundamentals.

Re: To become a good C programmer (2011)

#134
post #131
post #58

Earlier quoted context omitted.

> Every single design decision about C was made with the computer in mind. The only problem is that computers have changed a bit in the last 50 years, and C largely hasn't. There are a couple issues: First, C was designed for single-pass compilers, because the PDP-7 it was designed for was too small to actually run much fancier of a compiler. So C is seriously sub-optimal for optimization in a lot of ways (because th…

> The only problem is that computers have changed a bit in the last 50 years, and C largely hasn't. There are a couple issues: The problem with this line of argument: assembly has also not changed. If the things you talk about mattered, we would be using a different assembly.

> we would be using a different assembly.

We are. It's called microcode.

Re: To become a good C programmer (2011)

#135
post #131

Earlier quoted context omitted.

> The only problem is that computers have changed a bit in the last 50 years, and C largely hasn't. There are a couple issues: The problem with this line of argument: assembly has also not changed. If the things you talk about mattered, we would be using a different assembly.

> we would be using a different assembly. We are. It's called microcode.

And, you write microcode?
Post reply on HN