Hacker News new | past | comments | ask | show | jobs | submit login

You do realize that you're moving part of the cognitive load until later and increasing it when you have to implement a type checker in unit tests for every program you write.



Yes and?

I have the full power of the language to force type correctness instead of some janky meta language.


And if you're really good, you'll use that full power to develop a toolset of useful ways to verify that certain properties about your code hold! You'll see common errors and write infrastructure to help your unit tests ensure those errors aren't happening. You might even add annotations into your code as you write it to automatically write those unit tests for you. And you will have invented ... the Inner Type System!


Yes, a great thing to do for a dsl that you write in your real language. Not something that a real language should have.


You also don't have the power to force anything, just the power to check if it's correct in a few of the infinitely many cases.

And yes, as a sibling comment said, dependently typed languages let you use the entire language to specify types.


Most dependently typed languages allow you to use the full power of the language to specify types.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: