Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
kaoD
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
19 ms
·
301.
▲
by
kaoD
2y ago
There's a middle ground where apps are sandboxed but you're still in full control... But of course OS vendors will not allow that, so we're just daydreaming here.
302.
▲
by
kaoD
2y ago
"Trait objects" is lingo for `dyn Trait`. They are a distinct thing from just "trait". They allow virtual dispatch at runtime. See https://doc.rust-lang.org/reference/types/trait-object.html (`
303.
▲
by
kaoD
2y ago
To give additional context: bullet chess can go down to 1 minute per player. Lying about a few millisecond per move there is huge .
304.
▲
by
kaoD
2y ago
What does "emulating low frequencies" mean?
305.
▲
by
kaoD
2y ago
Nice. I'm looking to migrate away from a legacy custom framework over Express and this could help. If someone has tried both, can anyone share how it compares with tRPC[0]? [0] https://trpc.io/
306.
▲
by
kaoD
2y ago
> Or am I just crazy and this isn't an issue for anyone else? Not an issue for me, to be honest. Why does it bother you at all?
307.
▲
by
kaoD
2y ago
Does/will this correctly handle `| undefined` vs `?`, i.e. correct behavior under `exactOptionalPropertyTypes`? Zod doesn't (yet[0]) and it's been a pain point for me. [0] https://github.com/colinhacks/zo
308.
▲
by
kaoD
2y ago
I've been trying to come up with a similar pattern in TS many times but I think you cannot do this due to the lack of moves (bindings do alias, pass by reference). But TS has so many dark magical patterns that I'm still hoping to
309.
▲
by
kaoD
2y ago
> Rust's object lifetimes, for all the performance gains you get Lifetimes are not about performance gains. They're about correct behavior under concurrency, which you have even on JS with async-await. Heck, let me correct that
310.
▲
by
kaoD
2y ago
As someone who loves both TS and Rust: you couldn't be more wrong. TS is not even half as good at making invalid states unrepresentable. A simple example of the (many) things you can't do in TS: struct StateStart; struc
311.
▲
by
kaoD
2y ago
> Not talking about typescript. TS is just encoding JS semantics into a type system. A function returning a fixed-size array in JS is effectively returning, semantically, a tuple. They're just not a different type unlike in other la
312.
▲
by
kaoD
2y ago
Funny you mention that https://react.dev/learn/react-compiler
313.
▲
by
kaoD
2y ago
https://react.dev/learn/you-might-not-need-an-effect
314.
▲
by
kaoD
2y ago
Unless my memory is very hazy none of that is related to hooks. Identity in React has always relied on vDOM structure or `key` which was introduced in React 0.4.0 (July 17 2013, <2 months after initial public release). > For me, it&#x
315.
▲
by
kaoD
2y ago
Exactly! To be honest they're not full-blown coroutines (since the React runtime cannot control when the component progresses) which might be a bit more complex to grasp... but the idea of "yielding control" to someone else (
316.
▲
by
kaoD
2y ago
> some sort of warning about side effects would be beneficial Rendering twice is exactly what allows you to detect that. How would you detect a side effect if not by calling the function twice? React's contract is that your componen
317.
▲
by
kaoD
2y ago
I understand the complaint but my point is that, in my experience (which admittedly might be biased), the complaint usually does not resonate with anyone that did actually use React for at least a moderately complex app. Hook's API is
318.
▲
by
kaoD
2y ago
I'll try to fix the comment you're replying to: I think of React components as not closures but coroutines (and hooks are its yield points). Hooks are implicitly keyed by index which is the most magic-y/surprising part... but
319.
▲
by
kaoD
2y ago
> Hooks ruined the framework imo. Confusing api (useState returning an array for example). It just returns a tuple. That's not confusing at all and it's a very well established pattern in most modern languages. If there's
320.
▲
by
kaoD
2y ago
I disagree. This only encourages companies not to disclose such issues.
321.
▲
by
kaoD
2y ago
> ringless controllers I was never bothered by the Q2 controller rings. On the contrary: they saved my knuckles from punching straight into my ceiling (oh how I miss Echo VR!)
322.
▲
by
kaoD
2y ago
This was on their example LLaVA 1.5 7b q4 with all default parameters which does not specify chat or instruct... but after the first message it actually worked as expected so I guess it's RLHF'd for chat or chat+instruct. I don&#x
323.
▲
by
kaoD
2y ago
Well this was my experience... User: Hey, how are you? Llama: [object Object] It's funny but I don't think I did anything wrong?
324.
▲
by
kaoD
2y ago
I'm on mobile and this PDF is notoriously hard to navigate here. What did they spend the other $370m on!?
325.
▲
by
kaoD
2y ago
In what way is ignoring this pragmatic? https://developers.google.com/search/docs/specialty/internat... > If your site has locale-adaptive pages (that is, your site returns different content based on the p
326.
▲
by
kaoD
2y ago
Because the world is imperfect and having URLs instead of using content negotiation makes a far better user and SEO experience so that's what we do in practice. IOW pragmatism.
327.
▲
by
kaoD
2y ago
You said accept headerS and since the thread was about localization I assumed you meant Accept-Language. To answer your comment: yes you should return the same content (resource) from that URL (note the R in URL). If you want/can, you
328.
▲
by
kaoD
2y ago
See sibling comments.
329.
▲
by
kaoD
2y ago
Quoting MDN https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ac... > This header serves as a hint when the server cannot determine the target content language otherwise (for example, use
330.
▲
by
kaoD
2y ago
> It makes some sense, too because the edges are blurry. If a user from France receives a french version on the same URL where a US-user would receive an english version, is that already different content? The recommended (or rather corr
More ›