Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Measter
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
211.
▲
by
Measter
6y ago
One thing that may help with the glue-code aspect would be a crate like pyo3[0], which can generate a lot of the details for you. [0] https://crates.io/crates/pyo3
212.
▲
by
Measter
6y ago
The problem with having the compiler figure it out is that the signature now becomes dependent on implementation details that can't be seen from the signature, and could be accidentally changed. This information must be an explicit par
213.
▲
by
Measter
6y ago
I would pick Rust if I had the choice and libraries were available. Personally, I've found that the borrow checker for the most part doesn't get in the way. But part of the reason for that is because I've used Rust enough to
214.
▲
by
Measter
6y ago
That's an API choice. There's no technical reason at all why you couldn't return some kind of error AND read data if you wanted, you'd just have to make your Error type a product type.
215.
▲
by
Measter
6y ago
Typically in an edit/compile cycle you'd only compile your dependencies once for each build type (check, debug, release). Unless you change a dependency's feature flag, the compiler will just re-use what's already been c
216.
▲
by
Measter
6y ago
In my (admittedly somewhat limited) experience, these don't come up that frequently. except number 5; I've had several times where I've had to be aware of where references are coming from. I would say give Rust a go anyway. W
217.
▲
by
Measter
6y ago
It can really depend how you write it. In some instances you can just throw things together and it can look a fair bit like you might write it in what many would consider high level languages. On the other hand, there are times when you rea
218.
▲
by
Measter
6y ago
The way recoverable errors are signalled in Rust is through the return value, which is done using the `Result` enum. That enum is basically[0] defined like this: enum Result<T, E> { Ok(T), Err(E), } Openin
219.
▲
by
Measter
6y ago
I'm not sure if it would be allowed to hoist `dataQueue.Count` out of the loop. The docs [0] say that multiple concurrent readers are supported, so I'm not sure if the compiler would be allowed to assume anything about the call&#x
220.
▲
by
Measter
6y ago
The code in question basically looks like this(C#): // Called from Thread 1. public void AddData(Data theData) { lock(dataQueue) { dataQueue.Enqueue(theData); } } // Worker
221.
▲
by
Measter
6y ago
I have one example where I didn't see a race as an issue. I was transferring data from one thread, to a second thread which would process it after a delay. This transfer was done by locking a mutex, then pushing it onto a queue. The se
222.
▲
by
Measter
7y ago
Though it should be noted that you really don't need to spend that much. You could start off with something like a Logitech G29 for $250, which would clamp to your desk.
223.
▲
by
Measter
7y ago
It's been several years since I last drove with a monitor (my sim rig doesn't have one nearby), but from what I remember not as much. One of the biggest things I remember noticing when I switched to VR was I very quickly got bette
224.
▲
by
Measter
7y ago
I would disagree that it's impossible to tell what the rear's doing in a sim. I've never driven a real vehicle outside of a few times in a low-powered kart, so I don't know what it's like in that scenario. I assume
225.
▲
by
Measter
7y ago
Behold: the dumbest stack-less postfix notation evaluator written purely to abuse that new pattern matching! https://play.rust-lang.org/?version=beta&mode=debug&edition=...
226.
▲
by
Measter
7y ago
>Yes. Exceptions are kind of a pain, but the workarounds for not having them are worse. Passing back "result" types tends to lose the details of the problem before they are handled. Rust is on, what, their third error handling