Rust's 2017 roadmap, six months in
blog.rust-lang.org
blog.rust-lang.org
For example, Taking a random piece of code from the Rust Book
let buffer: &mut [i32];
let coefficients: [i64; 12];
let qlp_shift: i16;
for i in 12..buffer.len() {
let prediction = coefficients.iter()
.zip(&buffer[i - 12..i])
.map(|(&c, &s)| c * s as i64)
.sum::<i64>() >> qlp_shift;
let delta = buffer[i];
buffer[i] = prediction as i32 + delta;
}
How would one break part of this into a function fn get_part ??? What might go here ???
let buffer: &mut [i32];
let coefficients: [i64; 12];
let qlp_shift: i16;
for i in 12..buffer.len() {
let prediction = get_part(&coefficients,&buffer,i)
.map(|(&c, &s)| c * s as i64)
.sum::<i64>() >> qlp_shift;
let delta = buffer[i];
buffer[i] = prediction as i32 + delta;
}
[Exercise for the reader] I'm not sure If I could write the code to do this without taking a few wrong turns. return SOME_EXRPRESSION;
and then look at the compiler error. Another way is let () = SOME_EXPRESSION;
which works as long as SOME_EXPRESSION is not of type (), but if it compiles, well, you know the type :)Another way is to use some sort of IDE integration that gives you "show me the type on hover".
That is how I check such types outside IDEs in other ML derived languages.
let _ : () = /* some expr whose type you don't know */
And compile it. It will quickly fail with a type error, giving you the full type of the expression.However, this will get better with the introduction of "impl Trait", where the return type will become `impl Iterator<Item = (i64, &[i32])>` which while admittedly long is better than what you'd have otherwise. It's definitely a known pain point.
In practice writing Rust code (full time!) I don't encounter this issue much because I rarely want to split an iterator chain across multiple functions, and iterators are the main place the types get long and hairy. Although I've heard it's really bad with Futures, but that's why "impl Trait" is coming.
let x = vec![1]
x.<no completion>
Even if they special cased vec! or all the std macros, it'd be a good on-ramp improvement. But I thought RLS was supposed to step in where Racer can't handle things - is that not the case for macro support?Right now, it's exactly what you said. RLS is still an extremely active project, and so are the compiler internals it relies on, so it's going to gain features in the future. I'm not aware of any specific plans to exclude macros, but it's not my area of specialty.
Interesting; I view that as a bit more than a "basic" snippet for autocompletion to handle, although that's mostly a few facto interpretation because it's one of the few things that no Rust autocompletion engine I've tried (racer, RLS, or Intellij's plugin) has been able to handle. For pretty much everything else I've tried, at least one of them has been able it.
But it looks stalled. Not sure if anyone is working on such bindings today.
UPDATE: I just found this which looks active: https://github.com/rust-qt/cpp_to_rust
And many other static langs (i.e. not-python) have issues with their Qt bindings (e.g. Go [3] which can't compile via MSVC which some things like the QtWebEngine stuff need). Sadly, for advanced UI (e.g. complex tree views, docking, etc) that is cross platform and looks native, Qt is all there is, and it's reliance on C++ makes it a bit tough to use across languages. A maintained C iface for Qt is really needed.
0 - https://github.com/rust-qt/cpp_to_rust/issues/53
1 - https://github.com/cretz/rust-qt_cef_poc
[0] https://www.reddit.com/r/rust/comments/6l5c94/can_we_crowdfu... [1] https://flutter.io/ [2] https://github.com/servo/webrender
If you are okay to use qt out of the box, there are a few bindings. But you won't be able to customise it like you would with actual qt.
Also the devs no longer consider it a cross platform library, everyone using it as one is stuck on GTK2.
There's support for Windows native file dialogs since 3.20.
https://blogs.gnome.org/alexl/2015/11/05/native-file-chooser...
1. Gtk constantly clobbers the middle-click clipboard on Linux. In non-gtk programs that's one of my most efficient ways of entering and editing text.
2. Gtk completion dropdowns steal clicks, so typing into a field with completions (that I don't want) with an onscreen keyboard takes at least twice as many button presses as it should.
I have no such problems with Qt (or anything else).
[1] https://users.rust-lang.org/t/current-state-of-gui-developme...
They use it for systems software and backend services.
Thanks for choosing a publisher that supplies DRM-free eBooks ;)
and there's "pythonium trioxide", but I've gotten the impression that its more of an exploratory project: https://github.com/PyO3/PyO3
The extension-module feature might give you what you want
[0]: https://internals.rust-lang.org/t/crates-io-package-policies...
https://twitter.com/jdalton/status/869964222716821504
(continued) https://twitter.com/littlecalculist/status/87035656004781670...