4 ms·
* 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'
by 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.
- burntsushi 8y agoWhy isn't this more common then? I've literally never seen this done in any of the C++ command line tools I've looked at.
- jcelerier 8y agohttps://github.com/search?l=QMake&q=%22CONFIG+%2B%3D+console%22&type=Code https://github.com/search?l=QMake&q=%22CONFIG+%2B%3D+console... common enough for me
- dj43nq 8y agoDon’t you end up with licensing fees if you use QT in a commercial product? Seems like a downside to me.
- earenndil 8y agoMingw?
- dj43nq 8y agoIt’s not THAT hard to make a cli C program portable between windows, Mac and Linux. I’ve done plenty of projects that support all three platforms and the amount of work wasn’t excessive. For some projects it was just getting the build environment up that was the biggest issue. Once you use cmake, modular design etc a lot of the issues vanish.
- realusername 8y agoI never said it's complicated, I find it pretty simple, it's just not going to work by default straight away.
- 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.