Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
simonask
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
331.
▲
by
simonask
10mo ago
Using LLVM somewhere in the build doesn't require that you compile everything with LLVM. It generates object files, just like GCC, and you can link together object files compiled with each compiler, as long as they don't use compi
332.
▲
by
simonask
10mo ago
What they mean is that the Linux kernel has a long-standing policy to keep the whole kernel compilable on every commit, so any commit that changes an internal API must also fix up _all_ the places where that internal API is used. While Rust
333.
▲
by
simonask
10mo ago
In any struct where all fields have the same size (and no field type requires higher alignment than its size), it is guaranteed on every (relevant) ABI that there is no padding bytes.
334.
▲
by
simonask
10mo ago
I'm no expert, but the narrative is that it really depends what you need them for. And keep in mind that joining the jet fighter programme also means joining the development of it, enacting a certain amount of influence through your fu
335.
▲
by
simonask
10mo ago
While there are several comparable European alternatives, many countries put their bets on the F-35 a long time ago. It is very much a part of this discussion. I’m from one of those countries, and I can assure you a lot of people would now
336.
▲
by
simonask
10mo ago
It's fine as long as the graph of references is immutable, or is unidirectional/acyclic with unique ownership. If you have backreferences or "parent pointers", you need `Arc<Mutex<...>>` or `Rc<RefCell<
337.
▲
by
simonask
10mo ago
It was never hard for small things. The hard part is when you have multiple people working on something, who all need to synchronize their mental model of all lifetimes in the project, or even in your own code when you come back to it in 3
338.
▲
by
simonask
10mo ago
I am too old and stupid to not use Rust. I’m kidding of course, but the mental load of doing the things we used do in C++ is really noticeable once it’s gone.
339.
▲
by
simonask
10mo ago
I don’t think it’s a useful observation. Lots of people come to Rust from OOP languages and try to make everything `Arc<dyn Interface>`, and it immediately fails, to their great frustration. Do not do this.
340.
▲
by
simonask
10mo ago
You can absolutely make a complete, featureful program in Rust without naming a single lifetime, or even without dealing with a single reference/borrow. But Rust is a dramatically smaller language than C++. The various subsets of C++ p
341.
▲
by
simonask
10mo ago
Go ahead, invent a GC that doesn’t require at least 2-4x the program’s working set of memory, and that doesn’t drizzle the code with little branches and memory barriers. You will be very rich.
342.
▲
by
simonask
10mo ago
Sure, but that’s a library limitation (no widespread common runtime interface that libraries such as Tokio implement), not a fundamental limitation of async. Thread safety is also a lot easier to achieve in languages like C#, and then of co
343.
▲
by
simonask
10mo ago
Because async and sync programming are two fundamentally different registers. There are things you can do in one that you can’t with the other, or which have dramatically different tradeoffs. As an example: Call N functions to see which one
344.
▲
by
simonask
10mo ago
The beautiful thing about the “async” abstraction is that it doesn’t actually tie you to an event loop at all. Nothing about it implies that somebody is calling `epoll_wait` or similar anywhere in the stack. It’s just a compiler feature tha
345.
▲
by
simonask
10mo ago
Again, perfectly avoidable.
346.
▲
by
simonask
10mo ago
My opinion is that if your library or function is doing IO, it should be async - there is no reason to support "sync I/O". Also, this "sans IO" trend is interesting, but the code boils down to a less ergonomic, more
347.
▲
by
simonask
10mo ago
The interesting question was always “does it perform IO”.
348.
▲
by
simonask
10mo ago
This is also why function coloring is not a problem, and is in fact desirable a lot of the time.
349.
▲
by
simonask
11mo ago
I did not say “default-constructed”, because that’s a whole other can of worms. But yes, the implication of C++ move semantics is that every movable object must also define an “empty” (moved-from) state, so you cannot have something like a
350.
▲
by
simonask
11mo ago
This is false. Moved-from is a "valid but unspecified" state in C++, so perfectly safe, but each type must decide what to do. At the minimum, the destructor must be able to run, because it will be invoked, meaning that the obvious
351.
▲
by
simonask
11mo ago
Zig does not approach, and does not claim to approach, Rust's level of safety. These are completely different ballparks, and Zig would have to pivot monumentally for that to happen. Zig's selling point is about being a lean-and-me
352.
▲
by
simonask
11mo ago
Music major here. Surprise, all music you know is “sounds with some beat”. I don’t know what counts as Music to you, but I sure hope you’re not out here trying to promote your particular taste as somehow more refined, because we know a lot
353.
▲
by
simonask
11mo ago
All of that is great, and I strongly support these initiatives, but they are all teeny tiny bandaids. Lifetimes are a crucial aspect of writing code in C++, yet they do not appear anywhere in the syntax. The same goes for synchronization. T
354.
▲
by
simonask
11mo ago
This is a case of a feature that is actively harmful for the things it tries to prevent, because it increases the risk in practice of panics "spreading" throughout a system, even after the programmer thought she had finished handl
355.
▲
by
simonask
11mo ago
My criticism is not of any particular feature in C++ (though there is much to both hate and love about it), but of a particular approach to software engineering that the language design leans into, and which even the newest iterations of th
356.
▲
by
simonask
11mo ago
In projects I've worked on, this just hasn't been the case. Mutexes, especially in Rust, can grant you a `&mut T` when what you have is `&Mutex<T>`, and that's it - failing to uphold invariants in the API surfac
357.
▲
by
simonask
11mo ago
> How can "decades of experience" show the deficiencies of Modern C++, which was invented in 2011? Please read the sentence you're quoting again.
358.
▲
by
simonask
11mo ago
This is such a weird take. What do you suggest? Should Rust’s syntax have been democratically decided?
359.
▲
by
simonask
11mo ago
> > really extreme use cases with lots of lifetime annotations and generic bounds You choose as your example a pretty advanced use case.
360.
▲
by
simonask
11mo ago
Lots of current and former C++ developers are excited about Rust, so it’s natural that it comes up in similar conversations. But bringing up Rust in any conversation still does not amount to a personal attack, and I would encourage some ref
More ›