What is “runtime”?

前端 未结 14 1731
礼貌的吻别
礼貌的吻别 2020-11-29 14:08

I have heard about things like \"C Runtime\", \"Visual C++ 2008 Runtime\", \".NET Common Language Runtime\", etc.

  • What is \"runtime\" exactly?
相关标签:
14条回答
  • 2020-11-29 14:46

    Runtime is somewhat opposite to design-time and compile-time/link-time. Historically it comes from slow mainframe environment where machine-time was expensive.

    0 讨论(0)
  • 2020-11-29 14:49

    Matt Ball answered it correctly. I would say about it with examples.

    Consider running a program compiled in Turbo-Borland C/C++ (version 3.1 from the year 1991) compiler and let it run under a 32-bit version of windows like Win 98/2000 etc.

    It's a 16-bit compiler. And you will see all your programs have 16-bit pointers. Why is it so when your OS is 32bit? Because your compiler has set up the execution environment of 16 bit and the 32-bit version of OS supported it.

    What is commonly called as JRE (Java Runtime Environment) provides a Java program with all the resources it may need to execute.

    Actually, runtime environment is brain product of idea of Virtual Machines. A virtual machine implements the raw interface between hardware and what a program may need to execute. The runtime environment adopts these interfaces and presents them for the use of the programmer. A compiler developer would need these facilities to provide an execution environment for its programs.

    0 讨论(0)
  • 2020-11-29 14:53

    In my understanding runtime is exactly what it means - the time when the program is run. You can say something happens at runtime / run time or at compile time.

    I think runtime and runtime library should be (if they aren't) two separate things. "C runtime" doesn't seem right to me. I call it "C runtime library".

    Answers to your other questions: I think the term runtime can be extended to include also the environment and the context of the program when it is run, so:

    • it consists of everything that can be called "environment" during the time when the program is run, for example other processes, state of the operating system and used libraries, state of other processes, etc
    • it doesn't interact with your code in a general sense, it just defines in what circumstances your code works, what is available to it during execution.

    This answer is to some extend just my opinion, not a fact or definition.

    0 讨论(0)
  • 2020-11-29 14:55

    As per Wikipedia: runtime library/run-time system.

    In computer programming, a runtime library is a special program library used by a compiler, to implement functions built into a programming language, during the runtime (execution) of a computer program. This often includes functions for input and output, or for memory management.


    A run-time system (also called runtime system or just runtime) is software designed to support the execution of computer programs written in some computer language. The run-time system contains implementations of basic low-level commands and may also implement higher-level commands and may support type checking, debugging, and even code generation and optimization. Some services of the run-time system are accessible to the programmer through an application programming interface, but other services (such as task scheduling and resource management) may be inaccessible.


    Re: your edit, "runtime" and "runtime library" are two different names for the same thing.

    0 讨论(0)
  • 2020-11-29 14:55

    The runtime or execution environment is the part of a language implementation which executes code and is present at run-time; the compile-time part of the implementation is called the translation environment in the C standard.

    Examples:

    • the Java runtime consists of the virtual machine and the standard library

    • a common C runtime consists of the loader (which is part of the operating system) and the runtime library, which implements the parts of the C language which are not built into the executable by the compiler; in hosted environments, this includes most parts of the standard library

    0 讨论(0)
  • 2020-11-29 14:56

    Run time is the instance where you don't know about of what type of objects creates during its execution, objects creation are based on certain condition or some computation work. In contradict, compile time is the instance where required objects are defined by you before its executions.

    0 讨论(0)
提交回复
热议问题