Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
JoelJacobson
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
Hooli vs. Sweden: The Strike Saga
1 points
by
JoelJacobson
3y ago
|
0 comments
62.
▲
by
JoelJacobson
3y ago
Thanks for the link!
63.
▲
by
JoelJacobson
3y ago
I'm truly impressed by the tactfulness of first making the previously unintentionally legal but undocumented syntax an error in PostgreSQL 15. This is a textbook case of "Virtuous Intolerance" [1]. By taking this step, the Po
64.
▲
by
JoelJacobson
3y ago
I created a similar regex web demo that shows how a regex is parsed -> NFA -> DFA -> minimal DFA, and finally outputs LLVMIR/Javascript/WebAssembly for from the minimal DFA: http://compiler.org/reason-re-n
65.
▲
by
JoelJacobson
3y ago
Just released `wherr` v0.1.7! Now with optional `anyhow` support via feature flag. This lets you combine `anyhow`'s error handling with `wherr`'s file and line details seamlessly. Check out the example in `wherr/examples
66.
▲
Enhance Rust RFCs with a Minimal but Realistic Code Example
(gist.github.com)
2 points
by
JoelJacobson
3y ago
|
0 comments
67.
▲
by
JoelJacobson
3y ago
That's what I've been using but still get that error.
68.
▲
by
JoelJacobson
3y ago
Is there a limit on the number of lines/tokens it can take as input? Can it be increased? The limit seems to be somewhere above 30 lines. I'm on a MacBook Pro M1 Max 64GB. % ollama --version ollama version 0.0.16 % o
69.
▲
by
JoelJacobson
3y ago
Author of `wherr` here again. Your approach is indeed elegant, and leveraging `#[track_caller]` is quite idiomatic. I also see the value in opting out of macros when possible. However, I'm pondering the error matching aspect. Using you
70.
▲
by
JoelJacobson
3y ago
I've added a branch for this: https://github.com/joelonsql/wherr/tree/track_caller `src/lib.rs` is your code copy/pasted, with the addition of `impl<'a, E: StdError + 'a> From&l
71.
▲
by
JoelJacobson
3y ago
That seems like a great idea. I've started a branch "attempt_to_avoid_dynamic_cast" where I've tried to implement your idea: https://github.com/joelonsql/wherr/commit/c5906a257fc9768ad0...
72.
▲
by
JoelJacobson
3y ago
Author of `wherr` here. > I think the disadvantage you mention is actually an advantage. I would probably want this to propagate alongside other `track_caller`'s since anyone using `track_caller` is "in the know" about whe
73.
▲
by
JoelJacobson
3y ago
// This will work: downcast the inner error and then match on it. match my_error_wrapped().unwrap_err().inner.downcast_ref::<MyError>() { Some(MyError::A) => println!("got MyError::A"),
74.
▲
by
JoelJacobson
3y ago
Author of `wherr` here. Thanks for sharing a really nice alternative solution to the problem, I like it! It seems to be a bit faster: running 2 tests test tests::benchmark_location_caller ... bench: 15 ns/iter (+/- 0) tes
75.
▲
by
JoelJacobson
3y ago
Thanks, I'm glad you like it! Not sure what you mean when you say you want to "turn off the stack traces"? There are no implicit stack traces / backtraces. The detailed example in the docs makes use of `.expect()` and `R
76.
▲
by
JoelJacobson
3y ago
I like the idea of not even having to write a line of code per function. Maybe `cargo fmt` could be extended to add such annotations automatically? That way, it wouldn't be "magic", since the macros would be spelled out in th
77.
▲
by
JoelJacobson
3y ago
It is a valid problem though, since if you have code that currently depend on the different error enum variants, then that code needs to be modified to match on the original error via the `.inner` field instead.
78.
▲
by
JoelJacobson
3y ago
Not true, it's not "erased", it's wrapped. The original error is available via the `.inner` Wherr struct field.
79.
▲
by
JoelJacobson
3y ago
Author of `wherr` here. I can totally relate to the situation you describe. That's exactly what happened to me, and why I created wherr. At first, I couldn't understand why I couldn't find the `?` line in the backtrace. `anyh
80.
▲
by
JoelJacobson
3y ago
Author of `wherr` here. I agree that you wouldn't always want to pay the extra cost for this information. However, I imagine real-world use-cases when it's preferable to pay that cost in production, allowing users to forward file
81.
▲
by
JoelJacobson
3y ago
I like `anyhow`, it's a great! But it doesn't help if the existing error, wherever it is created, doesn't already use `anyhow`. For errors that you can't find, then adding the `#[wherr]` macro to the functions, could pos
82.
▲
by
JoelJacobson
3y ago
Author of `wherr` here. The idea is to minimise the effort needed to debug programs that already make use of the `?` operator, when the underlying error doesn't already contain file and line information, where the error is possibly com
83.
▲
Enhance Rust errors with file and line details
(crates.io)
120 points
by
JoelJacobson
3y ago
|
91 comments
84.
▲
Flashback Logging
(gist.github.com)
2 points
by
JoelJacobson
3y ago
|
0 comments
85.
▲
by
JoelJacobson
3y ago
App just shows a message "It's time." with a "Notify me" icon. Is it really launched or will it happen later today?
86.
▲
Elon's Estimator: Etalon
(gist.github.com)
2 points
by
JoelJacobson
4y ago
|
0 comments
87.
▲
Content-Addressed Functions in PostgreSQL
(gist.github.com)
1 points
by
JoelJacobson
4y ago
|
0 comments
88.
▲
Tarjan's strongly connected components algorithm implemented in PL/pgSQL
(gist.github.com)
1 points
by
JoelJacobson
4y ago
|
0 comments
89.
▲
Cielab color space should be replaced
(youtube.com)
1 points
by
JoelJacobson
4y ago
|
0 comments
90.
▲
by
JoelJacobson
5y ago
Not sure, haven't even tried them yet, still renovating the house, three years and counting. But according to the specs: L70 ≥50,000 hours at 25°C ambient L70 is "An LED is considered to have reached its rated life at tha
More ›