Hacker News new | ask | show | jobs
by nickik 5567 days ago
right you don't get type-checking only type-hinting for performance.
1 comments

In Common Lisp we have optional type declarations, and a common strategy for implementations (for SBCL, say) is to treat such declarations as assertions by default, leading to more safety, and for performance-sensitive parts of the code you can "(locally (declare (optimize speed (safety 0))))", which makes the type declarations act as performance optimizations for that part of the code.