Message passing is at the core of Erlang - "Message passing through Processes".
But the concept of Virtual Machine when it comes to erlang is still vague.
Any Help?
There are couple of reasons for using virtual machine:
Actors
Erlang tries to be smarter than the operating system it is running on. Creating OS processes is slow and expensive. Erlang has its own light processes, scheduler that manages them and means to move them between cores. The scheduling is preemptive, which gives soft real time properties (it would be very hard to do without virtual machine)
Memory management
Allocation of memory in OS might be slow, that is why Erlang can preallocate memory and manage it internally. It is connected with data structures being immutable and garbage collecting.
Instruction set
When you have predefined set of instructions, it is easier to make optimisations. You can also create other languages on top of VM, like Elixir or Lisp Flavoured Erlang.
There are probably many, many other reasons, but those I wrote quickly from the top of my head. Main purpose of Erlang is building fault tolerant systems (the scalability thing is just byproduct of fault tolerance as Joe Armstrong explained). It was better to "restrict" user to virtual machine, where the execution can be easily controlled and give the user fault tolerance in return.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With