<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Aug 6, 2015 at 1:12 PM, leam hall <span dir="ltr"><<a href="mailto:leamhall@gmail.com" target="_blank">leamhall@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Thu, Aug 6, 2015 at 12:58 PM, Ed Cashin <span dir="ltr"><<a href="mailto:ecashin@noserose.net" target="_blank">ecashin@noserose.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Responding to, '<span style="font-size:12.8000001907349px">With Ruby, I can say "It's on the machines, so I can use it"'...</span><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">If you write a Ruby script, that script has to be deployed to the target where it will run, so that's one file being added that wasn't on the machines before.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">If you write a Go program and compile it, you get a statically linked executable (if you are using regular go), which is also one file that has to be deployed to the target where it will run.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Either way, you have to add one file that wasn't there to the target machine. So if you don't install the Go build tools on the targets, the distinction isn't significant.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">This is an advantage Go has over a lot of other compiled languages. It avoids some of the dependency hell that motivated people to adopt Docker and containers. It's kind of ironic.</span></div></div></blockquote><div><br></div></span><div>Ed, sorry if I'm confused. If I compile a Go program and drop it on a server without any other Go tools, the program will run? That assumes it's not calling anything else, but something like "Hello world!"?<br></div></div></div></div></blockquote><div><br></div><div>Yes, the default normal Go distribution will create a statically compiled, self-sufficient executable that can run without any special packages, shared libraries, or other files being on the target.</div><div><br></div><div>You can do it in C and C++, too, but it's a little off the beaten path, so you usually have to install special packages and use special command-line options.</div><div><br></div><div>Interestingly, distros do tend to split the Go cross compilers into separate packages. Cross compiling Go looks like:</div><div><br></div><div> GOOS=windows GOARCH=386 go build hello</div><div><br></div><div>... on Linux, giving you a hello.exe that runs fine on Windows 7. But you have to yum install golang-windows or something first.</div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"> Ed Cashin <<a href="mailto:ecashin@noserose.net" target="_blank">ecashin@noserose.net</a>></div></div>
</div></div>