8 ms·
Rust continues to shape up as a real C++ competitor. And C++ certainly needs some competition. It is way too lonely in its domain. I hope the next version of R
by copx 13y ago
Rust continues to shape up as a real C++ competitor. And C++ certainly needs some competition. It is way too lonely in its domain.
I hope the next version of Rust will have a proper Windows package, though. I don't understand why they don't bundle the version of MinGW they depend on. I was pretty disappointed to be greeted by missing DLL errors after running Rust's Windows installer.
There are countless MinGW builds, with different thread libraries, exception models, etc. I guess when they say "MinGW" they mean the binaries from the original MinGW project. However those get updated all the time. Thus the packages the MinGW installer would download today might not be compatible with the Rust 0.6 binaries which were build some time ago .. probably with a different version of said packages. Thus they should really release a complete package.
Even if there is no compatibility issue, it is just bad policy. I actually program C/C++ on Windows AND have a MinGW build on my machine.. but not the one Rust needs. Which is common because other builds are much more up to date and full-featured than those from the original MinGW project. And I really didn't feel like doing an additional MinGW installation just to play around a little with Rust.
- Ygg2 13y agoI asked a similar question on the IRC and got the answer that they are aiming for Microsoft C compiler so it would work with natively with system as much as possible. MinGW has some slight issues when launching application IIRC.
- copx 13y agoBy the way, why does Rust need a C compiler anyway? I admit I am ignorant here because I never cared. I know that many academic/niche programming languages bundle MinGW/depend on a MinGW or even Cygwin installation.. I always assumed that was to cut some corners. I mean, I have used multiple programming languages on Windows which compile to native code and have no dependency on a C compiler.
- Ygg2 13y agoSo it (Firefox with Servo) would work on Windows as close to native as possible? It would be funny to start Firefox and have a console windows poping in/out of existence or some other visual quirk.
- tmzt 13y agoI believe the reason in the past was due to C++ implemented NPAPI plugins like Flash. Only MSVC builds of Mozilla/Firefox were officially supported.
- steveklabnik 13y ago> By the way, why does Rust need a C compiler anyway? I'm not 100% sure, but I do know that zero.rs requires 'the following libc functions: malloc, free, abort, memcpy, and memcmp'. So I'd imagine it's that.
- pjmlp 13y agoThose functions could be easily done via syscalls to the underlying OS or simple Assembly routines, as they are quite simple to implement. I have not yet looked at Rust's code, but I guess it is required for some bootstrapping code.
- njs12345 13y agoI think malloc/free at least are certainly far from simple to implement..
- pjmlp 13y agoSimple does not mean easy.
- zxcdw 13y agoWhat's the definition of "hard to implement" if not complexity?
- pjmlp 13y agoIf you are targeting an existing OS, malloc/free can be simple wrappers to OS syscalls for memory allocation. Not very efficient, but pretty straightforward to implement. If targeting direct hardware, any CS student should have learned how to implement a memory allocator on their compiler design, data structures or OS classes. Back when I graduated, this would be a home work exercise. If you want to implement a high performance memory allocator that works under pressure in a multi-core context, then yes it is complex to implement. Now something that allocates/releases memory with a general purpose algorithm? That is quite simple and many compiler design books even provide such examples.
- pjmlp 13y ago> By the way, why does Rust need a C compiler anyway? Bootstrapping.
- eridius 13y agoRust bootstraps by downloading an existing snapshot of the rust compiler, which it then uses to build the stage0 rust compiler, which then builds the stage1 rust compiler, which then builds the stage2 rust compiler.