Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dwattttt
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
31 ms
·
631.
▲
by
dwattttt
2y ago
It shouldn't bypass page protections, that would be a kernel bug. And quite a bit harder to achieve too, since the kernel would still be using the same virtual address mapping as user space there.
632.
▲
by
dwattttt
2y ago
> There are no popular projects that use Rust as a primary language You may be surprised to learn, Python's `cryptography` project is written (EDIT: maybe not primarily, it's hard to compare given dependencies) in Rust, and saw
633.
▲
by
dwattttt
2y ago
For `&[u32]` and `&[u32; P]`, those are both references to an array of unsigned 32 but integers, however the former is to an array of any size (and carries its size at runtime), whereas the latter is to an array with an explicitly k
634.
▲
by
dwattttt
2y ago
Another trending thread right now is Pegasus/Predator; as much as it may be a facade, to say MS (or any OS vendor) has no business working on security/secure computing is demonstrably false.
635.
▲
by
dwattttt
2y ago
Seriously, can someone find them an award? I think they've earned it.
636.
▲
by
dwattttt
2y ago
Type hints have no runtime impact, so they can't make stuff not work. Type linters like mypy can check your code & report something like "this function call requires str, you're providing str | None" though.
637.
▲
by
dwattttt
2y ago
The point generalises beyond semicolons; everything you leave to context is something other people have to load up the context for in order to understand. Consider Python; if there are the optional type hints, those can tell you the third p
638.
▲
by
dwattttt
2y ago
Aside from the other good points, this thread is about cognitive load. If a language lets you leave off lots of syntactic elements & let the compiler infer from context, that also forces anyone else reading it to also do the cognitive w
639.
▲
by
dwattttt
2y ago
Watching every single thing on Netflix is also literally impossible, and it doesn't cost $2,500 to try.
640.
▲
by
dwattttt
2y ago
> This is a matter of perspective. I'd make a stronger statement here; this is a specific example of when having units is most powerful. When even though two things are expressed in some common form, they nevertheless represent some
641.
▲
by
dwattttt
2y ago
> Do you want to be able to add inches and feet? This probably doesn't have to be too complicated; the usual answer for Rust is "no". Rust doesn't even let you "just" add two unsigned integers of different s
642.
▲
by
dwattttt
2y ago
> The sign bit has much more defined semantics regardless. But which of those semantics do we need for conveying which of two states something is in? If the Linux kernel recommended a more rich type for expressing the result of a syscall
643.
▲
by
dwattttt
2y ago
What's the difference between checking the highest bit is set in a struct's bitfield, and checking the highest bit is set when that bit is part of an integer?
644.
▲
by
dwattttt
2y ago
Rust's answer is its type system, but Rust is hardly the only language that can do this. If a syscalls returns an fd, and on error it returns a negative value, why not define it as a bitfield with one bit a flag? Then in C there'd
645.
▲
by
dwattttt
2y ago
It's problems like these (mistaking a sentinel value for a valid member of a type) that make me think sentinel values are just a mistake. In-band signalling must have been responsible for so many bugs at this point.
646.
▲
by
dwattttt
2y ago
> if one rigorously changes devices and certain use/account practices Your account practices will need to include only using an account on one device. Every time you use an account that identifies you on a device, that device can be
647.
▲
by
dwattttt
2y ago
While I agree with the point, the word "surviving" doesn't do that point any favours.
648.
▲
by
dwattttt
2y ago
There's a primary type that holds invalid utf8; it's [u8]. If you want a string from that, you try turn it into a string, and deal with the errors then. If an algorithm works for invalid Unicode, it should probably be an algorithm
649.
▲
by
dwattttt
2y ago
There's also split-debuginfo, which allows emission of debug info into a separate file, rather than needing to distribute it in the binary. Then they could capture stack traces, and resolve the symbols later if necessary. That would al
650.
▲
by
dwattttt
2y ago
Maybe the best example of this would be memcpy. It's extremely clear what it does, but the implementations would surely be "clever" code. And yet you don't need to know anything about SSE to use it.
651.
▲
by
dwattttt
2y ago
Can't get much more of a reading comprehension failure than that. Good thing I don't write compilers.
652.
▲
by
dwattttt
2y ago
Turns out you can have that kind of speculative failure too! https://randomascii.wordpress.com/2018/01/07/finding-a-cpu-d...
653.
▲
by
dwattttt
2y ago
I don't imagine NULL is defined as "pointing to an object", so I don't expect that clause to apply.
654.
▲
by
dwattttt
2y ago
I don't know where you'd draw the line, but if you asked me which language made it easier to say, integrate a jinja library that web pages were written in, I know my answer.
655.
▲
by
dwattttt
2y ago
If I had to extract meaning from it, I'd say "Never before has there been one language that is at least ok at writing shellcode, a web server, and a phishing page in". Not sure I agree with the statement, but it's a pret
656.
▲
by
dwattttt
2y ago
fuzz testing vs HN-popular-post testing, go!
657.
▲
by
dwattttt
2y ago
You're welcome to make value judgements. The statement you're responding to is a statement about what the article does, not what you should/should not do.
658.
▲
by
dwattttt
2y ago
Many people have had the experience of "I tried to call you, but you were calling me!"; I don't imagine they'd be surprised if "something weird" happened when you both tried to send a message at the "same&
659.
▲
by
dwattttt
2y ago
I was actually aiming for the situation where a function is defined on all reals but still discontinuous (e.g. the piecewise function in the wiki article for the removable discontinuity). So there's a discontinuity (x=1), however the f
660.
▲
by
dwattttt
2y ago
HN's very own WalterBright?! I had no idea he'd inspired Sid Meier's Civilization. There's more to thank him for than I realised.
More ›