1 comment

[ 3.0 ms ] story [ 14.8 ms ] thread
to me, the point of Types is to enforce constraints in a way which can be applied at compile time to remove the need at runtime because your code is shown to conform to the types expectations. Most of what is said here goes to the observations you can make about a type, under its code use. Readability is sort of orthogonal to this, I mean I love it, but in the end, an unreadable program in APL which conforms to type checks is a strong proof of correctness, even if terse.

How do you know your inlined efficient thing will never be used elsewhere? How does this work under future extensibility? Now you have to refactor simply to get it back out of macro-land, into a proper function and re-do ALL the type analysis to make sure you haven't broken the rules.

Post hoc inlining of a function with only one call feels like a thing the compiler can do for you?