Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Measter
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
151.
▲
by
Measter
5y ago
> The problem is that since the user base is so technically inclined already, they don’t see these as problems. Or if they do, they don’t see them as being important enough. They may not even realise that it is a potential issue. I'
152.
▲
by
Measter
5y ago
Rust Analyzer can do structural search and replace [0], though I've never used it nor IntelliJ's so I can't compare how capable both features are. [0] https://rust-analyzer.github.io/manual.html#structural-sea
153.
▲
by
Measter
5y ago
The implementation isn't symmetric, it'll work if you compare `b == a`. Apparently[0] it's something to do with avoiding code bloat. [0] https://github.com/rust-lang/rust/blob/e4c23daeb461ac0241
154.
▲
by
Measter
5y ago
I did once have a bizarre situation where removing a bounds check that always succeeded degraded performance by over 30%. The bounds check wasn't being elided either. I checked and it was there in the assembly, so I figured that the
155.
▲
by
Measter
5y ago
The `?` operator doesn't desugar to the the `try!` macro, it uses the `Try` trait. https://doc.rust-lang.org/std/ops/trait.Try.html
156.
▲
by
Measter
5y ago
> I wouldn't be surprised if they would simply turn to unsafe if they had to write it in Rust, errors are apparently to be worked around not fixed. They probably would. But it's easier to find usages of unsafe through grep or t
157.
▲
by
Measter
5y ago
As mentioned, these are attributes not comments. More specifically, the the `#[derive]` attribute on the enum lists which procedural macros to execute (Debug and Snafu here). These procedural macros are handed the token stream for that enum
158.
▲
by
Measter
5y ago
C#'s Null-Conditional operator isn't the same as Rust's Try operator. The Try operator will early return from a function, while the Null-Conditional operator conditionally executes the rest of the expression if the receiver i
159.
▲
by
Measter
5y ago
The Atmega 328P that the Uno uses has 2kb of RAM, and 32kb of ROM (technically, writable on boot, but not after you leave the bootloader).
160.
▲
by
Measter
5y ago
You mean by checking the bytes of the data directly kinda like in this godbolt example: https://godbolt.org/z/78cvfshva
161.
▲
by
Measter
5y ago
To clear something up here, while the Add trait is a language item, String is not. The String type is just a normal type implemented in liballoc[0]. As far as the language is concerned, there's nothing separating it from any other rand
162.
▲
by
Measter
5y ago
I use Fira Code.
163.
▲
by
Measter
5y ago
> > not counting CLR DLLs > Why would you exclude those in this comparison - they're already (guaranteed to be) installed on your windows targets? Note that this is a stand-alone build; it doesn't require the runtime to b
164.
▲
by
Measter
5y ago
I just tried it on a small project of mine. It's 955 lines of C#[0], 6 dependencies, already configured for publishing a single file, self contained, for win-x64, ready to run. I built in release mode with publish trimmed, and trim mod
165.
▲
by
Measter
5y ago
In the case of a Vec<Box<T>> the Vec owns the box, so the only thing you could link the reference lifetime to is the Vec itself because if the lifetime isn't bound to the Vec, mutating the Vec might drop that item which in
166.
▲
by
Measter
5y ago
I've also had fun due to a BOM. In my case it was for configuring the Assetto Corsa server. It takes an INI for the entry list, but halts parsing if it encounters unexpected input. Without any kind of message. The BOM was an unexpected
167.
▲
by
Measter
5y ago
If I were forced to implement them myself for some reason, I would probably simply do them like this: fn from_be(bytes: [u8; 4]) -> u32 { (bytes[0] as u32) << 24 | (bytes[1] as u32) << 16 | (byte
168.
▲
by
Measter
5y ago
It doesn't in my experience. I've been telling it I don't want to see: news, politics, music, or reaction videos for months. It still puts them there. Last week it decided that I wanted to see rap videos and filled my feed wi
169.
▲
by
Measter
5y ago
I'm really curious why some people have such a hard time picking it up. My experience has been the complete opposite, everything just clicked and it all made sense (at least, until you get to the gnarly stuff). What was the difference
170.
▲
by
Measter
6y ago
Well now I'm (morbidly?) curious what your Rust code looks like.
171.
▲
by
Measter
6y ago
> You should contribute these improvements upstream then. You honestly think they'd accept changes that would break literally every single library using these functions? Somehow I find that hard to believe. > The Arudino develope
172.
▲
by
Measter
6y ago
One place they do have a point (for AVR-based Arduinos at least) is how damned inefficient the basic IO stuff is. Look at this, for crying out loud![0] All of that assembly for no good reason. The pin mode only requires one or two instructi
173.
▲
by
Measter
6y ago
Rust's output[0] is basically the same as Zig in this case. The unsafe is needed here because it's calling extern functions. However, in this specific instance at least, this isn't as optimal as it could be. What this is basi
174.
▲
by
Measter
6y ago
I've been (slowly) doing Advent of Code 2019 on an STM32F303 microcontroller. I want all of the problem data to be stored in the binary, with the answers being output on a display. Most of my time so far has been spent on getting the c
175.
▲
by
Measter
6y ago
Would those work on any compiler, or are they compiler-specific? If those are non-standard compiler-specific extensions, not even a library, is it truly a part of C++? While I'll grant that Rust only has one fully functional compiler a
176.
▲
by
Measter
6y ago
> [..] Like, in the sense that you can transpile any bit of Python or Lisp or Haskell or Rust or JS into C but the opposite isn’t necessarily true because not all those language support all the features exposed in C [..] How would you w
177.
▲
by
Measter
6y ago
Huh... I guess I should read the docs more carefully next time; I clearly misunderstood them.
178.
▲
by
Measter
6y ago
> That's an unusual claim :) Could you elaborate? How is the learning curve, especially for fresh graduates who have been trained only on languages like C, Java and Python? One way to look at it would be that Rust forces you to conf
179.
▲
by
Measter
6y ago
That's not exactly the same. Splice returns an iterator, it doesn't modify the collection in place.
180.
▲
by
Measter
6y ago
Uh... because I'd been up for 20 hours and by brain fixated on a weird way to do it? Don't program when tired, kids.
More ›