These are chat archives for rust-lang/rust

2nd
Aug 2017
Joonas Koivunen
@koivunej
Aug 02 2017 08:27 UTC
has anyone tested the latest nightly 2017-08-02 compiler? http://perf.rust-lang.org/ values look quite ... off-the-chart
Sherab Giovannini
@Shaddy
Aug 02 2017 08:28 UTC
WOW
Joonas Koivunen
@koivunej
Aug 02 2017 08:28 UTC
ah, the actual values are 0s (looking at the graphs) so probably there is some failure to compile anything :)
Sherab Giovannini
@Shaddy
Aug 02 2017 08:36 UTC
yep, it sounds like a llvm problem
it went from 20 to 0, also the translation
StelarCF
@StelarCF
Aug 02 2017 11:17 UTC
I keep getting this sort of error: error: failed to link or copy F:\Project\gfxtest\target\debug\build\gfx_gl-6eeea120d873f351\build_script_build-6eeea120 d873f351.exe to F:\Project\gfxtest\target\debug\build\gfx_gl-6eeea120d873f351\build-script-build.exe
am on Windows, rust nightly-msvc
apparently doesn't happen on stable, but I can't figure out why...
David Harvey-Macaulay
@alteous
Aug 02 2017 11:23 UTC
@koivunej This is exciting news!
Sherab Giovannini
@Shaddy
Aug 02 2017 17:03 UTC
is there any way to zip 3 iterators?
Max Frai
@max-frai
Aug 02 2017 17:03 UTC
iter1.zip(iter2).zip(iter3)
Sherab Giovannini
@Shaddy
Aug 02 2017 17:03 UTC
sorry, didnt write the entire question xd
if I do that, I get ((a, b), c)
ok. I answer myself:
println!("{:?}", (0..10).zip(0..20).zip(0..20)
                        .filter(| &zipped | ((zipped.0).0 + (zipped.0).1 + zipped.1) % 3 == 0)
                        .collect::<Vec<_>>())
I was trying to chain zip's but didn't realize that I have to point tuples like this ^
ty!
stevensonmt
@stevensonmt
Aug 02 2017 17:07 UTC
@Shaddy Might also take a look here
Sherab Giovannini
@Shaddy
Aug 02 2017 17:10 UTC
thanks!
toidiu
@toidiu
Aug 02 2017 17:23 UTC
I am a bit confused as to the relationships between tokio::Core, tokio::Handle, cpu-pool. From what I have read they all deal with multi-threading but my confusion is around what is the preferred way to work with threads.
In my stack I am using tokio, hyper, futures to achieve an async server. So if someone could also address the above question with respect to( async network)(hyper i think) and (async computation/io)(cpuPool i think)
matrixbot
@matrixbot
Aug 02 2017 18:34 UTC
Zanny tokio-core is an event loop for io, doesnt use threads (yet), cpu-pool is for async jobs that arent using tokio io primitives, and can be threaded
Zanny if you want to use both write cpu-bound tasks as async and run them on the cpu-pool while io is done on the tokio core
Neverminder
@Neverminder
Aug 02 2017 19:28 UTC
Does Rust tuple have a size limit? For instance, Scala's tuple is limited to 22 elements.
toidiu
@toidiu
Aug 02 2017 19:34 UTC
@matrixbot thanks for that clarification. The confusion started because the futures crate is listed as part of tokio https://tokio.rs/docs/getting-started/tokio/
Could someone also explaine when one would use the Handle?
stevensonmt
@stevensonmt
Aug 02 2017 19:48 UTC

@Neverminder , from the multizip documentation the the link provided by @bwasty above:

Rust supports an unlimited number of variables in a single tuple. However, all useful traits in the std crate are only implemented for up to 12 elements;

matrixbot
@matrixbot
Aug 02 2017 20:31 UTC
Zanny toidiu (Gitter):
Zanny tokio uses futures for the types, cpupool is an event loop like tokio-core, you use the handle to reference the loop (it isn't send, so its always thread local) and you execute asyncs on the handle given
toidiu
@toidiu
Aug 02 2017 20:55 UTC
thank you