The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

pminten (16) [Avatar] Offline
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 (109) [Avatar] Offline
Re: Turning code into a process
Good catch, and this can surely be better reworded. Thanks!