Fred Brooks said that conceptual integrity was paramount in system design. Niklaus Wirth said that if we add things to a language we should throw away other things.
Here is a proposal for a few small additons to Erlang.
If we accept these proposals - we can throw away a lot of things and make Erlang even more powerful.
Bang bang is a new operator.
Is syntactic sugar for: sysd:rpc(A, B) - which is "more or less" a remote proceedure call.
The A in A !! B is a Pid, a process name, or a list of Pids and process names.
returns [V1, V2, V3] where V1 = A !! X, V2 = B !! X and V3 = C !! X, all computed in parallel.
Recall that we said earlier that everything is a process, and that all processes have names.
Files are processes.
If F is a file, then F !! read reads the file.
The following code fragment read and file and copies it to a new location:
Files can be named in a number of different ways. This example reads 4 files in parallel:
If a process name is of the form //Node/Name then the operation will be performed on a remote node instead of on the local node.
Makes the previous program into a distributed version of the same thing.
In the beginning of the universe several magic processes are assumed to exist. These have names like /dev/... - these process are pre-defined and do magic things.
In particular. /dev/spawn is a process spawning device. If you send /dev/spawn A an Erlang Fun it will send you back an Erlang Pid
Creates two Erlang processes, one on the local node the other on bingbang.here.org.
AND we can throw away the Erlang primitive spawn. It's replaced by the spawn device.
Here are a few of the standard devices.
|http://Host/File||read only files|