9 ms·
I'm impressed, it's no insignificant feat. Although, I'm more amazed this post has been up an hour without any rust comments..
by TheChaplain 5y ago
I'm impressed, it's no insignificant feat.
Although, I'm more amazed this post has been up an hour without any rust comments..
- chromatin 5y ago...but you did make a Rust comment :-O
- boardwaalk 5y agoThe PR doesn't do much if you look at the changes. It looks like it's mostly compiling as C++ and using things like 'auto' and C++-style casts.
- pianoben 5y agoSpeaking as a C++ person - you're right that this doesn't _do_ much, but nevertheless this is still a significant effort. This kind of groundwork is _work_, and opens lots of doors for future improvements. That said, there are definitely downsides here. Even if they manage to keep c++ entirely out of headers, consumers now have the headache of either building libtransmission themselves _or_ making sure they include a compatible runtime in their own projects. As soon as c++ leaks out into the public interfaces, it's game over for precompiled binaries - everyone will have to build it whether they want to or not. Not the end of the world, but certainly it could be painful for downstream projects.
- Ericson2314 5y agoThey should probably be like LLVM and just keep a C wrapper around new C++ interfaces for such purposes. But agreed this is the right first step.
- maccard 5y agoBut someone needs to do this before the interesting stuff can happen.
- pjmlp 5y agoAlready that little does much, as C++'s type system is more strict. The rest can be (hopefully) increasingly migrated. This was both the plus (and now Achilles's heel regarding fixing C++) of migrating C code into C++.
- tpush 5y ago> Although, I'm more amazed this post has been up an hour without any rust comments.. There are more comments on any given post about hypothetical obnoxious Rust comments than any actual comments of that nature.
- pizza234 5y ago> Although, I'm more amazed this post has been up an hour without any rust comments.. I've actually thought "WTF why porting a project to a memory unsafe language", but actually the PR title is somewhat excessive - it's more of a modernization, indeed described by the author as "the first incremental step of getting libtransmission to compile with a C++ compiler".
- phkahler 5y agoI think there is a tool to automatically convert C to Rust, but that would probably be a terrible idea given what looks like a lot of custom data structures that would translate to unsafe Rust.
- Ericson2314 5y agoIt would be interesting to try to make it recognize C++ STL usage but not much more of C++ next.
- junon 5y ago> WTF why porting a project to a memory unsafe language Because proper handling of memory is actually quite easy to achieve in C++ assuming you're doing all the right things. We also have great tooling for this a la sanitizers and valgrind. Also, C and C++ remain to be more performant than Rust in the general case, and don't require rewriting everything into a completely different paradigm.
- inshadows 5y agoI'm sure the thread is monitored and strike force is being dispatched as we speak.
- simias 5y agoI confess that it crossed my mind. Torrents are obviously network-oriented and are often used to interact with, uh, untrusted content (the torrent files but also the trackers and peers that exchange data with the client). The surface of attack is rather large, using a memory-safe language doesn't seem like a luxury. I also can't imagine wanting to write C++ in this day and age, but that's my prejudice. That being said I've been using transmission for years without complaints, so I trust them to do the right thing.
- jeltz 5y agoSaid the guy posting a Rust comment.
- deleted 5y ago[deleted]
- aaaaaaaaaaab 5y agoRust has jumped the shark.
- kelnos 5y agoIt's almost certainly a much more tractable problem to get C code compiling with a C++ compiler, and then gradually transitioning to C++ and the STL over time. I would love to see greater Rust adoption (especially in things that deal with untrusted peers on a network!), but that project is likely orders of magnitude larger than what the author has chosen to take on. Also it seems like the author is already well-versed in C++; learning Rust might not be a priority for them, and would certainly slow things down a lot. And while there are certainly plenty of footguns and unsafe things you can do in C++ (even unintentionally), it's probably still safer than C, even if it's not as safe as Rust.
- ryandrake 5y agoAnd just to be that overly pedantic nit-picker, when most people refer to the "STL" today, they are really talking about the C++ Standard Library[1], which is related to and based on the conventions of the old-school Standard Template Library (STL), but a different thing. When you #include <vector> on most modern development platforms, you are not using the actual historic STL implementation. 1: https://en.wikipedia.org/wiki/C%2B%2B_Standard_Library https://en.wikipedia.org/wiki/C%2B%2B_Standard_Library
- FpUser 5y ago>"And while there are certainly plenty of footguns and unsafe things you can do in C++" If I want to shoot myself in the foot I should have full rights and the ability to do so. In a normal coding however modern C++ is very reasonable language and I do not recall stepping onto any landmines in a last few years even though my code runs high load / high performance business servers that also do a lot of calculations.
- FpUser 5y agoSame impression. I was wondering when those Rustamans will descend ;)
- bregma 5y agoI bet you like to poke wasp nests with sticks too.
- xvilka 5y agoRust is good but the GUI support is far from perfect, especially Qt-based interfaces.
- wiz21c 5y agothey use rlang (don't confuse with erlang) as their C++ compiler (rlang is a C++ compiler written in rust, giving the benefits of ownership to C++ programs for free)