Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
masklinn
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
18 ms
·
391.
▲
by
masklinn
10mo ago
I recently got told something similar in Europe, and anecdotally anyone who’d had a hip replacement and waited on it regretted not doing it as soon as the doc told them.
392.
▲
by
masklinn
10mo ago
Yeah. But my point is mostly that the CD remains nothing but a transmission vessel for the audio, I don't know anyone and have seldom heard of people who value CDs for their physicality as a CD. Unlike vinyls which they very much do.
393.
▲
by
masklinn
10mo ago
Sure, but on the whole I’d take getting FLAC directly over CDs. Not that I don’t have CDs, even deluxe editions with picture books and stuff, but I pretty much never get them out. I can understand people preferring vinyls as physical artefa
394.
▲
by
masklinn
10mo ago
> I don't feel you're quite following what I'm saying unfortunately. Disagreeing with your plainly incorrect assertion is not "not following" what you're saying. > In your specific example: couldn't
395.
▲
by
masklinn
10mo ago
Although Yaml is a dreadful thing, given the context and the size of a normal gemspec I would be very surprised if it showed up in any significant capacity when psych should be in the low single digit MB/s throughput.
396.
▲
by
masklinn
10mo ago
Affine types / destructive moves, type-level safety signal (sync/send), container-type locks. I really miss these when doing concurrent stuff in other languages.
397.
▲
by
masklinn
10mo ago
Not quite, there is code which fails borrow checking but is safe and sound. That is part of why a number of people have been waiting for Polonius and / or the tree borrows model, most classic are relatively trivial cases of "che
398.
▲
by
masklinn
10mo ago
> To me it feels like rust is barely readable sometimes. [...] C++ have a low barrier of entry and any beginner can write code. Here's rust code: fn main() { println!("Hello, world"); } Here is the equ
399.
▲
by
masklinn
10mo ago
> This can't possibly be guaranteed to work just by disabling the checker, can it? It works in the sense that the borrow checker stops bothering you and the compiler will compile your code. It will even work fine as long as you don&
400.
▲
by
masklinn
10mo ago
> So it is surprising to me that it doesn’t blow up somewhere when that invariant doesn’t hold. The final program may be broken in various manners because you don't respect the language's prescribed semantics, in about the same
401.
▲
by
masklinn
10mo ago
The borrow checker does not deal with ownership, which is what rust’s memory management leverages. The borrow checker validates that borrows (references) are valid aka that they don’t outlive their sources and that exclusive borrows don’t o
402.
▲
by
masklinn
10mo ago
It has nul-termination for compatibility with C, so you can call c_str and get a C string. With the caveat that an std::string can have nuls anywhere, which breaks C semantics. But C++ does not use that itself.
403.
▲
by
masklinn
10mo ago
> I would think that the returned value would be: `(nil, return-value-of-Decode-call)`. `user` is typed as a struct, so it's always going to be a struct in the output, it can't be nil (it would have to be `*User`). And Decoder.
404.
▲
by
masklinn
10mo ago
> Which I’m imagining is what Rust is doing with a Result type? Result only carries information about the success / failure of an unspecified operation, it is not a long term signal and furthermore is not resistant to tampering (so
405.
▲
by
masklinn
10mo ago
> an era where shaving bytes on storage was important Fixed size strings don’t save bytes on storage tho, when the bank reserves 20 bytes for first name and you’re called Jon that’s 17 bytes doing fuckall. What they do is make the entire
406.
▲
by
masklinn
10mo ago
> If it was designed for non-null terminated strings, why would it specifically pad after a null terminator? Padded and terminated strings are completely different beasts. And the text you quote tells you black on white that strncpy deal
407.
▲
by
masklinn
10mo ago
Technically strncpy was invented to interact with null-padded fixed-size strings in general. We’ve mostly (though not entirely) moved away from them but fixed-size strings used to be very common. You can see them all over old file formats
408.
▲
by
masklinn
10mo ago
We have. C is basically the only langage in any sort of widespread use where terminated strings are a thing. Which of course causes issues when languages with more proper strings interact with C but there you go.
409.
▲
by
masklinn
10mo ago
> My claim is simple and narrow: compilers should internally model such values as unspecified, not actively choose convenient constants. An assertion you have provided no utility or justification for. > The comment I replied to cited
410.
▲
by
masklinn
10mo ago
> UB doesn't mean there will be nasal demons. It means there can be nasal demons, if the implementation says so. Rather "if the implementation doesn't say otherwise". Generally speaking compiler writers are not must
411.
▲
by
masklinn
10mo ago
The entire "its initial value could be anything" is one of the possible consequences of UB. It is not the most dire but in C and C++ it is an outcome from an UB. Could a language define un-initialized variables as readable garbage
412.
▲
by
masklinn
10mo ago
That, however, conflicts with unused write detection which can be quite useful (arguably more so than unused variable as it's both more general and more likely to catch issues). Though I guess you could always ignore a trivial initiali
413.
▲
by
masklinn
10mo ago
There's never been any such ability. Musk has been promising actual full self driving within a year or two yearly or multiple times a year since 2015 (and partial such since 2014 at least).
414.
▲
by
masklinn
10mo ago
> As if treating uninitialized reads as opaque somehow precludes all optimizations? That's not what these words mean. > There’s a million more sensible things Again, if you don't like compilers leveraging UBs use a non-optim
415.
▲
by
masklinn
10mo ago
Surely that is obvious to anyone who has compared zip and tgz?
416.
▲
by
masklinn
10mo ago
> That doesn’t mean they should. Nobody’s stopping you from using non-optimising compilers, regardless of the strawmen you assert.
417.
▲
by
masklinn
10mo ago
The compiler is the arbiter of what’s what (as long as it does not run afoul the CPU itself). The memory being uninitialised means reading it is illegal for the writer of the program . The compiler can write to it if that suits it, the pro
418.
▲
by
masklinn
10mo ago
Although it should be noted that that’s not how compilers “reason”. The way they work things out is to assume no UB happens (because otherwise your program is invalid and you would not request compiling an invalid program would you) then wo
419.
▲
by
masklinn
10mo ago
Is that an old 'bot? because I noticed it was an old version of Clang, and I tried switching to the latest Clang which is hilarious: https://godbolt.org/z/fra6fWexM
420.
▲
by
masklinn
10mo ago
Things can get even wonkier if the compiler keeps the values in registers, as two consecutive loads could use different registers based as you say on what's the most convenient for optimisation (register allocation, code density).
More ›