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: Redirect

time crate: no longer actively maintained, see GitHub - time-rs/time: Date and time handling in Rust.. The author recommends using the chrono crate instead.

rand crate: a lot of work was done since 5.4, see rand/CHANGELOG.md at master · rust-random/rand · GitHub

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 Coding Games and Programming Challenges to Code Better

Thanks

4 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

I see that Rust has been also upgraded to 1.90, I am grateful for that!
However, the 3rd party crates that were available earlier and listed in the FAQ seem to be now missing (chrono 0.4.26, itertools 0.11.0, libc 0.2.147,rand 0.8.5, regex 1.8.4, time 0.3.22).

When fixing this, please

  • re-add them with their latest version (rand 0.9.2, itertools 0.14, regex 1.11)
  • also add rust_bigint 0.4 crate (or something similar)
  • please use “edition 2024”
    Thanks in advance!
1 Like
error: extern location for rand does not exist: /opt/coderunner/rust/target/release/deps/librand-7dd91c178db20651.rlib
 --> /tmp/answer.rs:9:5
  |
9 | use rand::{rngs::*, Rng, SeedableRng}; 
  |     ^^^^

I get this error to day at 8 pm, this morning (10 am) it was correct !

Thank you to fix it !

Best regards

Papyjo

The external crates are now fixed, they are the same as before (for now) but with up to date versions. Also edition 2024 has been added.

4 Likes

There are some breaking changes in that rand upgrade - Updating to 0.9 - The Rust Rand Book is a good guide for anyone still having compilation errors.