Announcing Rust 1.10
blog.rust-lang.org
blog.rust-lang.org
Unfortunately, last time I checked development (on issues blocking the initial stable release) seemed to have slowed as of late, but I should be helping out instead of whining - the Rust community is doing great work!
RustConf (Sep 9-10, Portland): http://rustconf.com/
RustFest (Sep 17-18, Berlin): http://www.rustfest.eu/
Rust Belt Rust (Oct 27-28, Pittsburgh): http://www.rust-belt-rust.com/
Tongue-in-cheek, it's very exciting that distros will now have an easier time patching Rust and producing bugs like this one:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.2/+bug/25679...
In the last comment [1] on the bug, it's mentioned the release in which the fix was released. From its page [2] you can see all the details of it, including its diffs.
[1] https://bugs.launchpad.net/ubuntu/+source/gcc-4.2/+bug/25679...
[2] https://launchpad.net/ubuntu/+source/gcc-4.2/4.2.4-1ubuntu3
+ * Fixes included in the 4.2.4 upstream release (compared to 4.2.3-3ubuntu7):
+ - Fix LP: #256797, wrong-code on ia32, taken from the gcc-4_2-branch.
Which makes it sound like the problem was in GCC, not the Ubuntu package. I was under the impression that the bug was caused by an Ubuntu-specific patch, from dikaiosune's comment. Am I missing something?Edit: Ah, so the fix was added in 4.2.4-1ubuntu1, not 4.2.4-1ubuntu3. Which narrows the actual source changes to something inside this other 500KB patch[1]. From here I looked at the upstream changes using GitHub compare[2] (warning, big page). I ran a one liner in the JS console to expand all the "…" buttons next to the commit messages so I could search for relevant text, which lead me to this commit[3], which seems to be the actual code changes to fix that particular bug. That finally lead me to the bug in GCC's bug tracker[4].
I don't know if I have just been very lucky with the open source projects I've collaborated with, but this journey to find where a bug was actually fixed seems completely insane to me. Is all this info passed down from maintainer to maintainer just via folklore? Crazy.
Oh, I almost forgot about what I actually wanted to know. This looks like a GCC bug that wasn't caused by Ubuntu specific patches, so I don't know what dikaiosune wanted to say.
[0] https://launchpadlibrarian.net/18364478/gcc-4.2_4.2.4-1ubunt...
[1] https://launchpadlibrarian.net/17472542/gcc-4.2_4.2.3-2ubunt...
[2] https://github.com/gcc-mirror/gcc/compare/gcc-4_2_3-release....
[3] https://github.com/gcc-mirror/gcc/commit/80cacf54c3d410d5552...
#include <stdio.h>
int main (void)
{
signed char one = 1;
unsigned char coerced_to_positive_255 = -1;
printf ("%d\n", one > coerced_to_positive_255);
return 0;
}Incremental compilation has been worked on while MIR development was happening, so it won't start, it's already in-progress. :)
With MIR, yes, the idea is that compile time should improve. One of those tracking bugs is to make sure that it doesn't regress before turning it on by default.
With incremental compilation, you should see compiles after the first improve; you'll need to compile a lot less code for each change. Right now, the entire crate is recompiled, but afterwards, just the portion that changed will need to be.
https://github.com/rust-lang/rfcs/blob/master/text/1298-incr...
AFAICT, the idea is to track and hash items like function signatures and bodies, map them to the object files produced by LLVM, and to recompile them when the hashes change.
(Note also that MIR should generate somewhat faster debug binaries than current trans (by virtue of doing "obvious" optimizations in the frontend, rather than asking LLVM to chew on it), so if there are people out there who currently make release builds during development because their debug builds are too doggone slow, then this should help alleviate that.)
Out of curiosity, do you want general syntax extensions, or is it stuff like Serde/Diesel, specifically?
Code generators/source maps: https://github.com/rust-lang/rfcs/pull/1573
Procedural macros: https://github.com/rust-lang/rfcs/pull/1566
(also the reference links in the readme are broken, eg. http://serde-rs.github.io/serde/serde/serde/ser/trait.Serial... - seems like one too many /serde)
I have an as-yet-unpublished crate that takes a JSON API spec and generates an API client for it (in rust) at compile time using this method.
In a way, Serde itself is all about extracting the metadata of a type and handling validation issues. However this is metadata is currently not exposed to end users. It's something I've thought about doing, but I haven't had a driving use case to help come up with a proper API for it. I don't think it'd be that hard to implement once we actually have a clear idea on what we want.
The code Serde generates though typically optimizes down into nearly the same code as a hand written serializer and deserializer. On my laptop, serde_json [1] serializes a particular micro-benchmark [2] that serializes as fast as a hand rolled serializer (416MB/s vs 414MB/s). In comparison, rapidjson serializes the same structure in 432MB/s. I didn't write a hand written deserializer, but serde_json is comparable to rapidjson (193MB/s vs 182MB/s).
So it may be fast enough that you might be able to just implement whatever you want by just using Serde directly without having to generate parsers.
[1]: https://github.com/serde-rs/json
[2]: https://github.com/serde-rs/json/blob/master/json_tests/benc...
[3]: https://github.com/erickt/rust-serialization-benchmarks/tree...
You want to go statically link your internal rust binary that you are pushing out to hundreds or thousands of nodes and you need the extra performance? Go for it, you can handle rebuilding it every time there is a security update (and last I checked dylib's allow both static and dynamic linking against them, so you have that option). But if you want to include your binary in a distribution package repository it really should be dynamically linked, tracking what dependencies everything has and forcing rebuilds and updates for EVERY SINGLE BINARY that uses them is wasteful and a pain to manage.
[1] https://fedoraproject.org/wiki/PackagingDrafts/Go#Security_i...
I can't say anything about the build tooling other releases use (I only have real experience with Koji and a limited look at OpenSUSE's OBS), but I don't think (m)any support "rebuild all that depends on this package" without manual intervention. It's really a crappy situation to be put in by language designers who value their use case over all else, and while, again, I think static linking can have a place it really doesn't belong in distribution repositories if it can be helped.
To elaborate on the parent's example: a particularly bad bug in a library depended on by a set of programs might not cause much of problem if you build and deploy this software yourself.
However, it would be a more significant endeavor on both the distribution's part (recompile, repackage, sign-off, and release every program in the set), and on the user's part who has to download the large binaries each time a dependency is updated rather than a small library. This problem is further exacerbated by the npm-like dependency graphs rust programs tend to end up with. Take servo as an extreme example of what these graphs might look like: https://web.archive.org/web/20160703132700/https://dirkjan.o...
Furthermore, I don't see how dynamic linking prevents the compiler from optimizing the resulting binaries. C libraries have been dynamically linked for decades without issue.
Updates in Fedora sit in updates-testing for a week unless the package gets enough karma from users testing the package, there's a fast track for certain security updates but having to push dozens of packages that depend on a library through this is a giant pain and causes a huge headache. With dynamic libraries we can just update the library, get it through the testing phase (and if necessary fast track a single update) and move on with life.
As far as the GP's point about optimization, rustc can inline a lot of code from linked crates if you are compiling statically, which in tight loops can be a very useful performance optimization due to not needing to spend cycles on setting up a new stack frame and calling the function. However, like you say, applications written in C/C++ have used dynamic linking for ages and it is usually quite rare to need optimizations this deep - if YOU need them for your application please feel free, but in general dynamic linking should still be preferred.
Someone is welcome to try, feel free to open a thread on the fedora-devel mailing list and see what anyone else thinks. But even if rustup doesn't make it into the official repos I don't see why someone couldn't put it up on COPR.
Debian specifically provides it's own alternatives system to handle symlinks in a global manner, but nothing for directory-specific ones. I'm not sure about Fedora. With `rustup` replacing `multirust`, it would be useful to point to a common command that in turn would call the distro-provided facility for global links.
Also, congratulations on 1.10! Looking forward to servo.apk in the coming weeks as well.
So, does that mean that Rust (has/will have) issues regarding binary blobs in pure free software Linux distributions?
All versions of the Rust compiler are open-source and have publicly-available source code, so they aren't binary blobs.
"Binary blob" in the context of free software is generally a blob which does not have open code behind it. This is not the case with Rust or GCC, the bootstrapping binary can be obtained -- in theory from a long chain of sources, in practice by compiling the source from a previous bootstrapping binary.
There is a trusting trust issue here, of course.
In case anyone doesn't know, this is referencing a famous paper:
https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thomp...
Some further discussion: https://www.schneier.com/blog/archives/2006/01/countering_tr...
I actually use Rust in production, and have generally found it very good - compared to the well discussed difficulties with CPP. I will continue to do so, but I think that the edges really need covering off properly before it'll be treated as a serious competitor to CPP (and equally often, Go).
On top of that you have to type System.exit all the time, which is quite annoying
I like the way how Nim handles the bootstrap. It's always easy, and it also eases ports to other platforms significantly since everthing is coded in C.
> Are there any plans to support bootstrap from source?
The source code is fully available, so we are/have "bootstrapped from source", it's just much more convenient to not do it yourself.We don't have any more significant plans to change things in the near future.
Until Servo stops using nightly features (which may not be ever, given that they are part of how we test new features!), they'll need to stick with a nightly build. We made an exception for the compiler when compiling itself, but won't make any more.
Very nice to see the push for relying only on stable releases while building Rust.