Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SICP - Procedures versus Process [duplicate]

What's the conceptual difference between a procedure and a process?

If the answers depends on the language, I am thinking about this while studying the SICP book which uses lisp (scheme).


2 Answers

A program is a description of how to compute something. If you tell the operating system to run a program, it reads a program (in the form of an executable) from disk and the starts a process aka a computation where cpu follows computational steps as given by the program. If you start the same program twice you get two processes (if you are using a GUI you have probably tried accidently to left click on an icon twice, making two windows appear (here each window belongs to a process).

In the context of sicp, the process is the running computation and the procedure is the description of the computation aka the program (or part of a program).

See https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-9.html#%_idx_114

like image 156
soegaard Avatar answered Sep 12 '26 16:09

soegaard


In the context of SICP:

  • Procedure is the description (if you want, a recipe) of the process.
  • Process is the result (in a broad meaning, not just a returned value) of applying a procedure to arguments: all the contexts that are set up, variables with defined or set values, all the computation that will take place, etc. None of this happens in the procedure itself.

Another analogy: procedure is a blueprint, a schematic of the building for example, process is actual building construction.

like image 27
mobiuseng Avatar answered Sep 12 '26 17:09

mobiuseng



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!