Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Twisol
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
55 ms
·
541.
▲
by
Twisol
6y ago
From my perspective, these really are more like enums than unions. Rust enums cover C-style enums as a limiting case: enum Result { Ok, Err, } If this was all you got, you'd need to return something like `(stat
542.
▲
by
Twisol
6y ago
Per the sibling conversations: instead of having the compiler tell users about traits that are implemented by both arm types, maybe it would be more productive to tell users how the issue arises from static dispatch considerations? Maybe if
543.
▲
by
Twisol
6y ago
I think the key idea here is that Rust consistently uses static dispatch by default. When you invoke some method defined by a trait, it needs to look up at compile-time which actual implementation it should dispatch to. Since the if-else
544.
▲
by
Twisol
6y ago
That snippet gives a warning: "trait objects without an explicit `dyn` are deprecated". Adding the `dyn` in the right place (`&mut dyn Iterator<Item=i32>`) makes it a little more clear that you're still paying the c
545.
▲
by
Twisol
6y ago
Exceptions kind of muck with things, since you want to be able to establish handlers further up the stack. Compiling async/await to callbacks means also compiling exceptions down to a different mechanism, which makes it difficult to ge
546.
▲
by
Twisol
6y ago
I think programming is more than just algorithms. System design and architecture have a real impact on the longevity and maintainability of your system, and I'd argue that data models (not structures per se, the distinction being log
547.
▲
by
Twisol
6y ago
> Excellent explanation! I think this is far better than my post at explaining why optics are so useful. Thank you! > I'm not sure this has anything to do with profunctor optics per se Yes, fair! I didn't mean to imply tha
548.
▲
by
Twisol
6y ago
In the face of mutation and dynamic typing, yes, an iterator providing mutable references to the focused piece of the subject would give you something basically like a traversal (a generalization of a lens over list-like things). However, c
549.
▲
by
Twisol
6y ago
Removing a piece is scarier, because it feels so delicate, but you get plenty of tactile feedback from the piece you're pulling that tells you whether you're doing a dumb and should switch pieces. If there are no viable pieces, yo
550.
▲
by
Twisol
6y ago
They were a preview feature until Java 16, though, so they probably haven't seen wide use yet. https://openjdk.java.net/jeps/395 Java 16 was only released within the last few weeks! (Gradle still has some trouble
551.
▲
by
Twisol
6y ago
This 5-minute POPL video seems like a good introduction to the "why" of e-graphs. https://www.youtube.com/watch?v=ap29SzDAzP0 Seems to be useful in term-rewriting applications.
552.
▲
by
Twisol
6y ago
There's a lot of nuance, but my rule of thumb isn't so far off from the comment's above you. My Twitter avatar is a picture of a fractal I generated with my own software. That reveals (fuzzily) a certain non-obvious aspect of
553.
▲
by
Twisol
6y ago
Perhaps naively, would a struct-of-arrays perform better than an array-of-structs? I imagine that the separate `next` and `data` arrays might be packed better, and instead of processing one cache line at a time, you could load two cache lin
554.
▲
by
Twisol
6y ago
I'm not so sure. It's better than a late night window in that it forces their customers to actually deal with the engineering window, rather than just cross their fingers.
555.
▲
by
Twisol
6y ago
I last read this article before I started grad school (in computer science). I'm reading it again, now, more than two years after I left. My experience was the polar opposite, if the poles were bent around like a horseshoe magnet. Rath
556.
▲
by
Twisol
6y ago
It's barely even a joke to me anymore -- it's just too real for me to laugh. (Cache invalidation is essentially the same problem as managing mutable state -- "Out of the Tar Pit" frames mutable state as either essential
557.
▲
by
Twisol
6y ago
And you'd have essentially replaced statically understood control flow with the equivalent of a computed goto. It's not like it's a bad approach, but from a code path standpoint, it's unequivocally worse, not better. (Im
558.
▲
by
Twisol
6y ago
> This is basic DRY violation. The number is duplicated twice 2 and that can get out of sync (as in the example). I think it's pretty clear that the number is a placeholder for something reasonable, e.g. making an association betwee
559.
▲
by
Twisol
6y ago
The association between the two has to be written somewhere. Can you provide an alternative approach that isn't vulnerable to typos?
560.
▲
by
Twisol
6y ago
The article seems to be saying that there really is some physical phenomenon occurring here -- effectively, "cross-feed" between coupled fields -- but that this phenomenon doesn't obey the relations that define a "partic
561.
▲
by
Twisol
6y ago
And I think that speaks to the current state of type system research on communicating processes, not to any fundamental inability thereof. Session types are a recent approach (though one that I don't think goes far enough; give me full
562.
▲
by
Twisol
6y ago
The referenced argument rests on superluminal communication, not elegance. The quaternions are not even sufficient, unless we believe that superluminal signaling is physical.
563.
▲
by
Twisol
6y ago
Another commenter linked this post by Scott Aaronson: https://www.scottaaronson.com/blog/?p=4021 The money quote (which leads a few more paragraphs on the details) is this: > But, while I remain less than 100% satis
564.
▲
by
Twisol
6y ago
The line "X snaps his fingers in front of you" still makes my adrenaline pump for an instant o_o
565.
▲
by
Twisol
6y ago
That's true! I did very little combat overall -- I spent most of my time on the social side of the game -- but I did build a few of my own convenience scripts anyway, so the criticism is well-founded. You can get by in PvE without anyt
566.
▲
by
Twisol
6y ago
> Do you take the time to understand everyone you meet, their motivations, their goals, and their challenges? Even the ones who don't want you to? To the degree our relationship warrants. Don't you? We all form mental models of
567.
▲
by
Twisol
6y ago
(context: I played Achaea without access to a source of cash) Back when I played, you could buy "artefacts" with real money, but they were less "pay to win" and more "pay for convenience". They were definitely
568.
▲
by
Twisol
6y ago
Former player of Achaea here (if anyone recognizes the name Soludra) -- can attest, the Iron Realms MUDs are top-tier. I tried to get into volunteering, but my work ethic wasn't really up to snuff at the time. Sorry ^_^;
569.
▲
by
Twisol
6y ago
> E.g. INTX will LIKELY have to put in more conscious effort to improve social skills in order to better communicate with people I knew I needed to work on my social skills long before I tested as an INTP. My criticism is not that the co
570.
▲
by
Twisol
6y ago
What 'pseudalopex mentioned -- and also note that I was responding to someboody who grouped INTJ/INTP together. I don't have much of a vested interest in MBTI; I was just trying to work from the ancestor post's foundatio
More ›