It’s arrived, my copy of the book!
Ooo exciting! And I like what you did with your arm there Herminio
I’ll look forward to reading your updates
It’s more because of prolog syntax, lol. ^.^
Also more prolog.
Eh, an atom is most close to, say, a global variant, which is common stuff in a lot of languages like OCaml (which is technically OOP-capable though no one really does that in it), or an enum in most other languages (though those are namespaced!).
Which is why I’m still sad about the removal of value typed modules just a few versions ago…
It had so many useful abilities, especially in regards to emulating higher typed modules (by just putting a module inside a modules values!)!
Dialyzer is always a must use! ^.^
I have a special trepidation and positive attitude bordering on love for the author of this book (Joe Armstrong). What a pity that he was not destined to write the continuation of the chapters of this wonderful book. Well. We will be glad that we have! Several years ago I translated this second edition of this book into Russian. Unfortunately, due to the plight of the publishing industry in Russia and the small community (I develop one of them), I was never able to release this translation of mine.
I have an idea how to continue to improve this wonderful book. I will make rebar3 projects based on the examples of the book as I re-read this book. What do you think of this way of rereading a book? I would be interested to know your opinions.
I am now doing similar creative work, reading a book “Erlang Programming”. I will definitely share the results with you if you are interested in it.
Awww I miss Joe too
I’ve been trying to get @rvirding to write one for a few years now - I’m hoping he might change his mind one day
Have you thought about approaching PragProg? Last time I spoke to @Dave he mentioned they actually translate many of their books to German… so who knows maybe Russia is also on their radar
I’d probably read it from the beginning and post an update here once per chapter… that way you won’t miss anything important It’ll help keep you (and the rest of us!) motivated too
@rvirding has a lot of stories to tell and something to share by book I hope. He recently gave an interesting interview (via smartlogic podcast).
Super! It is goo for you. I prefer active reading: “reading + coding + thinking” circle. Thus, I better perceive new educational material and find my own approaches and solutions.
Yep I am sure he does - I reckon he could provide a really good opinion/insight on Erlang and how it and the BEAM world has been expanding these past few years
Awesome, keep us posted!
PS, I noticed you’ve put you’re interested in the #zotonic framework - any particular reason why? (I wonder if we need a dedicated thread to chat about it!)
I think it can be right tool when you would like to develop web app with thick client part (Angular framework). For instance merging Erlang power with Angular. I think it would be useful stack of technologies.
#zotonic has all I need at backend part.
If you prefer Erlang for web #zotonic is handy tool. Its API actively developed - (zotonic news).
I’ve never heard of #zotonic but I’ve tested #nitrogen !
Already bought the “Build it with Nitrogen” book which his kinda…thick.
You’ll have to start a thread (or Journal) about it @Maartz - I am sure loads of us will be interested in hearing your thoughts about it
That’s a terrific idea!
Chapter 1 - Introducing Concurrency
About concurrent and parallel:
- Distinguish between concurrent and parallel.
- Computer with only a single-core, it can never run a parallel, but it could be possible to run concurrent, because the computer use time-share between the different tasks and give the parallel illusion to run these tasks.
- Concurrent program is a program written in a concurrent programming language.
- Concurrent Programming Language is a language that has explicit constructs for writing concurrent programs. These constructs are an integral part of the language.
- Parallel Computer is a computer that has several processing units(CPUs or Cores) that run at the same time.
PS: Concurrency has to do with software structure; parallelism has to do with hardware.
Module declaration:
-
Syntax
-module()
. The first line-module(some_module_name)
and should be the same as the filename without the.erl
extensions. -
Module name, it’s written with a small letter.
-
Module name is an atom.
Public functions:
- Syntax
-export()
. E.g.-export([FunName1/N1, FunName2/N2,])
. - The square brackets
[...]
mean “list of”, list of public functions and arity(e.g./1
).
The spawn
it is an Erlang most primitive way to create a concurrent process and returns a process identifier(pid
).
spawn(ModName, FuncName, [Arg1, Arg2, ..., ArgN])
And with the process identifier, it how to interact with this process.
In Erlang, processes share no memory and can interact only with each other by sending messages. It’s an actor model.
John ! {self(), "Hello World"}
The syntax Pid ! Msg
means send the message Msg
to the process Pid
. The self()
argument in the curly brackets identifies the process sending the message.
How to receive
messages where are sent?
receive
{From, Message} ->
...
end
Benefits of Concurrency:
- Improve performance
- running in concurrent and parallel based on the numbers of CPUs the computer had to improve performance. It’s necessarily to write concurrent programs. The sequential code doesn’t fit with a multicore computer to run parallel.
- Create scalable
- concurrent programs are made from small independent processes, and help to scale easily to increase the number of processes and add more CPUs.
- Fault-tolerant
- it means processes will run independent, and if any error occur in one process cannot accidentally crash another process, its protect against the failure.
- Clarity, be more reliable
- use sequential language to write real-world, made things run in parallels more difficult, because it necessarily uses another services and solutions where the language is native support, but Erlang can map the real-world parallelism more clear and easily to understand.
Speaking in analogies I loved this one:
I am not reading the book yet, bought it today in the spring promotion and just skimming its contents.
Until now I have read a bit here and there and I really enjoy how Joe expresses himself
Joe certainly had a flair for articulating his thoughts very eloquently
I need to get back to this book soon! Keep posting in here when you get around to it Paulo!
Hi there,
Can anyone explain to me why (page 107) mp3_sync:find_sync(Bin, 1) is called with 1 instead of 0?
Calling it with 0 returns nothing, like no frame was found. But calling it with one, seems to me, that we are gonna skip the first frame on purpose.
Sorry, no idea
Really should finish the book…
I thought you finished it
Maybe I confused things with @mafinar
It’s still on my list, currently halfway through Prag Dave’s Elixir course…
Almost