5 ms·
The language itself doesn't have much importance, what matters is : - is it portable ? Or will the users have to install a specific runtime to run the tool ? F
by littlestymaar 8y ago
The language itself doesn't have much importance, what matters is :
- is it portable ? Or will the users have to install a specific runtime to run the tool ? For Linux it's not a big deal because it comes pre-installed in most distributions, but making Python work on Windows requires some work. It's not too much if you're going to use the tool often, but for merely testing it, the runtime installation burden can deter users.
- is it fast ? For many application, speed doesn't matter, but for some it matters.
- is it stable ? Or will it crash every now and then ? C or C++ software have memory bugs, that leads to crashes (segfault). The most mainstream one don't have too much of it, but as soon as you start using niche software, you'll face crashes more often than not.
For these three reasons, the language matters, but there's not much difference if it's Rust, Go or Haskell.
- earenndil 8y ago* Python is not all that difficult to package into an exe. C/C++ are very cross-platform. * Python can be reasonably fast with pypy. * Go and rust maybe don't have segfaults, but they can still crash and burn, or have other kinds of bugs.
- TheCoelacanth 8y agoPython is not hard to package into an exe, but most Python programs aren't packaged like that. C and C++ are very cross-platform, if you only use cross-platform dependencies and if you are careful to write portable code. Most C and C++ applications don't do that.
- earenndil 8y agoHuh? What do you have to do to be careful? Just: * Don't include windows.h * Use a gui toolkit like gtk and qt (which you probably want to do anyway) Generally, making a software windows-only is a deliberate choice, not something that happens 'by accident'.
- realusername 8y agoNot really, most of the standard library and basic stuff is incompatible on Windows. So sockets, file system calls, event loops, file configuration & default folders... It's never THAT different but different enough that just compiling your code won't work.
- jcelerier 8y ago> So sockets, file system calls, event loops, file configuration & default folders... It's never THAT different but different enough that just compiling your code won't work. But if you use something like Qt you've got all of this cross-platform out of the box - I have a multiple hundred lines of code C++ software which does all this and much more ; it has almost zero platform-specific stuff except one function at some point to set real-time priorty to threads.
- burntsushi 8y agoSo you think it's appropriate for tools like ripgrep and xsv to bundle a gui toolkit to do its job? I feel like this whole line of argument is disingenuous. In Rust, you don't need to bundle a GUI toolkit to get cross platform stuff that works. The standard library was built with Windows in mind, and it shows. You don't need any additional POSIX layer. You just use the standard library. If you go and look at competitors to things like xsv and ripgrep that are written in C or C++, they either require some kind of POSIX thing on Windows to run correctly (like cygwin), or they jump through lots of hoops to behave as a native Windows application. It really should not be a controversial statement to say that Rust has a better cross platform story (Windows/mac/Linux). It was a design goal.
- jcelerier 8y ago> So you think it's appropriate for tools like ripgrep and xsv to bundle a gui toolkit to do its job? Qt is not a GUI toolkit, it's a general framework. If you only link to -lQtCore you won't have anything remotely related to GUI in your binary. For instance doxygen is built like this.
- jaipilot747 8y agoIt's not difficult to package, but if your experience is anything like mine, distributing a 400+MB zip containing all the dependencies and the python core+stdlib is no fun.
- cgag 8y agoI don't want reasonably fast, I want the 4 billion Hertz to rattle my teeth.
- whyever 8y ago> Python can be reasonably fast with pypy. Until it can't and then you are stuck with reimplementing the hot path in a language that can.
- GyYZTfWBfQw 8y agoYeah, when people think their "better" language is better because it doesn't segfault, instead it has runtime errors. That's actually worse, as you can't catch errors at compile-time, while you can with C. C is not an issue, it just happens to be pretty damn popular and most crucial and widespread software is written in it, which are more likely to get the attention of "hackers", audits, etc. I have gotten the worst kind of errors that an expert Python programmer hasn't for a decade, and I managed to do it in a few days of coding in it. Talk about "safety" and whatever. It doesn't matter what language it is, YOU NEED TO KNOW WHAT YOU ARE DOING. CRASHES AND MEMORY ERRORS HAPPEN IN LANGUAGES OTHER THAN C AS WELL! I managed to get such "memory bugs" in "safe" languages, like Rust, without even using the "unsafe" directive, so yeah.