Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
phpnode
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
36 ms
·
451.
▲
by
phpnode
6y ago
in addition to counting dependents you can also run the graph through pagerank to find the most impactful files to convert first. This strategy is useful when converting codebases from JS to TS too because it's common to incorrectly ty
452.
▲
by
phpnode
6y ago
I'm saying that's a different argument, and not one I raised. You incorrectly inferred my meaning from my original post and are now doubling down, I'm not sure why. It's as simple as this: We want to produce as much food
453.
▲
by
phpnode
6y ago
I'm talking about the process of turning sunlight into food. If you want to make that process use as few resources as possible (especially fossil fuels) then you need big fields with large machinery. Distribution of wealth is a differe
454.
▲
by
phpnode
6y ago
No, I mean it's less efficient. A large field can be farmed with larger machinery which is more fuel, time (and yes, cost) efficient than smaller machinery. There is less time spent moving between fields which can be critical for somet
455.
▲
by
phpnode
6y ago
It's not just that, certain pieces of equipment (combines in particular) are needed at the exact same time in multiple different places, and a delay of a day or even a few hours can be ruinous (if you don't harvest wheat at exactl
456.
▲
by
phpnode
6y ago
Definitely, but smaller fields are a lot less efficient unfortunately.
457.
▲
by
phpnode
6y ago
Why did you feel the need to edit your post to include those examples?
458.
▲
by
phpnode
6y ago
> There is no way the first group to land there will be able to establish dominance over the whole planet in one go. Every potential adversary is approaching from the same direction and you have weeks / months of warning before they
459.
▲
by
phpnode
6y ago
Wind turbines can be incredibly dangerous, I'd be worried if this was anywhere near my home. jacquesm wrote up his experiences making a wind turbine from scratch here: https://jacquesmattheij.com/how-to-build-a-windmill
460.
▲
by
phpnode
6y ago
> I'd say there should be an exception for ransomeware cases where physical safety is being threatened. doesn't that incentivise attacks on critical services/systems?
461.
▲
by
phpnode
6y ago
They set up the incentive structure, they're responsible for the effects
462.
▲
by
phpnode
6y ago
If everything is political then nothing is political and the term loses all meaning
463.
▲
by
phpnode
6y ago
all of the functionality happens at compile time
464.
▲
by
phpnode
6y ago
A while ago I built this exact mechanism for Flow, it could be done in TypeScript if there was enough demand for it (it's rather a large effort) https://gajus.github.io/flow-runtime/
465.
▲
by
phpnode
6y ago
there's the reflect-metadata package but the type information it exposes is very limited, "object" instead of {a: "foo"} and so on.
466.
▲
by
phpnode
6y ago
I wrote an article about this a while ago: https://codemix.com/opaque-types-in-javascript
467.
▲
by
phpnode
6y ago
I don't think even ReScript can do this (yet?)
468.
▲
by
phpnode
6y ago
yep!
469.
▲
by
phpnode
6y ago
same mechanism, just deal with more edge cases. e.g. whitespace isn't really trimmed correctly at the moment, it doesn't handle escaping quotes in strings and so on. I did think about trying to match postgres's grammar but it
470.
▲
by
phpnode
6y ago
oh let's be clear there's no sensible real world use cases of this thing. it's a demonstration of what TS's type system can do
471.
▲
by
phpnode
6y ago
it's a bit fragile only due to my laziness, it could be done properly if this were a serious project.
472.
▲
by
phpnode
6y ago
> The implementation isn't even that horrible You're making me blush! The list of integers could be replaced by using tuples and reading their lengths to do basic arithmetic. Might run into recursion limits though.
473.
▲
by
phpnode
6y ago
hover over the type annotations to see results in the playground, that's the output :) The errors aren't really errors, just warnings about unused types
474.
▲
Show HN: A SQL database implemented purely in TypeScript type annotations
(github.com)
426 points
by
phpnode
6y ago
|
191 comments
475.
▲
by
phpnode
6y ago
I used to be a big fan of the idea of schema.org, but it seems to be used by Google to keep as much traffic as possible on Google properties.
476.
▲
by
phpnode
6y ago
Writing an alternative babel plugin to do the transform this way would be pretty trivial, but doing so for TypeScript is not (officially) possible. TS is going to choose one and it's going to be the one React uses. Also the decision to
477.
▲
by
phpnode
6y ago
It can be done if you write your code like this: function MyThing() { return ( el(A, {value: 123}, [ el(B, {value: 456, foo: true}, [ el(C, {awesome: true}), el(D, {awful: false})
478.
▲
by
phpnode
6y ago
JSX is a tree of deferred function calls. It's nothing to do with HTML, despite them looking similar. Normal function calls are not equivalent
479.
▲
by
phpnode
6y ago
This is a missed opportunity to make JSX more than solely about UI and I'm pretty disappointed about it. JSX is really a way to describe a hierarchy of deferred function calls independent of their callers. This could be tremendously us
480.
▲
Show HN: A SQL database engine implemented solely in TypeScript type annotations
(twitter.com)
3 points
by
phpnode
6y ago
|
0 comments
More ›