Skip to main content

Questions tagged [rust]

Rust is a systems programming language focused on three goals: safety, speed, and concurrency. It maintains these goals without needing a garbage collector, making it a useful language for a number of use cases other languages aren't good at: embedding in other languages, programs with specific space and time requirements, and writing low-level code, like device drivers and operating systems.

Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

I've been looking on how to use Builder pattern on rust with structs, but all examples I've seen only use primitive data. Given the structs: ...
user31872722's user avatar
8 votes
1 answer
372 views

I wrote a toy s-expression parser, and I'd like to know if I can make it more Rusty. I'm not terribly worried about the functionality. It's only a Rust exercise for me. ...
adrianton3's user avatar
1 vote
0 answers
50 views

I'm new to Rust and trying to build an async Server. The server should receive UDP packets, process them (which will include more network communication), and respond the result to the client. I had ...
x539's user avatar
  • 201
6 votes
3 answers
454 views

Background I'm trying to write a helper function for constructing repeating strings with a separator. ...
Felix ZY's user avatar
  • 183
7 votes
1 answer
240 views

I had semi-recently asked a question (well a couple closely related questions) on math.stackexchange. The simplest question is phrased as follows: You are allowed to make 3 permutations of length n. ...
Dair's user avatar
  • 6,220
4 votes
1 answer
138 views

Also posted on Reddit. As a small personal exercise, I'm trying to implement a notion of higher-kinded types in Rust using type-level defunctionalisation based on the "Lightweight higher-kinded ...
nicoty's user avatar
  • 329
1 vote
2 answers
152 views

I have a function in an embedded system which translates an image encoded in a 32-bit integer to 3x9 matrix (an array of arrays): ...
Simson's user avatar
  • 337
1 vote
1 answer
117 views

I'm converting a library from C to Rust, and I want to see if this is the optimal way to implement network communication. This ...
Jonathon Anderson's user avatar
5 votes
1 answer
138 views

This is my first Rust project (I'm primarily a C guy). I want to know if my code is properly idiomatic (Rusty?). Also, are there any inefficiencies? The code defines an iterator (...
Daniel Walker's user avatar
2 votes
0 answers
102 views

I'm implementing a Monte-Carlo pricing engine to price a structured product in Rust, using the usual Black-Scholes assumptions. This pricing engine is used in a (basic) gRPC server which receives all ...
Exercise To The Reader's user avatar
1 vote
1 answer
85 views

Needleman-Wunsch is a bioinformatics algorithm used to align 2 sequences. The algorithm outputs the score of the alignment and a Vec containing all operations to reconstruct the alignment. I do not ...
RomainL.'s user avatar
  • 314
5 votes
2 answers
427 views

I'm starting to learn rust and figured my first simple project would be to solve some of the Euler problems. I'd appreciate if anyone could tell me where I might be ...
zephyr's user avatar
  • 223
4 votes
2 answers
240 views

I've implemented this version of the Sieve of Eratosthenes in Rust, with inputs. I'm mostly pleased with it, but want to know if the input logic can be simplified, and if the sieve itself can be ...
Vessel's user avatar
  • 345
4 votes
1 answer
118 views

Here is the solution to the LeetCode Sliding Puzzle Problem #773. The problem is to find the shortest solution for a 3 x 2 sliding puzzle. I would appreciate any ideas to improve this code. But it's ...
Eugene Krokhalev's user avatar
3 votes
0 answers
116 views

I am working on a small MIDI router application for the Jack audio connection kit in Rust. The goal of the application is to route MIDI signals from an instrument to one or multiple applications in ...
Green 绿色's user avatar
5 votes
2 answers
159 views

I'm learning Rust and I'd like advice on how to make my code more idiomatic. I have a set of entries that are colon separated string-number pairs, a name and a size, like so: ...
Carcophan's user avatar
  • 153
7 votes
2 answers
1k views

I'm writing a Rust program that finds the "first five cubes that can be written as the sum of three distinct nonzero cubes", e.g. 216 = 6^3 = 3^3 + 4^3 + 5^3. The function looks like this: <...
Vessel's user avatar
  • 345
1 vote
1 answer
39 views

I needed a very basic hybrid linear clock implementation for a project implementing MVCC. It gives me a perfectly incrementing clock that I can use to compare timestamps that can handle high load ...
Sienna's user avatar
  • 463
6 votes
1 answer
104 views

To learn about Rust and parsing, I wrote a simple calculator that can solve problems involving the four basic operations (+, -, *, /) as well as exponentiation. For the sake of simplicity and ...
Arbel Groshaus's user avatar
4 votes
1 answer
182 views

I've been trying to learn Rust by working through Advent of Code 2023, specifically for day 7, part 1, here. It's Poker Lite: You're given a list of hands. The input is formatted as ...
roganjosh's user avatar
  • 143
3 votes
1 answer
132 views

I am implementing authentication with the Spotify web API as part of a larger project. Yes I know there are already crates that can handle it for me but that is no fun. I am implementing the auth code ...
flakpm's user avatar
  • 77
1 vote
2 answers
127 views

Following is my rust function to convert uppercase to titlecase (without removing the underscore). although I am able to achieve my goal but I don't think this is a good solution. Ignoring the nested ...
AashishKSahu's user avatar
6 votes
2 answers
333 views

I have a very hot segment of code in a large project. I've extracted the relevant segment and a toy example to illustrate it. The project involves an unavoidable combinatorial explosion related to ...
Dave's user avatar
  • 163
4 votes
1 answer
418 views

I want to know how would I go about architecting an MVC architecture using actix-web. I have a user_service which requires ...
xzeck's user avatar
  • 43
3 votes
1 answer
62 views

I need to benchmark the different code generations of a generic function in rust, for different type parameters. I ran upon this when developing differential equation solvers using ...
LudvigH's user avatar
  • 131

1
2 3 4 5
18