Looking for questions to add to the Rust FAQ


#1

Hi everyone!

The official Rust FAQ needs some love. It hasn’t seen any serious updates since it initially launched, and it doesn’t cover a variety of areas that it should.

So, just like when the FAQ was first being worked on, we’re looking for suggestions for questions that should be added!

There are a few areas in the current FAQ that are definitely light on content. Questions in these are appreciated.

  • Design Patterns
  • Libraries
  • Cross-Platform
  • Low-Level
  • Debugging and Tooling
  • Macros
  • Concurrency
  • Modules and Crates
  • Documentation

Additionally, there are some areas where questions definitely need to be updated. If you have particular issues / concerns in these areas, please share!

  • Higher-kinded types / Associated-type constructors
  • Doing object-oriented programming in Rust
  • How to do asynchronous I/O in Rust

Of course, any feedback is appreciated! What questions are on your minds?


#2

I think design patterns on interior mutability, when to use Ref/Cell/Box and how to deal in cases when we need interior mutability (for instance often comes in when you need to modify a graph within a graph method etc…) and guidelines on this kind of a bit more challenging situation for wrestling Rust’s borrow checker would be nice to have.


#3

Android Studio / NDK integration : I’d love to convert my C++ NDK library embedded in my Java Android project to Rust, but the tooling is so obtuse that I am sticking with C++.


#4

@QuadDamaged

You can look at https://github.com/Dushistov/rust_swig/tree/master/android-example as example of project that uses ndk + jni + rust + java.


#5

With regards to async I/O, “How do I asynchronously load a file from disk?”. Every few months I head to Google with that question. So far, the only answer has been “Spawn a thread to do it”, but I’ve had to dig around in forum posts and Reddit threads to get confirmation that nobody has put together a crate for doing async file I/O in a platform-independent manner.


#6

I am a new user here, i would like to know what is the current state of Rust on the windows platform. Both in the development and compilation.

I do not know Rust enough but i think this is a valid question that should be on the FAQ.


#7

Educated guess: The reason why we don’t have a cross-platform asynchronous file I/O abstraction is likely that some major target platforms (such as Linux) don’t provide a decent interface for asynchronous disk I/O to begin with.


#8

Thanks for all the questions, everyone!

@HadrienG, just a correction: Rust does have a pretty standard cross platform async IO library on which any other async IO lib you find is generally based. It’s called mio: https://github.com/carllerche/mio


#9

Sorry for not expressing myself clearly enough. I was referring to disk IO here, not IO in a general sense or networked IO in particular.

Most popular operating systems have good abstractions for asynchronous network IO, which is why crates like mio can exist. But fewer operating systems have usable (i.e. feature-complete, efficient and bug-free) asynchronous disk IO, which is likely why the later is explicitly marked as falling out of mio’s scope in the README.


#10

Yeah, I’ve seen that explanation come up before. If there’s a genuine reason why Rust can’t have platform independent async file I/O, then that would be especially good to mention in an FAQ.


#11

Thinking about it, this might be better addressed by the cookbook than the FAQ. I keep forgetting that the cookbook is (or will be) a thing.


#12

@excaliburHisSheath The cookbook is very much a thing (a pre alpha in progress but a thing nonetheless ;)) . If you have an idea that you can formulate you can comment on async io issue in our repo :slight_smile:


#13

Use or not use inline attribute for one line functions?


#14

I’d hope that the compiler does inline it spontaneously, and only add explicit inline directives if it doesn’t do so and that turns out to be a performance problem.


#15

It would be good to have some coverage of deref coercions. More generally, I think it would be good to cover a bunch of the standard traits, what they are meant for, and how to the standard library uses them.


#16

You might find some good candidates among the most viewed #help topics: