Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dwattttt
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
121.
▲
by
dwattttt
5mo ago
I'm not sure what you think a (native) debugger that can't disassemble would look like; I assure you it disassembles the instructions you debug. Its assembler is sadly stuck in the pre-x86_64 era (and refuses to do arm at all), ho
122.
▲
by
dwattttt
5mo ago
That is another way of looking at it, but given the topic, you're gonna have to expand or contextualise that. I Rust a fair bit, and only barely follow.
123.
▲
by
dwattttt
5mo ago
I can't reconcile what you're asking for with the situation you're describing. If every single error everywhere in the program created a stack trace and logged it at creation time, your error would be lost under an avalanche
124.
▲
by
dwattttt
5mo ago
> track down a situation where you see in your prod logs that you are encountering a lot of "validation error: string is too long" but you can't tell where it is coming from. Capturing a stack trace is a hefty operation: m
125.
▲
by
dwattttt
5mo ago
Because doing a dance to avoid it decaying conveys better information to both the compiler and downstream users of your code.
126.
▲
by
dwattttt
5mo ago
It's hard to be concrete without talking about something specific. At the limit, in stable Rust (for 8 years?), a proc_macro consumes and emits an arbitrary token stream at compile time; it's not ergonomic, but it's possible.
127.
▲
by
dwattttt
5mo ago
An initialism, yet now an aninitialism.
128.
▲
by
dwattttt
5mo ago
I'm curious, what's the value of a stack trace of another person's library functions? As mentioned, you can get a stack trace that includes all of your code, that's what was offered to you. The only thing a library gathe
129.
▲
by
dwattttt
5mo ago
And today I learned this has a name, anacronym! An acronym that has become so common, it's treated as a word instead of an acronym.
130.
▲
by
dwattttt
5mo ago
eBPF predates WebAssembly by a few years. I'm also not sure Linux would've wanted to integrate and rely so heavily on a standard they aren't in control of the design of.
131.
▲
by
dwattttt
5mo ago
There's a few confusing things here. For one, just because the allocator gave you an AllocError, that doesn't mean your function has to return an AllocError: you can return whatever error type you choose. If you want to collect a
132.
▲
by
dwattttt
5mo ago
I believe the stdlib can't be versioned like that: there's only one stdlib linked into a final artifact, you can't have two versions with differing APIs in there.
133.
▲
by
dwattttt
5mo ago
I've never been bothered by long compilation times, it gives me time to think about what the code should actually do. To other people's usage patterns though, I imagine the group of people who don't do much with the type syst
134.
▲
by
dwattttt
5mo ago
I think this is a clash of terminology: a Rust enum isn't an integer with pretensions of an identity. You'd describe it as a tagged union in some languages. So when you say you'd return an error with extra information, what t
135.
▲
by
dwattttt
5mo ago
To highlight the problem for Python: Python's standard library has getopt, optparse, and now argparse. I don't think they set out to offer 3 argument parsing libs, one of which is marked superseded, but here we are.
136.
▲
by
dwattttt
5mo ago
I have tried to figure out some kind of unification between "collecting error state in a function", "logging error state", and "return error state to a parent". I haven't found any satisfying solution to i
137.
▲
by
dwattttt
5mo ago
By standard I meant an error type that implements std::error::Error. EDIT: Which I assume all my dependencies have done, given that anyhow is able to consume all of them. I specifically called out writing applications as my use case: my onl
138.
▲
by
dwattttt
5mo ago
Do you really want that data passed back down to the caller of the allocation? From the description of the failure state you'd want to log that data instead: what's the caller of the allocation going to do if you tell it it failed
139.
▲
by
dwattttt
5mo ago
You really missed the opportunity here. You were meant to bill for the review, assessment, report production, and risks judged when coming up with that 25%.
140.
▲
by
dwattttt
5mo ago
I guess you might have to if you need to use a library someone's written that doesn't implement the standard. Writing primarily applications, I couldn't tell you what error handling frameworks my dependencies are using: I lit
141.
▲
by
dwattttt
5mo ago
A &(dyn Error + 'static) should be fine for that; you don't need any allocated/variable sized data in a memory allocation failure.
142.
▲
by
dwattttt
5mo ago
And yet, quality can always get worse.
143.
▲
by
dwattttt
5mo ago
I have watched a compiler flip between emitting the code I expected (despite it having UB), and emitting unexpected code after a minor update. What you observe a compiler do when there's UB is not at all something you can rely on.
144.
▲
by
dwattttt
5mo ago
The compiler is required to not optimise out reads/writes through volatile. That's unrelated to code also having UB: you can't sprinkle volatile through arbitrary UB and suddenly have it be defined. > A compliant compiler
145.
▲
by
dwattttt
5mo ago
That sure is a long list. But written out like that it gets a bit misleading: does there exist anything with that same list, just missing pae? mmx? syscall? Just because they have individual names & flags, doesn't mean every combin
146.
▲
by
dwattttt
5mo ago
I also do not see any requirement in the quoted text that the casted pointer be dereferenced before noting "the behavior is undefined". In practice performing a cast doesn't really do much until you dereference, but without a
147.
▲
by
dwattttt
5mo ago
Per ggreer's comment [0], there are other potential sources nearby. It's pretty annoying all told. It invalidates the results; it takes them from "this is clear evidence of a breach" into "maybe it's in breach.
148.
▲
by
dwattttt
5mo ago
Correct. The comparable git workflow when you fix a bug is that the work goes on the branch of the feature the bug was in, and "main" is updated to use the new head of that branch.
149.
▲
by
dwattttt
5mo ago
If you tag every commit, sure. You don't know which commit has a bug that needs to be fixed in advance. And at the point you're tagging every commit, you're fighting git. EDIT: reconsidering: you would have to move a tag when
150.
▲
by
dwattttt
5mo ago
I believe emergency services calls are free. The cost being talked about is the maintenance cost to the provider.
More ›