Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mistercow
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
61.
▲
by
mistercow
1y ago
Just to make sure I understand this (and maybe clarify for others too), because my understanding of proof-of-work systems is very high level: When you mine a block, you’re basically bundling up a bunch of meaningful data, and then trying to
62.
▲
by
mistercow
1y ago
What they seem to be claiming is that because the wood itself contains more carbon that is used to produce the turbine, they have net negative carbon emissions before accounting for actual energy production. That seems pretty dubious to me.
63.
▲
by
mistercow
1y ago
I think we need to find a way to teach without grades. That is, we do know how to teach without grades at younger levels, and many schools do it successfully. The problem is that eventually you need to measure for placement, and Goodhart’
64.
▲
by
mistercow
1y ago
> No one to day learns that anymore. The vast, vast majority have no idea and I don’t think people are dumber because of it. Arguably, the kind of person who was helped by learning to do that by hand still learns to do it by hand, but be
65.
▲
by
mistercow
1y ago
I mean it’s an explicit violation of that philosophy as noted in the proposal: > For this reason, the W3C TAG Design Principles recommend against creating APIs that expose garbage collection. It's best if WeakRef objects and Finaliz
66.
▲
by
mistercow
1y ago
Fair, I wasn’t aware of that. But even so, there’s a big difference between a wonky feature intended for niche cases and documented almost entirely in terms of caveats, and “this is the new way to dispose of resources”. And the point that t
67.
▲
by
mistercow
1y ago
Another point there is that JS has always gone to great lengths not to expose the GC in any way. For example, you can’t enumerate a WeakSet, because that would cause behavior to be GC dependent. Calling dispose when an object is collected w
68.
▲
by
mistercow
2y ago
> I don't buy it, no brand can be accurate on energy expenditure because it depends on a lot more things than what the watch can monitor. You could say the same about virtually every modeling problem, yet the world runs on models th
69.
▲
by
mistercow
2y ago
It’s interesting to me how often papers do this, where even after reading the abstract, it’s hard to tell in what context they’re using key words, and by extension, what the paper is actually about. My loosely held feeling is that this is a
70.
▲
by
mistercow
2y ago
Or a separate effect where people whose doctors tell them they’re a diabetes risk tend to make a token switch to artificial sweeteners, but don’t take other, more effective steps.
71.
▲
by
mistercow
2y ago
Assuming you’ve framed it fairly, that’s a pretty atrocious point of view for someone calling themselves a privacy expert to hold. A privacy expert should know that backdoors are dangerous to privacy even if you trust the people who are sup
72.
▲
by
mistercow
2y ago
I wonder if this is a case where you want an encoder-decoder model. It seems very much like a translation task, only one where training data is embarrassingly easy to synthesize by just grabbing sentences from a corpus and occasionally swa
73.
▲
by
mistercow
2y ago
> We used to get kids to smoke pipes to stave off chest infections because it made “intuitive sense” and it’s only because of observational studies that we now believe smoking causes lung cancer. This is an interesting example, because I
74.
▲
by
mistercow
2y ago
I think it's because the media coverage is all focused on how this means the big AI players have lost their competitive advantage, rather than the other side of the equation. But that's also dumb, because "huge leap forward i
75.
▲
by
mistercow
2y ago
Has anyone done a benchmark on these reasoning models compared to simply prompting "non-reasoning" LLMs with massive chain of thought? For example, a go to test I've used (but will have to stop using soon) is: "Write s
76.
▲
by
mistercow
2y ago
TypeScript enums were added in large part because union types didn't exist at the time. Those don't require you to write out anything like the above. The only case where you would need to write out number literals like that would
77.
▲
by
mistercow
2y ago
No, this is what I suggest for someone who wants to do something non-idiomatic because they're used to C. What I suggest in most cases is just a string union type. Edit: But for what it's worth, yes, the above is still more elegan
78.
▲
by
mistercow
2y ago
> Not to mention that you can add documentation to each of the entries. You can do that with either other solution.
79.
▲
by
mistercow
2y ago
Being able to set up a node project like a web server without configuring or maintaining any build steps is pretty nice.
80.
▲
by
mistercow
2y ago
That doesn't give you a type that you can use for the actual enum values. If you wanted a function argument to take in one of your enum values, you'd still have to use keyof in the signature like: function doSomethingWithMyEn
81.
▲
by
mistercow
2y ago
I think that's part of the underlying issue in every case, but then there sometimes seems to be some kind of bug where TS won't agree that the value actually has that nominal type, despite it originating from the enum itself. I us
82.
▲
by
mistercow
2y ago
Well, that's basically how you would have done it in vanilla JS before typescript came around. The main awkwardness is the type definition. I often prefer to use a library like type-fest for this kind of thing so you can just say:
83.
▲
by
mistercow
2y ago
But why? The feature offers almost no benefit in TS at this point over other existing features, has no function in JS other than TS compatibility, and is increasingly flaky in TS itself. Adding more complexity to JS rather than simplifying
84.
▲
by
mistercow
2y ago
> Changing values (after a change in an external interface), tracking use and renaming is harder in the first case. You can rename the elements of a string union with the typescript language server. In VS Code at least, it's just li
85.
▲
by
mistercow
2y ago
I think they also haven't gotten very much attention in the last few years as new features have been added. Nine times out of ten, if I hit a weird case where TS doesn't understand some type that it really seems like it should u
86.
▲
by
mistercow
2y ago
What in your view is the downside to doing this? export const MyEnumMapping = { active: 0, inactive: 1 } as const export type MyEnum = typeof MyEnumMapping[keyof typeof MyEnumMapping]; So you have the names exp
87.
▲
by
mistercow
2y ago
> Often, I find myself in need to find all references of "Active" from your example, which doesn't work with union values. I'm able to do that just fine in VS Code / Cursor. I set up a union like this: expo
88.
▲
by
mistercow
2y ago
Come on, now. > maybe in the future JS runtimes might be able to strip away types for you without a build-step. You can't backpedal from that to "speaking about the specification". It's not future JS runtimes. It'
89.
▲
by
mistercow
2y ago
I think the difference is just that (IME at least) those other features seem a lot more rarely used than enums. Enums are a feature that maps onto a common language concept, and which new TS devs reach for because they give first class supp
90.
▲
by
mistercow
2y ago
I’ve also seen them behave very weirdly and inconsistently. There have been cases when I’ve had to explicitly declare that a value has an enum type, even though its type is already one of the enum’s values (and not a literal of the same val
More ›