4 ms·
You're looking for refinement-types? Scala to the rescue: https://github.com/fthomas/refined https://github.com/fthomas/refined And a new one: https://githu
by still_grokking 5y ago
You're looking for refinement-types?
Scala to the rescue:
https://github.com/fthomas/refined https://github.com/fthomas/refined
And a new one:
https://github.com/Iltotore/iron/ https://github.com/Iltotore/iron/
The latter will be zero overhead once a compiler ticket is closed.
Both solutions will yield compile time checks where possible, and fall back to runtime checks when the data isn't statically known.
- still_grokking 5y agoRelated to refinement-types is the concept of "parsing, not validating": https://news.ycombinator.com/item?id=21476261 https://news.ycombinator.com/item?id=21476261 https://news.ycombinator.com/item?id=27166162 https://news.ycombinator.com/item?id=27166162
- ragnese 5y agoYeah, pretty much. I know such things exist on the periphery, but I think it's extremely disappointing that we keep churning out "new" languages that are basically "Here's C again, but with one interesting feature from the 70s!" I worked on a Scala once several years ago and I really didn't "get it". The more I use Kotlin, the more I wish it were Scala.