Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
bcherny
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
46 ms
·
541.
▲
by
bcherny
9y ago
> It seems inevitable to me that eventually (might take decades), Haskell-level type systems will be the norm That would be exciting, but I can't help but wonder if FP is just a matter of taste. We had Smalltalk and ML in the 70s, C
542.
▲
by
bcherny
9y ago
I agree on both points. An interesting facet of your 1st point is Stroustrup's Rule [0], which gives more context for an explicit `nominal` keyword. [0] https://thefeedbackloop.xyz/stroustrups-rule-and-layering-ov...
543.
▲
by
bcherny
9y ago
I agree they waited too long for strict nulls! However, both features I linked at currently proposed seem to be backwards compatible, so hopefully no switch.
544.
▲
by
bcherny
9y ago
You are misunderstanding what I said. Either one of the 2 issues I linked would fix the specific problems you outlined. You don't need a globally sound type system, H-M inference, or anything like that to fix those specific problems; l
545.
▲
by
bcherny
9y ago
I'm not sure I understand why you think that. TypeScript explicitly prefers real world usability to theoretical soundness, so if the community is vocal about the need for these features, I don't see why TS would turn them down.
546.
▲
by
bcherny
9y ago
You're treating this specific case as a fundamental issue, when it's a specific and superficial one that can be reasonably addressed in a future TS release: See for example: - Nominal types proposal https://github.com&#
547.
▲
by
bcherny
9y ago
Does anyone know who is behind the Fidget Spinner phenomenon? A few months ago they didn't exist, and now they're everywhere. Who's getting rich off this?
548.
▲
by
bcherny
9y ago
Not sure I see what you're saying. Requires are impossible to statically analyze in some pathological cases, which is why more rigidly defined imports made it into the ES2015 spec. That's totally unrelated to classes vs. functions
549.
▲
by
bcherny
9y ago
I'm currently on the Free Will chapter of Aaronson's Quantum Computing Since Democritus [0], where he treats this question directly in the context of computational complexity theory. Highly recommended to anyone interested in this
550.
▲
by
bcherny
9y ago
Again, maybe a concrete example would help?
551.
▲
by
bcherny
9y ago
Can you give some examples (or better, a writeup) about how static analysis is hard without classes? It seems like Haskell gets along fine without it.
552.
▲
by
bcherny
9y ago
That is a dangerous attitude for a society. If we disagree with a law, we should change it. If we don't we breed a disregard for all laws, not just the ones we disagree with.
553.
▲
by
bcherny
9y ago
Awesome. So we have 159,359 downloads via brew over the last year.
554.
▲
by
bcherny
9y ago
I have used Flow for a few projects. I think we're saying the same thing. By "linter" I mean a program that only checks for stylistic and defined/undefined errors. To me, anything beyond that is a typechecker. Whereas TS
555.
▲
by
bcherny
9y ago
Good catch. I also couldn't get numbers for `brew install flow` - are these tracked somewhere?
556.
▲
by
bcherny
9y ago
Flow is definitely not a Linter. It is a language, like TypeScript. It also has a typechecker, like TypeScript. Unlike TS, which bundles in its own compiler, Flow relies on projects like Babel to provide a compiler. In either case, compilat
557.
▲
by
bcherny
9y ago
Have you actually used TypeScript? It's just as incremental as Flow, especially in newer versions. I converted a 100k line Coffee + ES6 codebase to TS with no issues.
558.
▲
by
bcherny
9y ago
According to npmjs.com: - TypeScript: 4,745,783 downloads in the last month - Flow: 889,612 downloads in the last month
559.
▲
by
bcherny
9y ago
Wait, Excel had this built in since 2013! https://support.office.com/en-us/article/Use-AutoFill-and-Fl...
560.
▲
by
bcherny
10y ago
For your 1st example, it's failing because by explicitly annotating `promisedString` you are widening the type from the inferred `number` to `any`. If you remove the explicit annotation and let TS do its job, the code will fail (as exp
561.
▲
by
bcherny
10y ago
As far as type systems/language features: TypeScript: - Structurally typed - Enum types - Mapped types - Abstract classes - Scoped class members (public, private, protected) - Namespaces Flow: - Nominally typed - Covariance/contra
562.
▲
by
bcherny
10y ago
It's a good question! For any use case where there is a set of servers and a set of clients that interact with those servers, you often end up having to hard-code API contracts and response shapes on each client and each server. If you
563.
▲
by
bcherny
10y ago
JSONSchema has a concept of "$refs", which is a way to encode a pointer to a value in a JSONSchema. $refs can point to another node in the same graph, a node in another JSONSchema on the same filesystem, or a node in another JSONS
564.
▲
by
bcherny
10y ago
Funny how ideas tend to arise in unison :)
565.
▲
by
bcherny
10y ago
Awesome work. Expressing concepts that TS's type system can't handle (eg. minimum) as comments is an approach that I didn't consider. So far I've been focused on the idea of generating decorators [0], but comments seem l
566.
▲
by
bcherny
10y ago
Lofi looks cool! Is the advantage over the more broadly used Protobuf or JSONSchema just the leaner syntax?
567.
▲
Show HN: JSONSchema to TypeScript compiler
(github.com)
72 points
by
bcherny
10y ago
|
34 comments
568.
▲
by
bcherny
10y ago
Are there any details on how the fingerprinting worked? And why it was needed? Not being an iOS dev, after a few minutes of Googling it looks like: - The blessed way to get a unique device ID is identifierForVendor [1]. Is the issue that th
569.
▲
by
bcherny
10y ago
No giveaways in the source code - will probably have to wait for the author to comment!
570.
▲
by
bcherny
10y ago
Given how much content is generated on online forums, it is natural to have a mechanism to surface better/relevant content (different forums define relevance differently). Otherwise you have to wade through a sea of memes and low quali
More ›