Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dureuill
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
61.
▲
by
dureuill
3y ago
I really don't see what issues there are with rust that could be addressed by another language without compromise on the performance and memory safety axes. I can think of two reasons for people not moving: 1. inertia, aka "not go
62.
▲
by
dureuill
3y ago
I think I'd implement Serialize on a different type and implement conversions from the foreign type to my serializable type. That would mean that the locations where I want to serialize the foreign type would have to be marked with `.i
63.
▲
by
dureuill
3y ago
> Backwards from what? A reference can't be null, but it can still be invalid, which is a more common problem than forgetting to check for null-ness. no, a reference cannot be invalid. If you are given an invalid reference (such as
64.
▲
by
dureuill
3y ago
with const pointers you have the different problem that you need to define what happens when the nullptr is passed. While I would certainly prefer the reference to be visible at the call site (a mistake Rust did not repeat), if I have to ch
65.
▲
by
dureuill
3y ago
The person you're responding to was specifically responding to your criticism that Rust does not provide a specification that implementations can target. You're now listing languages, such as Python, that don't have a specifi
66.
▲
by
dureuill
3y ago
> Now can I have just a safe C without all the other stuff, pretty please? :) Not sure how much we could remove from Rust while keeping the problem tractable. The borrow checker is needed for compile time memory safety sans garbage colle
67.
▲
by
dureuill
3y ago
Just to elaborate on the "just more comfortable once you already know it" part, I think a lot of Rust is optimized (willingly or not) for the "once you know it" use case. Which, while it might arguably hurt adoption, is
68.
▲
by
dureuill
3y ago
As someone with bad eyesight, Rust has been very legible, and the sigils actually help for that (in the same way as most mathematical notations make formulae easier to parse). It does take a little while to get accustomed to, but the invest
69.
▲
by
dureuill
3y ago
> , after all, the compiler needs to check for UB to generate code. No the compiler does not check for UB to generate code. A lot of UB (runtime out of bounds, use after free) are very difficult to detect statically (at least without spe
70.
▲
by
dureuill
3y ago
Yes you can. They're called panics
71.
▲
by
dureuill
3y ago
Getting generic data structures that are more efficient than his specialized C data structures is exactly what happened to Bryan Cantrill when he ported a carefully optimized C program to naive Rust. > Yes, you read that correctly: my na
72.
▲
by
dureuill
3y ago
> Not to mention that memory safety is just one type of failure in a cornucopia of potential logical bugs. You can die of multiple illnesses so there's no point in developing treatment for any particular one of them. > I like cor
73.
▲
by
dureuill
3y ago
> Can you give some examples of those tools? ASAN (address sanitizer), UBSAN (undefined behaviour sanitizer), Valgrind. All of these only detect runtime violations, so they can find bugs but don't prove their absence. On top of that
74.
▲
by
dureuill
3y ago
> It does have a lot of developers saying good words for it whenever there is a chance in recent few years, but the reality is that, it's hard for most developers to learn, because of that it might remain to be a niche language for
75.
▲
by
dureuill
3y ago
Thanks for the elaboration. Now I'm wondering if this hasn't something to do with bottom-up people vs top-down people and their natural affinity towards lower level or higher level languages. I'm very top-down, always startin
76.
▲
by
dureuill
3y ago
Really? Coming from C++, learning Rust felt very natural and welcome because it put a name and a structure to the mental model I had been using to keep a semblance of sanity while doing C++. Maybe learning primarily with C++11 was a factor?
77.
▲
by
dureuill
3y ago
To be precise, Rust will refuse to compile code that accesses the value without checking that it is not empty. Rust does that with the combination of "sum types" (aka "enums with data") and pattern matching. An `Option&l
78.
▲
Squeezing millions of documents in 128 TB of virtual memory
(blog.meilisearch.com)
14 points
by
dureuill
3y ago
|
5 comments
79.
▲
by
dureuill
3y ago
I decided to take the plunge:-) As a systems programmer I believe it will have useful content for me, and I want to support the initiative
80.
▲
by
dureuill
3y ago
Another great write-up on lwn.net. Really makes me consider subscribing. More on the topic I'm wondering how the remaining users of buffer_head could possibly migrate? Especially since we're talking filesystems I'm guessing w
81.
▲
by
dureuill
3y ago
While one shouldn't submit every software update to hn, I found the discussion about valgrind development interesting: how the scattered online presence with various tools makes contributing harder. I'm wondering how feasible it w
82.
▲
Valgrind 3.21 Is Out
(nnethercote.github.io)
15 points
by
dureuill
3y ago
|
2 comments
83.
▲
by
dureuill
3y ago
True, but also worse than that: if an unrelated application starts consuming slightly more memory it can trigger an oom kill of your application
84.
▲
by
dureuill
4y ago
> When the do_not_compile_this_code is opened in VS Code with the rust-analyzer plugin, the editor expands the some_macro!() macro. This macro reads then content of ~/.ssh/id_rsa_do_not_try_this_at_home and deletes the file. Is
85.
▲
by
dureuill
4y ago
> And it might be a bit faster, but you are really working for the paycheck that day when the obvious thing is to run the basic A* algorithm twice with different configuration steps. Pretty much this. Attempt to find a path to the target
86.
▲
by
dureuill
4y ago
From reading the article, I get that the latest version can transform some C into safe Rust. This gains us machine-proved memory safety. This is huge.
87.
▲
by
dureuill
4y ago
I get the "theoretical" point, but the issues I encountered in practice are closer to the ones I listed in my response than to valueless_by_exception (which I never encountered, I think?). Wrt type safety we had more pressing issu
88.
▲
by
dureuill
4y ago
> Variant types where one has to use objects as types don’t come up that often in API design or data structures in my experience with mobile and system programming on e.g. Linux You can't use what you don't have, so you adapt t
89.
▲
by
dureuill
4y ago
Yes, but: - nobody uses it in the ecosystem. As outlined in the article, a lot of value of Option/Result is derived from their pervasiveness in the Rust ecosystem. C++ is far from this - the ergonomics of it are terrible: no pattern ma
90.
▲
by
dureuill
4y ago
> Do you have an illustrative example? Illustrative, I don't know, but I'll try to give more context. When writing a library, it is important that public items (like functions and enum) don't change between minor versions
More ›