Rust compiler/libraries are outdated

Could you please upgrade the rust compiler to the last version (1.33.0) and enable edition = “2018”? It’s easier to code in rust since NLL: https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html#non-lexical-lifetimes

time crate: no longer actively maintained, see https://github.com/rust-lang-deprecated/time. The author recommends using the chrono crate instead.

rand crate: a lot of work was done since 5.4, see https://github.com/rust-random/rand/blob/master/CHANGELOG.md

Compared to other languages (at least python and c++), we have not regex, could you please add the regex crate?

Maybe add lazy_static as suggested by https://www.codingame.com/forum/t/cannot-use-lazy-static-in-rust/87205

Thanks

3 Likes

Hi,

We will deploy 1.33.0 soon.

Our current compilation command line is (excluding --extern flags):

/usr/local/bin/rustc -O /tmp/Answers.rs -o /tmp/Answer

Please let us know how it should be changed (cannot find the “edition” flag in the current doc : https://www.mankier.com/1/rustc).

Regarding crates, when adding the new rand version, multiple versions of rand_core end up in the target directory. Not sure how that works and what to add to the rustc command line in that case… There are even dependencies from rand_core 0.3.1 to rand_core 0.4 (what? how can this work?). So will have to try a few things before we can update the rand crate.

Note: We are not using Cargo when building. I guess the edition=2018 specified in Cargo.toml is somehow transmitted to rustc but I could not find the equivalent command line.

Thanks,

1 Like

:grinning:

you can use cargo in verbose mode: cargo build -v
give me: rustc --edition=2018 --crate-name hello_2018 src/main.rs --color always --crate-type bin…

which makes things difficult :confused:

Note: do not forget to replace in your templates, trim_right() by trim_end().

cargo tree:
hello_2018 v0.1.0 (/var/home/mpardo/hello_2018)
└── rand v0.6.5
├── libc v0.2.50
├── rand_chacha v0.1.1
│ └── rand_core v0.3.1
│ └── rand_core v0.4.0

rand_chacha depend on rand_core 0.3.1 but I think it was a mistake. rand_chacha was publish on crate.io before upgrading his dependencies:

-rand_chacha to 0.1.1, sha1: rand_isaac-0.1.1-55-g04b780c40d, 2019-01-03
-publish on crate.io, 2019-01-04:
-rand_chacha, rust_core dependency update to 0.4, sha1: 0.6.4-38-g67c856bfe9, 2019-01-23
-not published

and

rand_core 0.3.1 really depends on rand_core 0.4: crate.io and github, which is strange

Rust updated and libraries updated as well. Check https://www.codingame.com/faq

3 Likes

It’s a huge update. Thanks again.

Hello!
There have been 7 stable Rust releases since 1.33 (including in particular stabilization of many apis and a great upgrade upgrade for HashMap).
It might be time for an upgrade if not too time-consuming! :slightly_smiling_face:

Also, crossbeam/crossbeam_channel and rayon crates are basics of parallelism in Rust and would be great additions to those that are already there. (BTW, thank you so much for already adding itertools! <3)

We get language updates about twice a year.

So, if Rust has new features, they will be available on CodinGame too - together with updates of other languages.
You won’t get much benefit from multithreading here, as your code is run on a single physical core anyways.

1 Like

Rust is upgraded to 1.38.

1 Like