Instead of a flat string, Erlang — oops, did I say Erlang? I meant Elixir — creates a nested list containing four leaf elements that add up to the string we expect: “Hello “, “&”, “amp;”, and " Goodbye”. At first glance this may seem like a pointless complication, but let’s see what the computer thinks about the situation.
If you look at the man page for writev, you’ll see it’s a “gathered write”, which means it writes data from multiple memory locations in a single system call. I wrote a little DTrace script to unpack the writev call we saw earlier, and peek at what that Elixir code is actually doing with this system call.
https://www.evanmiller.org/elixir-ram-and-the-template-of-doom.html
#erlang #elixir #dtrace #write #writev #syscall #string #strings #programming
The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.
#programming #oop #erlang #joe-armstrong #quote #coders-at-work #book