Agentic Research

Runtime

Also: 執行環境 · runtime error · 執行期 · 執行時 · build time

Two meanings: the program that executes your code (the Python interpreter, Node.js, a browser); and the period while your code is actually running, as opposed to the moment it was written.

When you will meet it

When a message says RuntimeError, runtime error, or 'at runtime', it is telling you something specific: this could not be seen when the code was written, or even when it was installed — it only blows up when that line actually executes. Once you know that, 'it was fine a minute ago' stops meaning the code is fine, and reproducing the failure becomes more useful than staring at the source.

An analogy

The first meaning is like matching a plug to a supply: the same appliance behaves completely differently on 110 V and 220 V — the code did not change, the thing running it did. The second is like a recipe versus actually cooking: the recipe cannot tell you it came out too salty; only making it can.

Minimal example

python3 --version      # 這個 Python runtime 的版本
node --version         # 這個 Node.js runtime 的版本
which -a python3       # 機器上有幾個 runtime 可用,命令列會挑到哪一個

'Works on my machine' is nine times out of ten a different runtime: one version number off, or a different python3 being picked up. Attaching those two version numbers to a bug report beats ten lines of prose description.

What people get wrong

  • Learning only one of the two meanings. Both are common and you tell them apart from context: 'install the Node.js runtime' means the program, while 'this only fails at runtime' means the period of time.
  • Responding to a runtime error by reinstalling, as though the environment were broken. More often it is a data problem: the code reached a line and met input it did not expect. Reproduce it first, then look at what that line actually received.

Related terms

Next