Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dwattttt
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
271.
▲
by
dwattttt
10mo ago
I've tried it recently, from memory error inference wasn't that great through it.
272.
▲
by
dwattttt
10mo ago
Is it any more or less amusimg, or perhaps tedious, watching the first Rust Linux kernel CVE be pounced on as evidence that "problems .. did not magically disappear"? Does anyone involved in any of this work believe that a CVE in
273.
▲
by
dwattttt
10mo ago
True, you could annotate 3 of the 4 literals in this without annotating the List, which is ambiguous. In the absence of an explicit annotation (because those are optional), type checkers are left to guess intent to determine whether you wan
274.
▲
by
dwattttt
10mo ago
> Either way, you didn't annotate the code so it's kind of pointless to discuss. There are several literals in that code snippet; I could annotate them with their types, and this code would still be exactly as it is. You asked
275.
▲
by
dwattttt
10mo ago
What should a type checker say about this code? x = [] x.append(1) x[0] = "new" x[0] + "oops" It's optionally typed, but I would credit both "type checks correctly" and "can't assig
276.
▲
by
dwattttt
10mo ago
That's why I hexify all binary files, to make it easier to understand them.
277.
▲
by
dwattttt
11mo ago
You're thinking of cross platform codebases. There's nothing about cross compilation that stops the toolchain from knowing what APIs are present & not present on a target system.
278.
▲
by
dwattttt
11mo ago
You just need a compiler & linker that understand the target + image format, and a sysroot for the target. I've cross compiled from Linux x86 clang/lld to macOS arm64, all it took was the target SDK & a couple of env vars.
279.
▲
by
dwattttt
11mo ago
"A language that doesn't affect the way you think about programming is not worth knowing." ― Alan J. Perlis Learning Rust definitely made me a better C programmer.
280.
▲
by
dwattttt
11mo ago
> The Python devs, by contrast, have actually put in a lot of work over the years to support a plethora of operating system This pre-pep is proposed by core Python devs. The discussion includes comparing the supported targets of both Pyt
281.
▲
by
dwattttt
11mo ago
It's a fine question. I think the onus is on public regulatory bodies responsible for the standards; if they aren't able to pay for the work to be published as an open standard, it wasn't worth the cost.
282.
▲
by
dwattttt
11mo ago
> "if I spent the time, risk, effort, and money to develop the pre-eminent protocol and hardware used by most TV's in the world... would I want to give that work away for free?" This is absolutely fine. But it should precl
283.
▲
by
dwattttt
11mo ago
Wouldn't a data type with no safe method of construction satisfy that? You can only get one by calling an unsafe function & satisfying its constraints.
284.
▲
by
dwattttt
11mo ago
It's possible for a crate to assume there will be unwinding, but given the Rust communities general attitude to exceptions it's not common. By default, all it means is that unwinding the stack doesn't happen, so Drop implemen
285.
▲
by
dwattttt
11mo ago
This is ultimately a good example of how to use Rust. You express as much of the API as you can safely, and the rest is unsafe. APIs that can't be safely modelled can still be exposed to Rust & marked unsafe, if they're needed
286.
▲
by
dwattttt
11mo ago
I don't know that there's a list, but cases come to mind because they've been controversial. (Not a Linux hacker, so apologies if I get this wrong) The filesystem APIs were quite arcane, and in particular whether or not you w
287.
▲
by
dwattttt
11mo ago
That's not really the case. Not all C APIs are inherently unsafe by construction, and I've always appreciated when someone has wrapped a C library and produced two crates: - a pure binding crate, which exposes the C lib libraries
288.
▲
by
dwattttt
11mo ago
The panic_immediate_abort feature should prevent this. build-std is the name of the feature that recompiles the Rust standard libraries with your chosen profile, so the combination of these two features should result in no unwinding code bl
289.
▲
by
dwattttt
11mo ago
Anecdotally, my "wow, this Rust business might really go somewhere" moment was when I tried adding multithreading to a random tool I made (dispatching tasks to new threads). Multithreading had not been planned or architected for,
290.
▲
by
dwattttt
11mo ago
It's been mentioned obliquely, but what's considered "part of the compilation process" is different between Rust and C. Most of the examples of "this is what makes Rust compilation slow" are code generation rel
291.
▲
by
dwattttt
11mo ago
The situation seems reminiscent of "using File::open to modify /proc/self/mem". It's safe to work with files, except there's this file that lets you directly violate memory safety.
292.
▲
by
dwattttt
11mo ago
> I disagree that new things are inherently good. New things aren't automatically good. But you don't get new things that are good without trying new things. By avoiding new things, you're guaranteed to not experience less
293.
▲
by
dwattttt
11mo ago
I don't believe Rust for Linux use std. I'm not sure how much of Rust for Linux the GCC/Rust effort(s) are able to compile, but if it was "all of it" I'm sure we'd have heard about it.
294.
▲
by
dwattttt
11mo ago
There is, I understand, an expectation that if you do make breaking changes to kernel APIs, you fix the callers of such APIs. Which has been a point of contention, that if a maintainer doesn't know Rust, how would they fix Rust users o
295.
▲
by
dwattttt
11mo ago
Zig does claim that it > ... has a debug allocator that maintains memory safety in the face of use-after-free and double-free which is probably true (in that it's not possible to violate memory safety on the debug allocator, althoug
296.
▲
by
dwattttt
11mo ago
CHERI looks at this and says "64+1 bits? A childish effort", and brings 128+1 to the table. EDIT: to be fair to it, they carry it through to main memory too
297.
▲
by
dwattttt
11mo ago
Underscore acts as a wildcard, denoting that you don't want to bind a variable. Quoting the Rust reference[0]: > Underscore expressions, denoted with the symbol _, are used to signify a placeholder in a destructuring assignment. [0]
298.
▲
by
dwattttt
11mo ago
Fixed it for you https://play.rust-lang.org/?version=stable&mode=debug&editio...
299.
▲
by
dwattttt
11mo ago
I was trying to figure out where the cursed part comes into it; I assume it's the switching, that typical circuit analysis just doesn't involve discrete states that are swapped between?
300.
▲
by
dwattttt
11mo ago
bandwhich[0] is a recent one I'm familiar with [0] https://github.com/imsnif/bandwhich
More ›