Skip to main content

Questions tagged [rust]

For questions about design of, or languages which are closely related to, Rust, a strongly-typed, memory-safe, expression-oriented language.

-2 votes
2 answers
267 views

CUDA excels at parallel programming, but is primarily marketed for programming languages that have certain disadvantages compared to Rust, for example in terms of safety (C, C++) or speed (Python). ...
root's user avatar
  • 97
5 votes
3 answers
1k views

I am investigating ways to add some form of abstract data types to a toy language. I was reading Graydon Hoare's The Rust I Wanted Had No Future, in which he talks about existential types. I have not ...
Jonas's user avatar
  • 715
7 votes
0 answers
372 views

What programming languages provide significant static guarantees about race conditions (with respect to memory safety), and what guarantees do they provide? I am aware that Rust provides some ...
apropos's user avatar
  • 1,295
14 votes
2 answers
1k views

In Rust, the Drop trait is defined like this: trait Drop { fn drop(&mut self); } This has a number of issues: If you ...
mousetail's user avatar
  • 9,627
11 votes
5 answers
960 views

In the C++ community, there is a well know compilation cascade problem, that can be solved with the pimpl ideom https://herbsutter.com/gotw/_100/ Here's the problem: If you nest structs (with each ...
Tom Huntington's user avatar
3 votes
2 answers
455 views

Awhile back I wrote a Rust implementation of the Monkey programming language by Thorsten Ball (https://monkeylang.org/). When I got done with it I was a bit surprised that I never used an Arc/Rc ...
lamont's user avatar
  • 139
1 vote
1 answer
203 views

In Rust: #[derive(Display)] struct Foo<T>(T); If T conforms to the Display trait, ...
Jw C's user avatar
  • 243
39 votes
2 answers
24k views

Chapter 1 of "The Rust Programming Language" (Klabnik and Nichols) says: [S]ome common Rust packages depend on C code and will need a C compiler. Why do Rust packages have any dependency ...
StoneThrow's user avatar
13 votes
1 answer
2k views

I implemented a basic generics-free, parameterless trait (type class) system. And I want to parameterize my trait system. The alternative paths I know of are Generic Associated Types (GAT) and Higher-...
Aster's user avatar
  • 3,508
14 votes
1 answer
1k views

This is an example for the use of Rust's macro_rules!: ...
ceving's user avatar
  • 376
9 votes
1 answer
801 views

Rust's macros require them to be delimited by either parentheses, braces, or brackets, such as println!(arg) or foo! { bar, baz }...
Seggan's user avatar
  • 3,412
31 votes
3 answers
13k views

Why did the designers of the Rust programming language require that macro names have to end with an exclamation point? I observe that both Common Lisp and Emacs Lisp language variants do not appear, ...
bgoodr's user avatar
  • 413
8 votes
4 answers
5k views

I am new to language development. I am aware of Rust's ownership model that builds programs in a way that does not need garbage collection. So if I am to build a new programming language using safe ...
M4X_'s user avatar
  • 191
21 votes
4 answers
9k views

Okay, so this might be a silly question. I'm a big fan of functional programming paradigms in higher-level scripting languages, so I'm probably using Rust wrong. However, I'm new to Rust and I'm ...
Philip Grabenhorst's user avatar
3 votes
1 answer
364 views

In programming languages like Rust, variables of different types that implement the same trait can have different sizes, i.e., the number of bytes used in the memory representation of the type. For ...
Jw C's user avatar
  • 243

15 30 50 per page