1. 21
  1. 10

    Joe needed to transfer a number of files between two computers, but didn’t have an FTP server. “But I did have distributed Erlang running on both machines” (quote from the book, not the blogpost), and he then proceeded to implement a file transfer program in, what? 5-10 lines of Erlang, depending on how you count? Beautiful.

    1. 6

      It’s certainly impressive. As someone used to corporate environments 15 years after Joe wrote this, I’m even more amazed at the network access he enjoyed.

      1. 2

        Ye-ess, the network access and ability to start/access a server program is key, isn’t it?

        If it were SSH instead of Erlang, one could write

        ssh joe@server sh -c "base64 < myfile" | base64 --decode > myfile.copy
        

        to much the same effect — this is not downplaying at Erlang at all, it’s a second illustration of how powerful a remote procedure call sytem can be. (And SSH can only return text, imagine having Erlang where your RPC can return any data structure a local call can. (In part because Erlang deliberately limits its data structures to ones that can be passed as messages.))

        1. 3

          If it were SSH instead of Erlang, one could write

          The funny thing is that iirc SCP works like this (or has fallbacks to work like this)

          And SSH can only return text, imagine having Erlang where your RPC can return any data structure a local call can

          SSH can transmit arbitrary data. That’s how terminal control characters still work.

          1. 2

            Heh, I’ve used ssh cat a few times when scp and sftp weren’t available or didn’t function.

    2. 6

      Reminds me a bit of the talk “Discovering Python” by David Beazley, only in his case he had to implement half of the coreutils from scratch in python instead of downloading them because the computer was completely locked down.

      https://www.youtube.com/watch?v=RZ4Sn-Y7AP8

      1. 3

        That was a really interesting talk. Thanks for linking to it.

      2. 4

        I did something similar at a corporate client around 2012. Only I just needed a proxy to hop one machine further. I didn’t have access to http server config, but I did have Ruby and an open port 🕺