This compiled code is often called "bytecode". Java, Python) compile your code into a language that the operating system can't read directly, but a specific runtime program can read your compiled code. But sometimes your code has a command that is a very bad idea, but the OS doesn't consider it illegal, like "erase a random bit of memory this program is using" that can cause super weird problems that are hard to get to the bottom of. dump file that's pretty hard to make sense of. If an illegal request is hit, usually the OS will just kill your program and not tell you why, and dump the contents of that program's memory at the time it was killed to a. The compile step means that many statements that would cause your program to crash are detected before the code is ever run.Ĭ is one such language when you run a C program, it's totally able to send illegal requests to the operating system (like, "give me control of all of the memory on the computer, and erase it all"). In this case, there is still a minimal "runtime" involved - but that runtime is provided by the operating system itself. This compiled code is often called "binary" (even though every other kind of file is also in binary :). Some languages compile your code into machine language - it can be run by your operating system directly. In some languages, your source code must be compiled before it can be run. Types of compilation and runtime Compiled binary languages The operating system itself acts as part of this "runtime", but we usually don't mean to include it when we talk about a "runtime" like the RUN program. The RUN program provides the "runtime" environment that acts as a layer between the operating system and my source code. Instead, RUN is actually a program itself - its code tells it how to parse my code, how to execute it, and how to send any relevant requests to the computer's operating system. How is it actually running? How does it know how to send the string parameter from PRINT to the physical screen? I certainly didn't provide any system information in my code, and PRINT itself doesn't know anything about my system. It's not running, and we would say there is no "runtime" involved with it. So far, your program is just source code. Let's say it's 1985 and you write a short BASIC program on an Apple II: ] 10 PRINT "HELLO WORLD!" I'm not crazy about the other answers here they're too vague and abstract for me. And it is God that give us the level 0 of abstraction. For any level N of abstraction, its runtime is the immediate level N-1 of abstraction that goes below it. It goes from elementary transistors all the way up to the running program. The whole computer thing is just multiple levels of abstraction. Here's some of my perspective after getting some knowledge about processor design. Chapter 6 Runtime Data Structures is an useful reference to this question. The book Expert C Programming: Deep C Secrets. The Elements of Computing Systems (Introduction, Translators: a compiler, a virtual machine implementation, and anĪssembler. Several layers of abstraction, and these usually involve three This compilation process is sufficiently complex to be broken into Here's the quotation that leads to such thought: These days, I am thinking maybe Runtime has something in common with the so called Virtual Machine, such as JVM. So, is the runtime nothing but a bunch of pre-fabricated functions that wrap the low level function into more abstract and high level functions? But doesn't this seem more like the definition for the library, not for the runtime?Īre "runtime" and " runtime library" two different things? ADD 1 When coding assembly language on Linux, I could use the INT instruction to make the system call. How does it interact with my code? Or maybe more precisely, how is my code controlled by it?.I have heard about things like "C Runtime", "Visual C++ 2008 Runtime", ".NET Common Language Runtime", etc.
0 Comments
Leave a Reply. |