This post on StackOverflow should help clear up the topic for you (you should read the whole page, not just the first answer): https://stackoverflow.com/questions/148747/what-is-the-difference-between-a-framework-and-a-library
I’ll answer this question on two levels:
(1) The designer/implementer of a framework or library did it that way for their own reason which is known only to them.
Run-time environments are a little trickier to explain and this will gloss over a lot of details, but:
- You write the source code of a program using a programming language
- In compiled languages (C and C++), the source code is converted to an executable file that runs directly on the host computer
- The interpreter can be thought of as a “run-time environment” because it’s the environment that runs the code that you wrote