this post was submitted on 11 Jun 2025
85 points (85.1% liked)

Programming

20998 readers
82 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

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 1 week ago (2 children)

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.

What are you talking about? https://docs.gtk.org/glib/data-structures.html

[–] [email protected] 6 points 1 week ago (1 children)

Well, let’s be real: many C programs don’t want to rely on Glib, and licensing (as the other reply mentioned) is only one reason. Glib is not exactly known for high performance, and is significantly slower than the alternatives supported by the other languages I mentioned.

[–] [email protected] 2 points 1 week ago (1 children)

OK, think of all the other C collection libraries there must be out there!

[–] [email protected] 6 points 1 week ago

Which one should I pick then, that is both as fast as the std solutions in the other languages and as reusable for arbitrary use cases?

Because it sounds like your initial pick made you loose the machine efficiency argument and you can’t have it both ways.

[–] [email protected] 2 points 1 week ago (2 children)

Glib us licensed under LGPL. So unless your project is happy with that, it's as if it didn't exist. That's one of the problems of having a small standard library.

[–] [email protected] 5 points 1 week ago

It's one of the more permissive licenses - who the hell is going to have a problem with lgpl? You can ship it with proprietary applications.

[–] [email protected] 3 points 1 week ago

It’s a single counterexample. there are many, many such libraries for C and the programmer does not have to roll their own.