Non-computer scientist here, trying to understand what SICP (Structure and Interpretation of Computer Programs) means by a procedure, whether it matches the dictionary definition, and also how a procedure relates to an algorithm (so maybe I should ask separate questions).
First, SICP defines a process:
We are about to study the idea of a computational process. Computational processes are abstract beings that inhabit computers. As they evolve, processes manipulate other abstract things called data. The evolution of a process is directed by a pattern of rules called a program. People create programs to direct processes. In effect, we conjure the spirits of the computer with our spells.
This seems clear to me (although I did struggle with it in the past). It mentions processes run by e.g. a modern operating system, (ultimately) on a computer. They are evolving manipulations of data directed by a pattern of rules which is a computer program inserted in memory and made up by instructions. I've taken my share of the From Nand To Tetris pt. I course to understand what this means.
Later on, it goes:
The most significant of these features is the fact that Lisp descriptions of processes, called procedures, can themselves be represented and manipulated as Lisp data.
I'm trying to conciliate this with the dictionary definition of procedure. I've bumped into the mention in SICP of a procedure receiving a name and being callable (or something like that; I couldn't find it again when I looked it up), so I suspect that both of them refer to the same concept. Also I'm aware that a process in the OS executes algorithmic instructions (i.e. instructions described by an algorithm), so this seems like a safe assumption to make.
Definition of algorithm
(...)
: a procedure for solving a mathematical problem (as of finding the greatest common divisor) in a finite number of steps that frequently involves repetition of an operation
broadly : a step-by-step procedure for solving a problem or accomplishing some end
Definition of procedure
(...)
2a (presumably related to 2b below) : a series of steps followed in a regular definite order
// legal procedure
// a surgical procedure
2b : a set of instructions for a computer that has a name by which it can be called into action
Definition of operation
(...)
8 : a single step performed by a computer in the execution of a program (see program entry 1 sense 6a)
Definition of program (Entry 1 of 2)
(...)
6a : a sequence of coded instructions that can be inserted into a mechanism (such as a computer)
I must admit that I struggle with definitions sometimes.
So, the 2b definition of procedure simply says a procedure is a set of instructions for a computer (should it have said a sequence of instructions I'd say it refers to the binary machine code in a program) that has a name (or, for that effect, any usable reference) by which it can be called into action. Despite it not being a sequence, it still sounds like it refers to a callable function.
So is the SICP definition the same as a function that can be called from its address (thinking of assembly, following a certain convention for passing arguments and returning a value)?
I've taken a look into the JavaScript edition of SICP and from what I recall it replaces procedures with functions in the text.
I'm aware that the Pascal programming language differentiates a procedure from a function. Based on my suspicion, it seems that all these definitions match (a Pascal procedure is the same as a SICP or dictionary procedure; and also simply a function that returns no value).
So do both definitions match? Or is a procedure something trickier than it seems?
Bonus question, which definition of a procedure can I use to define an algorithm?
Further dissecting the dictionary definitions, it seems to be that a) coded instructions are not the same as instructions (although both can be referred by the same name); b) an operation is the execution of a coded instruction by a processor, not the instruction itself; c) a procedure is defined as a set of instructions, possibly because a callable function in assembly is made up of multiple parts (i.e. the calling part which sets it up and the callee); d) in the definition of algorithm, I don't know what it means by repetition of an operation -- repetition of operations would make more sense to me.
P.S.: The question tags are a mess, but I'm not sure which ones to add.