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

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)

https://groups.google.com/forum/#!topic/comp.lang.oberon/8Bmb20Ds8Cg

#programming #usenet #1993 #oberon #c #libc #ulms-oberon-compiler #programming-languages #hello-world #write #printf #setlocale

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)