Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Expurple
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
181.
▲
by
Expurple
2y ago
> isn't 'the error' just a case of valid data that shouldn't be thrown as exception at all? That's the thing! Errors are just a case of return data! To me, it just makes more sense to model them like that rather
182.
▲
by
Expurple
2y ago
> have a single Exception type at the root of the Exception type hierarchy and make your library only throw sub-types of that. Then you may handle specializations of that, but you need to also handle the root type in case an unknown vari
183.
▲
by
Expurple
2y ago
> “This type or three possible exceptions” was so painful people stopped using. A reader on Reddit has also pointed out [1] that it's literally impossible to represent "n possible exceptions" generically. Java makes you ma
184.
▲
by
Expurple
2y ago
> Panics in rust threads do not crash the process. They do on several occasions, as I mentioned in the post: > the process still crashes if the target doesn’t support unwinding or the project is built with panic = "abort" se
185.
▲
by
Expurple
2y ago
> Would be really cool if there was a code snippet in Rust comparing/explaining the advantage over Java for each benefit. Yeah, I thought about that. But the post kept and kept expanding in scope so I decided to instead hyperlink wh
186.
▲
by
Expurple
2y ago
> Will people keep writing these annoying posts with no insight just to complain about Exceptions (and Java in general)? I'm sorry if the post comes off like that. This wasn't intended. Originally, I was writing a post explaini
187.
▲
by
Expurple
2y ago
> But there's a lot of errors that aren't really recoverable inside a library Aren't all propagated `Result`s examples of errors that the library itself doesn't recover from and lets the caller decide what to do? IM
188.
▲
by
Expurple
2y ago
That's the thing! In this example, `f` doesn't expect valid data, by design. Some functions are responsible for figuring out what to do in case of unsuccessful operations. Maybe `f` would be easier to imagine as a simple mechanica
189.
▲
by
Expurple
2y ago
This isn't the only pattern that `if let` is suitable for. It's often used without an `else`, as a syntax sugar for match value { the_only_case_that_we_care_about => { // Do something with th
190.
▲
Rust Solves the Issues with Exceptions
(home.expurple.me)
23 points
by
Expurple
2y ago
|
51 comments
191.
▲
by
Expurple
2y ago
This is kinda similar to never open-sourcing some useful proof-of-concept software, because of the percieved need to polish, test and document it
192.
▲
by
Expurple
2y ago
Could you share your examples of incoherence in Rust? I actually find it a small, well-designed and very coherent language. At least, when compared to huge mainstream languages. E.g., traits cover the use cases of both "abstract classe
193.
▲
by
Expurple
2y ago
This annotation would be useless, because it would infect ~99% of your codebase. All IO is implemented as unsafe FFI calls or unsafe inline assembly somewhere down the stack. And even "pure" types like Box, Option, Vec have a lot
194.
▲
by
Expurple
2y ago
SQLite is developed in a similar way, by the way. Maintainers aren't required to accept community patches. It's not part of the four freedoms or whatever. Realistically, open-source licences only give the user the rights to use th
195.
▲
by
Expurple
2y ago
Clippy is both faster in the CI and can be integrated into an IDE feedback
196.
▲
by
Expurple
2y ago
Kagi in particular shouldn't be affected. Apart from using its own index, it also aggregates results from other search engines, most likely including Google. https://help.kagi.com/kagi/search-details/search-so
197.
▲
by
Expurple
2y ago
Good luck making all your teammates use these boost templates and use them correctly. And debugging these layers of templates. A classic from the old Rust FAQ: >> I already write perfect C++. What does Rust give me? > Modern C++ in
198.
▲
by
Expurple
2y ago
IMO, unless you have really serious reasons, it would be silly to turn "a decade of hard work" into two decades of hard work. With an even lower chance of your new language getting traction. Nothing prevents you from launching a
199.
▲
by
Expurple
2y ago
You can do this using uBlacklist extension or Kagi search engine
200.
▲
by
Expurple
3y ago
I willingly admit it. I'm afraid of having to spend time debugging obscure linker errors or segfaults *ever again*
201.
▲
by
Expurple
3y ago
I'd like to elaborate on the "fancier type system". It's not all academic. There are obvious practical advantages: - No more bugs where a value that shouldn't be mutated is accidentally mutated in another place. - N
202.
▲
by
Expurple
3y ago
Rust's language-level support for pattern matching (including exhaustiveness checking) is very nice. Most languages with sum types have this feature. It's hard to imagine one without the other. I haven't used `std::variant` m
203.
▲
by
Expurple
3y ago
Developer experience (developer happiness, speed of development)
204.
▲
by
Expurple
3y ago
KDE is pretty stable these days, in a good way. 6 doesn't look very different from 5, it mostly upgrades the tech stack and sets some nice defaults
205.
▲
by
Expurple
3y ago
This doesn't work with streaming, e.g. JSON logs
206.
▲
by
Expurple
3y ago
Also, Python with type annotations. But it's not a very fair comparison, since objects in Python/TS are all heap-allocated, introspectable and contain rutnime type information. Rust doesn't have any of that by default
207.
▲
by
Expurple
3y ago
> How does having a magic card that turns crypto in to fiat work if the exchange has banned you? It doesn't. That's the point of the article. However, this problem is not exclusive to crypto cards. The person in question turned
208.
▲
by
Expurple
3y ago
With your experience, 27 jobs may have usually been a lot. But it's not much nowadays. I have 3 years, and during my long search I applied to 27 new jobs like every 2 days
209.
▲
by
Expurple
3y ago
Well, if you have some zimbabwean dollars, in most parts of the world you pretty much have to "cash out" and convert to a different currency, if you want to spend these. If you have a "respectable" currency like EUR and,
210.
▲
by
Expurple
3y ago
Yes. This gets even better with Haskell's partial application: length $ filter (> 17) ages And you can also count pred = length . filter pred count (> 17) ages
More ›