Lably
Skip to content

Execution (computing)

Performing the actions encoded in a computer program

  • 5 min read
  • 2 chapters

Learn it on Lably

An execution processor comes in many forms. A machine code program may be executed via the programmable interface of a computer where execution involves repeatedly following a fetch–decode–execute cycle for each program instruction executed by the control unit. Source code may be executed by interpreter software. A program may be executed in a batch process without human interaction or a user may type commands in an interactive session.

Relation to development

Aspects of execution affect and drive software development.

Platform independence

Often, software relies on external services such as a runtime environment and a runtime library tailored to the host environment to provide services that can decouple an executable from direct manipulation of the computer and its peripherals, and thus provide a more platform-independent solution.

Runtime error

A runtime error is detected after or during the execution (running state) of a program, whereas a compile-time error is detected by the compiler before the program is executed. Type checking, register allocation, code generation, and code optimization are typically done at compile time, but may be done at runtime depending on the particular language and compiler. Many other runtime errors exist and are handled differently by different programming languages, such as division by zero errors, domain errors, array subscript out of bounds errors, arithmetic underflow errors, several types of underflow and overflow errors, and many other runtime errors generally considered as software bugs which may or may not be caught and handled by any particular computer language.

Exception handling supports handling runtime errors, providing a structured way to catch unexpected situations as well as predictable errors or unusual results without the amount of inline error checking required of languages without it. More recent advancements in runtime engines enable automated exception handling which provides "root-cause" debug information for every exception of interest and is implemented independent of the source code, by attaching a special software product to the runtime engine.

Debugging

Some debugging can only be performed (or is more efficient or accurate when performed) at runtime. Logic errors and array bounds checking are examples. For this reason, some programming bugs are not discovered until the program is tested in a production environment with real data, despite sophisticated compile-time checking and pre-release testing. In this case, the end-user may encounter a "runtime error" message.

Sign in to keep reading

One more chapter is free with a Lably account.

More in Computing and communication