4,901 karma · joined Sep 13, 2020 (6y ago) · 1,641 submissions
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
That leads to a reality where creators earn money from charity based on celebrity status, instead of from a trade of goods. A reality where every creator needs to be a celebrity to make ends meet is a horrifying one.
comment 3y ago · link · parent
I don’t know about the two others, but after reading about them briefly they seem as antirational as any philosophers subscribing to Hegel and/or Marx. When it comes to Lakatos specifically, I can say with certainty that his philosophy of mathematics has so little to do with mathematics that it’s not worth any paper (I studied maths and know many professional mathematicians personally).
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
> What is “foo”? Is it an Identifier or a StringLiteral?
Normally, it's an identifier, since there are no quotes. If there is ambiguity about it, the lexical categories you're working with are ambiguous, which is a real issue. When designing a grammar, that should be avoided. Sadly, sometimes we're given a poor-quality grammar like in C, where some tokens can be interpreted both as headers and as string literals (but neither is a subset of the other) and can't do anything about it, but then you just need to decide which category you're going to assign to ambiguous cases (either one of two, or make a third one) and later you can disambiguate based on context. In any case, I don't consider it an issue of the tool, but an essential domain problem to be solved explicitly by the programmer.
comment 3y ago · link · parent
There is no shifting of cost from compile time to runtime, or slowing down access. Just like with sum types you're writing match clauses from time to time, with union types you do the same. If you need to inspect the discriminant, then you need to inspect the discriminant.
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
Edit: another nice consequence of this design would be None being its own type, which can be transparently converted to an Option<T> for any T, allowing for type inference to go in only one direction, while still avoiding the boilerplate of Option<T>::None. Unidirectional type inference would make for more intelligible compiler errors. Full Hindley-Milner can get confusing.