3 ms·
I was just trying to combat the common narrative that static types are "what Java has". There is so much potential for static typing that has not been explored
by grumpyprole 3y ago
I was just trying to combat the common narrative that static types are "what Java has". There is so much potential for static typing that has not been explored by industry (e.g structural typing).
- kaba0 3y ago(That common narrative is also quite negative, Java’s type system is surprisingly strong and can express many more things than people give it credit for. See jooq, or several FP java frameworks)
- grumpyprole 3y agoJooq is not a good example as it is essentially dynamically typed. Queries on the relational algebra can be statically typed, with structural typing and a few type-level features like sets. There are lots of papers on this.
- kaba0 3y agoIt is quite statically typed, look at the examples. You might be thinking of the stringly-typed version, but it can generate classes from DB inspection and use columns and whatnot with its respective type throughout a query, failing to compile when a group by value is incorrect! It can’t verify everything what a SQL engine can of course, but it is quite remarkable in my opinion.