Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dbaupp
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
60 ms
·
571.
▲
by
dbaupp
9y ago
They're zero(ish) cost at runtime, but focusing on just that is missing something: pervasive unchecked exceptions inhibit optimisations, both in compilers and in libraries, which have to be more defensive to preserve correctness.
572.
▲
by
dbaupp
9y ago
"should" is a nice ideal, but people will feel pressure, especially for tooling like a compiler that other teams depend on, where slipping schedule means slipping their schedule too. Shipping more often lessens this, by meaning a
573.
▲
by
dbaupp
9y ago
Casting pointer-to-struct to pointer-to-field is fine, yes, but is it legal to cast pointer-to-pointer-to-struct to pointer-to-pointer-to-field? (I genuinely don't know the answer to this.) The former results in a new (temporary or oth
574.
▲
by
dbaupp
9y ago
The rest of my comment fairly specifically covered that: Go nil pointers don't have runtime types (like C), Go nil interfaces sometimes do. In any case, pointers to pointers with different types seem likely to be a strict aliasing viol
575.
▲
by
dbaupp
9y ago
> The other thing I see that fools people with experience from other languages is that the "nil" pointer is not the same thing as a NULL pointer in C. In C, the NULL pointer is simply a zero with no type information connected
576.
▲
by
dbaupp
9y ago
For data in a single list, they're essentially equivalent, but they differ when one wants to put things in multiple lists. For instance, a collection of Ts might want to have a list of the ones with property A and the ones with propert
577.
▲
by
dbaupp
9y ago
I don't understand what exactly you're disagreeing with. I was strengthening "I'm sure the language designers and core developers don't actively endorse this behavior", and also mentioned how those people do
578.
▲
by
dbaupp
9y ago
FWIW, the behaviour is not just not endorsed, but actively disendorsed, e.g. the code of conduct (which applies to the Rust-team-run venues) includes "Respect that people have differences of opinion and that every design or implementat
579.
▲
by
dbaupp
9y ago
I'm curious if any allocators with size classes/buckets actually do much pointer chasing. One can theoretically have a free-list for each class, so at most one pointer needs to be dereferenced: work out the size class, load the fr
580.
▲
by
dbaupp
9y ago
They have many of the same properties as being intrusive, e.g. one can write a list type that can store any type and store it directly inline next to the next/previous pointers, not needing an allocation like the common C strategy of u
581.
▲
by
dbaupp
10y ago
> trans istor (Whoops, but my point still stands just as much.) > Mathematical facts are a very human invention, just like the transistor. I picked calculus precisely because intuition based on physical observation gives the wrong
582.
▲
by
dbaupp
10y ago
I don't see how your series or resistor examples are particularly relevant: neither mathematical nor physical facts are human inventions. The packaging is, but I'd argue that the packaging for both is relatively intuitive for so
583.
▲
by
dbaupp
10y ago
Whether or not that is true, that doesn't contradict what I said. Taking into account intuition doesn't mean one can't or shouldn't do some unintuitive things, just that it should be an explicit decision. In the extrem
584.
▲
by
dbaupp
10y ago
The reality is people form mental models by intuition. Things designed for humans to use (like programming languages) should take this reality into account.
585.
▲
by
dbaupp
10y ago
C is not precise, not as a model of modern CPUs (they're very different to the PDP-11, and compiler optimisers are very invasive) nor as a precision engineering tool (too many silent footguns and landmines adding a pile of incidental c
586.
▲
by
dbaupp
10y ago
You're correct but that's kind-of missing the point: I imagine the parent was trying to say you can have the deterministic management of non-memory resources like C++, without the downside of loosing memory safety. It's low-s
587.
▲
by
dbaupp
10y ago
I wasn't defending Mozilla so much as comparing, and specifically comparing a non-profit with two definitely-for-profit corporations. To me, it seems like even without knowing anything about Mozilla or the for-profits the balance of pr
588.
▲
by
dbaupp
10y ago
There is, at least, the political niche of being truly open source, and not built by a for-profit corporation.
589.
▲
by
dbaupp
10y ago
You make a good point (not only is parsing unnecessary, lexing-only/"ad hoc" analysis can be more resilient for many of the tasks in an editor), however your phrasing makes it sound like you're disagreeing with me, but I
590.
▲
by
dbaupp
10y ago
Why do you need to parse the language to get parens correct? For most languages, comments and strings will need to be considered, but neither of these requires doing a full parse. Of course, I don't disagree with your point that a fast
591.
▲
by
dbaupp
10y ago
For the specific case of X = Math, https://math.meta.stackexchange.com/questions/41/differences... .
592.
▲
by
dbaupp
10y ago
I believe the X Overflow are the old format, and are now just grandfathered in. All new ones are in the latter style.
593.
▲
by
dbaupp
10y ago
Your exact concern was raised and discussed earlier: https://news.ycombinator.com/item?id=14123252
594.
▲
by
dbaupp
10y ago
One thing to consider in this respect is the optimisation won't/can't separate out the subfields of a field, meaning `struct Foo { ... x: SomeStruct ... }` will reorder x as a whole, keeping the fields of SomeStruct together.
595.
▲
by
dbaupp
10y ago
> I'm not sure how Rust crates (or other compilation units) map to those - my guess would be that a given crate will be compiled into (in win32 terms) a .exe .lib or .dll You're correct. > but to me this still feels more
596.
▲
by
dbaupp
10y ago
This is a very similar sentiment to Octavia E Butler's Earthseed (from her series of the same name), a fictional religion where one of its central tenets is "The Destiny of Earthseed is to take root among the stars".
597.
▲
by
dbaupp
10y ago
I think the parent meant (global (optimisation flags)), not ((global optimisation) flags). Of course, some optimisations don't rely on UB, the difference between the unoptimised and optimised code won't be entirely based on UB (a
598.
▲
by
dbaupp
10y ago
They're not at all opposite: one can think of reasoning about types as reasoning about UB. For instance, if a value is of type `int`, it's undefined behaviour for it to be of type `float`, and so the compiler can optimise based on
599.
▲
by
dbaupp
10y ago
As the sibling points out, this is in the context of the suggestion of using Python's approach, where exceptions are not just pervasive, they are so pervasive they're used for non-errors/control flow (e.g. StopIteration).
600.
▲
by
dbaupp
10y ago
The parent correct: C++ runs destructors on all local variables, even if they have been "moved from", so it must be valid to do so. This translates into a null/"valid invalid"/sentinel state that the destructor
More ›