this post was submitted on 11 Jun 2025
1 points (100.0% liked)

Programming

21537 readers
396 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
 

cross-posted from: https://lemmy.world/post/31184706

C is one of the top languages in terms of speed, memory and energy

https://www.threads.com/@engineerscodex/post/C9_R-uhvGbv?hl=en

top 7 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 4 weeks ago

If you want top speed, Fortran is faster than C.

[–] [email protected] 0 points 1 month ago

To run perhaps. But what about the same metrics for debugging? How many hours do we spend debugging c/c++ issues?

[–] [email protected] 0 points 1 month ago

This doesn't account for all the comfort food the programmer will have to consume in order to keep themselves sane

[–] [email protected] 0 points 1 month ago (1 children)

Machine energy, definitely not programmer energy ;)

[–] [email protected] 0 points 1 month ago (1 children)

I would argue that because C is so hard to program in, even the claim to machine efficiency is arguable. Yes, if you have infinite time for implementation, then C is among the most efficient, but then the same applies to C++, Rust and Zig too, because with infinite time any artificial hurdle can be cleared by the programmer.

In practice however, programmers have limited time. That means they need to use the tools of the language to save themselves time. Languages with higher levels of abstraction make it easier, not harder, to reach high performance, assuming the abstractions don’t provide too much overhead. C++, Rust and Zig all apply in this domain.

An example is the situation where you need a hash map or B-Tree map to implement efficient lookups. The languages with higher abstraction give you reusable, high performance options. The C programmer will need to either roll his own, which may not be an option if time Is limited, or choose a lower-performance alternative.

[–] [email protected] 1 points 1 month ago

I understand your point but come on, basic stuff has been implemented in a thousand libraries. There you go, a macro implementation

[–] [email protected] 1 points 1 month ago

For those who don't want to open threads, it's a link to a paper on energy efficiency of programming languages.