2 ms·
You didn't think I meant running JavaScript in the browser, did you??! Of course JavaScript has an external library for sane subprocess calls, and is perfectly
by DonHopkins 8y ago
You didn't think I meant running JavaScript in the browser, did you??!
Of course JavaScript has an external library for sane subprocess calls, and is perfectly fine and commonly used for writing process management and system administration scripts. Please google "node.js" and "npm".
[Edited for tone -- thanks mkesper.]
- m45t3r 8y agoYeah, I was referring to Node.js. And no, what Node.js offers by default seems horrible[1]. It pass its entries to system shell, that is completely insane. Python's subprocess actually run the process inside a Python process, so there is no possibility to hang youself up in case of a vulnerability in shell code. You can explicitly run the subprocess in shell script if you need shell capabilities (glob expansion comes in mind), however you shouldn't. [1]: https://nodejs.org/api/child_process.html https://nodejs.org/api/child_process.html
- detaro 8y agoDoesn't seem that different to what Python offers? There's ways to use the shell, most options do not use it by default.
- mkesper 8y agoNo need for that tone, right?
- hpcjoe 8y agoJavascript and numerics. That is my takedown of javascript. If you don't know why its bad for numerics[1] or just generally weird [2][3] ... No, JS shouldn't be used as a systems language IMO. It gives you enough rope to shoot yourself in the foot (multiple mixed metaphors for a reason). [1] https://charlieharvey.org.uk/page/javascript_the_weird_parts https://charlieharvey.org.uk/page/javascript_the_weird_parts [2] https://hackernoon.com/js-wtf-with-math-79da9a941ec1 https://hackernoon.com/js-wtf-with-math-79da9a941ec1 [3] https://github.com/denysdovhan/wtfjs https://github.com/denysdovhan/wtfjs