Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Expurple
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
15 ms
·
151.
▲
by
Expurple
1y ago
> But yeah I constantly get confused by when errors can and can not coerce. It's simple, really. `?` coerces errors if there's an `impl From<InnerError> for OuterError`: fn outer() -> Result<(), OuterError>
152.
▲
by
Expurple
1y ago
No, Go didn't get this right. Returning a tuple (a T and an errror) isn't an appropriate tool when you want your function to return either a T or an errror. It's a brittle hack that reqires everyone to use a third-party
153.
▲
by
Expurple
1y ago
> multiple error variants that reference the same source error type which I always had issues with in `thiserror`. Huh? #[derive(Debug, thiserror::Error)] enum CustomError { #[error("failed to open a: {0}")]
154.
▲
by
Expurple
1y ago
> Also they act like their open source code is “Free”. They firmly control it, yet act like they don’t. They are responsive to the community and merge community PRs. That's already more "open" than, say, SQLite. Sure, they
155.
▲
by
Expurple
1y ago
It's explained here: https://www.youtube.com/watch?v=RIctzAQOe44 The presenter (an X11 dev) argues that it was sorta already the case. That, nowadays, X11 WMs are thick, do much of the work themselves, don't use m
156.
▲
by
Expurple
1y ago
I think, this is only relevant for staying on an older version of uv? Which is only a temporary solution, in any ecosystem and in almost any situation. It's just "even more temporary" in Python :) If your old preferred altern
157.
▲
by
Expurple
1y ago
Well, kinda. I haven't used uv, so I'm not sure how strong the dependency (and the lock-in) is. But it looks like just a QoL tool that reads the standard pyproject.toml, etc. So, it shouldn't be that bad. And if the authors d
158.
▲
by
Expurple
1y ago
If I remember correctly, Wayland actually makes it harder to have more DEs/WMs because each must implement its own Wayland compositor
159.
▲
by
Expurple
1y ago
It won't ever fully settle, because Linux users like tinkering by their nature. But in the mainstream, it's kinda already settled on the Gnome-KDE duopoly
160.
▲
by
Expurple
1y ago
Lmfao. Despite people constantly whining about it, KDE is now stable, has good defaults, and it actually looks like Windows. It's not an accident that Steam Deck uses it.
161.
▲
by
Expurple
1y ago
> If only there'd be an automatic handler that was invoked every time `?` hits a None, and transformed the error to a richer one, using the context of the entire function. Not sure what you mean by "using the context of the ent
162.
▲
by
Expurple
1y ago
To me, it's less about memory usage and performance, and more about language simplicity and constistency (which is another big advantage of Rust, although many people would disagree with me on this). > this might actually be one of
163.
▲
by
Expurple
1y ago
Could you elaborate on your first idea? I don't understand it. Your second idea is interesting, but I feel like it would be too magical for Rust. You fundamentally need a Backtrace field to add backtraces to your error types. Adding an
164.
▲
by
Expurple
1y ago
Hi, I'm the author of the article. As I've learned when discussing my older article about exceptions, the real problem is that methods can't have an unknown, generic, composable set of checked exceptions! https://h
165.
▲
by
Expurple
1y ago
Thiserror 2.0 (released 6 months ago) supports no_std. https://github.com/dtolnay/thiserror/releases/tag/2.0.0
166.
▲
by
Expurple
1y ago
> I can imagine some performance concerns in the real world. A friend has pointed out that, for performance reasons, games already tend to sidestep the filesystem and bundle everything into container/archive files, like .pak [1]. It
167.
▲
Alternatives to Open Source (2024)
(simonsafar.com)
3 points
by
Expurple
1y ago
|
0 comments
168.
▲
by
Expurple
1y ago
Can't edit the parent comment anymore, so I'll append my other thoughts here. I remembered that the "automounting" already exists in some forms, and I really like these instances. When you click on an archive in a good f
169.
▲
by
Expurple
1y ago
> to the recursive definition "There are files, which are made up of 0..n files (blobs) and 0..n subdirectories" I think, it's more like "a file node contains metadata, a binary blob of data (may be empty), and 0..n c
170.
▲
We Are Doing Files Wrong (2021)
(simonsafar.com)
5 points
by
Expurple
1y ago
|
4 comments
171.
▲
by
Expurple
2y ago
Idris is Turing complete [1] and has a very advanced and expressive type system (dependent types) where type checking is still guaranteed to halt. That's because the language has a notion of `total` functions [2], and only `total` func
172.
▲
by
Expurple
2y ago
Honestly, no idea. I got into RSS about a year ago. I just use Thunderbird, which I already use for my mail
173.
▲
by
Expurple
2y ago
Sure. Thanks for the conversation. If you're interested in the follow up, I have an RSS feed: https://home.expurple.me/posts/index.xml
174.
▲
by
Expurple
2y ago
> There is plenty of code that is guaranteed not to throw -- starting from operations on basic types This is fair, although this places some mental load on the programmer because they need to be careful when dealing with generics /
175.
▲
by
Expurple
2y ago
Depends on the domain. For some, there are already de facto standard crates that the ecosystem has concentrated around. For some, like web frameworks, there are many competing choices
176.
▲
by
Expurple
2y ago
> Sometimes it's better to call throwing functions and get needed data before modifying the private data Haha! Here we go back to the topic of unchecked exceptions and "the lesser evil". With unchecked exceptions, every f
177.
▲
by
Expurple
2y ago
> Quite often all the caller needs is to cancel whatever it is doing and propagate the error. Yes, this is the most common case. That's why Rust has `?` to support it as well as exceptions do. My take is that: - The caller should ma
178.
▲
by
Expurple
2y ago
Yeah, but there's always a cultural struggle to prevent everyone from using their own incomprehensible DSL. See "The Lisp Curse" [1]. Even vanilla Haskell (without macros, i.e. without Template Haskell) takes it too far by al
179.
▲
by
Expurple
2y ago
It's equivalent to having to "catch or specify" [1]. IMO, it's a lesser evil than unchecked exceptions [2]. Explicit and mandatory handling is desirable for most errors. The caller has the responsibility to decide whethe
180.
▲
by
Expurple
2y ago
They aren't necessarily mixed together in an unmaintainable way. In a Rust-like functional paradigm, fallible functions typically return Result<T, E> and you can extract the T out of it and proceed to work on just the valid T whe
More ›