News for hackers. Stuff that matters.
Re:XSV: A fast CSV command-line toolkit written in Rust by earenndil on Saturday September 08, 2018 @09:23PM (#17943767)
* 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.

Re:XSV: A fast CSV command-line toolkit written in Rust by cgag on Saturday September 08, 2018 @11:30PM (#17944194)
I don't want reasonably fast, I want the 4 billion Hertz to rattle my teeth.
Re:XSV: A fast CSV command-line toolkit written in Rust by TheCoelacanth on Saturday September 08, 2018 @10:03PM (#17943898)
Python 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.

Re:XSV: A fast CSV command-line toolkit written in Rust by earenndil on Sunday September 09, 2018 @02:14AM (#17944610)
Huh? 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'.

Re:XSV: A fast CSV command-line toolkit written in Rust by realusername on Sunday September 09, 2018 @02:34AM (#17944658)
Not 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.
Re:XSV: A fast CSV command-line toolkit written in Rust by jcelerier on Sunday September 09, 2018 @10:00AM (#17945906)
> 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.

Re:XSV: A fast CSV command-line toolkit written in Rust by burntsushi on Sunday September 09, 2018 @10:04AM (#17945920)
So 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.

Re:XSV: A fast CSV command-line toolkit written in Rust by jcelerier on Sunday September 09, 2018 @10:57AM (#17946171)
> 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.

Re:XSV: A fast CSV command-line toolkit written in Rust by burntsushi on Sunday September 09, 2018 @11:43AM (#17946394)
Why 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.
Re:XSV: A fast CSV command-line toolkit written in Rust by jcelerier on Sunday September 09, 2018 @02:13PM (#17947048)
Re:XSV: A fast CSV command-line toolkit written in Rust by dj43nq on Sunday September 09, 2018 @06:41PM (#17948188)
Don’t you end up with licensing fees if you use QT in a commercial product? Seems like a downside to me.
Re:XSV: A fast CSV command-line toolkit written in Rust by dj43nq on Monday September 10, 2018 @12:46PM (#17953081)
QT seems interesting.

For those like me who’ve never used QT: As long as you don’t statically link the QT libraries you don’t have to open source your entire commercial application. I’m not a lawyer.

General notes about licensing https://www1.qt.io/licensing/

Comparison of licenses https://www1.qt.io/licensing-comparison/

Re:XSV: A fast CSV command-line toolkit written in Rust by jcelerier on Tuesday September 11, 2018 @05:56AM (#17958346)
> As long as you don’t statically link the QT libraries you don’t have to open source your entire commercial application

I provided a link from the FSF that shows that this is not the case just below - you can statically link proprietary apps with LGPL qt.

Re:XSV: A fast CSV command-line toolkit written in Rust by dj43nq on Tuesday September 11, 2018 @09:12PM (#17964818)
“(1) If you statically link against an LGPL'd library, you must also provide your application in an object (not necessarily source) format, so that a user has the opportunity to modify the library and relink the application.”

So for LGPL. As a commercial application developer I’m not sure I’d want to do that. I’d then have to field support requests for that object file.

Still, good to know.

Re:XSV: A fast CSV command-line toolkit written in Rust by jcelerier on Sunday September 09, 2018 @07:07PM (#17948280)
Not at all. You have to respect the license of Qt (e.g. if your customer asks you for the source of the Qt libraries you have to provide them - including any modification you made to them), but you can keep your own app proprietary and ship the whole however you like.
Re:XSV: A fast CSV command-line toolkit written in Rust by detaro on Sunday September 09, 2018 @06:42PM (#17948194)
LGPL isn't that hard to comply with for a desktop application, so no.
Re:XSV: A fast CSV command-line toolkit written in Rust by littlestymaar on Monday September 10, 2018 @03:52AM (#17950127)
With LGPL, you can't statically link the library though. Which requires your user to install it manualy, unless you package your software with some kind of installer (which is not so common on windows for cli executables).
Re:XSV: A fast CSV command-line toolkit written in Rust by jcelerier on Monday September 10, 2018 @05:45AM (#17950559)
> With LGPL, you can't statically link the library though.

no, that's tiresomely false. You can link proprietary code statically with LGPL code. LGPL does not give a shit about static or dynamic libraries because LGPL is not a language-specific license.

Right from the source: https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynami...

Re:XSV: A fast CSV command-line toolkit written in Rust by littlestymaar on Monday September 10, 2018 @07:24AM (#17950934)
Thanks for the link. The nuance I was missing is that you can distribute statically-linked LGPL library as long as you provide a way for your user to override the chosen library with his own version of the library.
Re:XSV: A fast CSV command-line toolkit written in Rust by detaro on Monday September 10, 2018 @07:17AM (#17950910)
It's very common to ship windows CLI tools as a .zip file with an exe and a bunch of .dlls, that's not exactly burdensome to install compared to only an executable.
Re:XSV: A fast CSV command-line toolkit written in Rust by dj43nq on Sunday September 09, 2018 @06:40PM (#17948182)
It’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.
Re:XSV: A fast CSV command-line toolkit written in Rust by realusername on Monday September 10, 2018 @02:52AM (#17949895)
I never said it's complicated, I find it pretty simple, it's just not going to work by default straight away.
Re:XSV: A fast CSV command-line toolkit written in Rust by earenndil on Sunday September 09, 2018 @11:59AM (#17946460)
Mingw?
Re:XSV: A fast CSV command-line toolkit written in Rust by jaipilot747 on Saturday September 08, 2018 @10:46PM (#17944058)
It'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.
Re:XSV: A fast CSV command-line toolkit written in Rust by whyever on Sunday September 09, 2018 @05:57AM (#17945183)
> 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.