this post was submitted on 11 Jun 2025
86 points (86.4% liked)

Programming

20902 readers
130 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 !webdev@programming.dev



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

you are viewing a single comment's thread
view the rest of the comments
[–] mbtrhcs@feddit.org 1 points 4 days ago (1 children)

Only if you choose a lower language level as the target. Given these results I suspect the researchers had it output JS for something like ES5, meaning a bunch of polyfills for old browsers that they didn't include in the JS-native implementation..

[–] TCB13@lemmy.world 1 points 4 days ago (1 children)
[–] mbtrhcs@feddit.org 1 points 2 days ago (1 children)

Yeah sure, you found the one notorious TypeScript feature that actually emits code, but a) this feature is recommended against and not used much to my knowledge and, more importantly, b) you cannot tell me that you genuinely believe the use of TypeScript enums – which generate extra function calls for a very limited number of operations – will 5x the energy consumption of the entire program.

[–] TCB13@lemmy.world 1 points 2 days ago

This isn't true, there are other features that "emit code", that includes: namespaces, decorators and some cases even async / await (when targeting ES5 or ES6).