That's a very naive argument. There are so many other variables in choosing a cross platform language which you've overlooked:
]] Performance (AOT compiled languages will typically out perform JIT compiled language
]] user interface (is this going to be a command line app? Does it need a GUI? And if so, what frameworks are supported and do they need any OS specific boiler plate code?)
]] required runtime environment (does your language tool chains support compiling to a native binary (Windows PE / Linux ELF) or do you need a language runtime environment? And if the latter, what's the likelihood of the target OS having said framework pre-installed?)
I'm not trying to take anything away form Javascript / Node, but it loses as many points as it wins. And frankly both languages fail compared to some other languages too.
Personally I mostly target Linux and FreeBSD, but the majority of my Go tools will compile for Windows with zero code changes (the standard Go libraries actually do abstract away most OS specific discrepancies) and all of my code works on Linux and FreeBSD without any Linux / BSD specific code. So I think the issues of different files for different OSs is overstated anyway.
I didn't argue anything about performance. Go might have better performance than Node.js, but that doesn't make Go better for cross-platform distribution! They are separate factors. If performance is your top priority and Go has better performance than Node.js then choose Go while acknowledging that it's possible that Node.js has better cross-platform code distribution support.
>user interface
I didn't make any arguments about that either.
>required runtime environment
Now that's relevant when it comes to cross-platform distribution. Node.js has that covered pretty well.
>I'm not trying to take anything away form Javascript / Node, but it loses as many points as it wins
My comment was not about Node.js vs Go as a whole, it was about developing cross-platform software.
>So I think the issues of different files for different OSs is overstated anyway.
If you look at the core issue here, it's that theoretically speaking "all things equal" Go and Node.js needs about as much work to implement a new feature that works with most platforms. However, on top of that Go requires a compilation step for every supported platform, and that's not required for Node.js.
However, Node.js requires someone to compile the Node.js environment for each supported platform. For most cases that's already done.
This is my core argument that Node.js does cross-platform development better. It's one of the things that Java and C# got right.
"This is my core argument that Node.js does cross-platform development better."
Your argument is theoretical. In practice, people are finding Go apps easier to deploy. Reality trumps theory.
Why is reality trumping theory? With Go you one artifact, the executable, which runs on its own and you're done. With Node, you don't and you're not done, and even with the incredibly minimal bit of Node stuff I've touched (keybase.io, one of the minifiers), I still had to fight with Node to get it to run. Sorry, this one is easy to objectively call: Go produces artifacts that are easier to deploy. It doesn't matter how you try to talk around that fact, it simply is not the case that you ship one file with Node and are done; that is at best the best case when all the stars align and the wind is at your back.
javascript requires you install Node on your target platform alongside your Javascript program, where as Go doesn't. So the extra step you described gets equalled out.
as I said, it's very naive to blanket claim that node is better for cross platform development.
If I'm completely honest, i find people who say languages are definitively better at boardly defined subjects are usually lacking objectivity. Programming can seldom be summarise so easily without losing all precision.
]] Performance (AOT compiled languages will typically out perform JIT compiled language
]] user interface (is this going to be a command line app? Does it need a GUI? And if so, what frameworks are supported and do they need any OS specific boiler plate code?)
]] required runtime environment (does your language tool chains support compiling to a native binary (Windows PE / Linux ELF) or do you need a language runtime environment? And if the latter, what's the likelihood of the target OS having said framework pre-installed?)
I'm not trying to take anything away form Javascript / Node, but it loses as many points as it wins. And frankly both languages fail compared to some other languages too.
Personally I mostly target Linux and FreeBSD, but the majority of my Go tools will compile for Windows with zero code changes (the standard Go libraries actually do abstract away most OS specific discrepancies) and all of my code works on Linux and FreeBSD without any Linux / BSD specific code. So I think the issues of different files for different OSs is overstated anyway.