pminten (16) [Avatar] Offline
#1
On page 258 of v7 of the book in section "REMOVING THE PROCESS" you write about whether code can be a process or a plain module. This is somewhat confusing because you conflate two sets of things.

Code and modules are part of the the static structure of the program. Processes are part of the dynamic strucure of the program. Many processes can execute the same instructions (from the code) at the same time.

This is related to something that confused me a lot when I was learning Erlang. When you have a gen_server you have one module with different functions but when you think about the execution there is a process that calls functions like start_link and query (or whatever the API uses) and another process that calls handle_call, handle_cast, etc. It took me a while to intuitively grasp how processes are completely orthogonal to modules.

I also don't particularly like the term "pure module". Really what you are describing here is more the difference between a module that implements gen_server and a regular module. Naming is tricky here though, can't say I have any brilliant suggestions.
sjuric (86) [Avatar] Offline
#2
Re: Turning code into a process
Good catch, and this can surely be better reworded. Thanks!