this post was submitted on 04 Mar 2025
47 points (100.0% liked)

Programming

18675 readers
108 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
 

I have some familiarity with C++, and concepts like compiling and linking static and dynamic libraries, which is what I understand as collections of code that simplify doing certain things.

But then I get confused in certain cases, for example, why is OpenGL considered an API? Why is it necessary to use other libraries like GLAD, freeGLUT or GLFW to interface with OpenGL?

And then other languages have this thing called package managers, like pip, node, cargo, and vcpkg for c/c++, where you install these packages that get used like libraries? What's the difference?

Finally the ones I understand the least of are frameworks. I keep hearing the concept of frameworks like Angular for js and a lot of stuff that's too alien for me because I'm still unfamiliar with web development.

So for example, I'm using the raylib library for a small game project I have. I link the .lib or .dll file to my executable file so I know I'm unambiguously using a library. How come there's also Cocos2dx which is a framework? What's the distinction?

you are viewing a single comment's thread
view the rest of the comments
[–] MajorHavoc 3 points 4 days ago

Why is OpenGL considered an API?

An API is a promise - make these calls, get these kinds of results. An API often has more than one library that implements it. At minimum, there may be completely different code for different operating systems. At best, there may be completely separate vendors that implement identical APIs (Kubertnetes, and the Open Container Initiative, for examples).

Why is it necessary to use other libraries like GLAD, freeGLUT or GLFW to interface with OpenGL?

I don't know.

where you install these packages that get used like libraries? What's the difference?

Almost all packages are composed of libraries. Plenty of libraries lack packages. Packaging and delivering software is an entire field of study. As an expert at packaging and delivering software, I sometimes forget that a library I love still lacks a decent package. So I do my best to contribute a package, when I see a need.