4 ms·
One of the nice (perhaps underappreciated) side effects of Rust has been first-class support for all major platforms. If you're linking against other Windows bi
by newhouseb 10y ago
One of the nice (perhaps underappreciated) side effects of Rust has been first-class support for all major platforms. If you're linking against other Windows bits you still need to think about mingw vs. msvc, but beyond that you don't need to customize/hack up a build system to get things compiling sanely on both. I recently switched back to C for a particular project and there's been quite a bit of reverse-culture shock when it comes to setting up builds & projects.
- pjmlp 10y agoRust still doesn't have first class support for UWP.
- sqeaky 10y agoUWP? EDIT - I should clarify. I google UWP and it could be Universal Windows Platform. If so, how is that different than the windows builds that Rust does support?
- pjmlp 10y agoThink of UWP as Windows Longhorn reborn. It is the same programming model as .NET, but built on top of COM and just the minimal set of Win32 APIs to support COM based APIs. It is also sandboxed, just like on OS X. For Rust to support UWP, it needs to be able to consume COM with the new UWP semantics and at the same time expose traits as COM interfaces accessible to any programming language able to consume UWP libraries.
- sqeaky 10y agoThat doesn't sound like a good idea at all, any of it. Why is microsoft doing this?
- inferiorhuman 10y agoRust is pretty nice if a bit rough with the cross compilation stuff. The big problem is speed. Compiling rust projects takes a while and some operations like reading a file line b line are absolutely glacial.
- steveklabnik 10y agoAre you using a BufReader for those file reads? If not, system calls will slow you way down.
- inferiorhuman 10y agoYep. And it's something of a known issue. Using BufReader#lines is glacial (and something of a known issue) in debug mode and merely slow in release mode. My understanding is that the BufReader is allocating a new String object for each line and so you're dealing with strict UTF-8 parsing and memory allocation. My use case here is reading Vyatta config files. So lots of files that are generally (but not always) short. Mostly it's a fun teach myself Rust project, and it's hit lots of interesting edge cases in Rust, but otherwise I'd be all over just writing it in Python or Ruby.
- steveklabnik 10y agoInteresting, I did not know this.
- inferiorhuman 10y agoRelevant links: https://users.rust-lang.org/t/bufreader-100x-slower-than-python-am-i-doing-something-wrong/1426 https://users.rust-lang.org/t/bufreader-100x-slower-than-pyt... http://codereview.stackexchange.com/questions/73753/how-can-i-find-out-why-this-rust-program-to-echo-lines-from-stdin-is-slow http://codereview.stackexchange.com/questions/73753/how-can-...