3 ms·
Sorry for the stupid question but how is this even possible for a compiled language? Will the program simply crash without an error message?
by olalonde 15y ago
Sorry for the stupid question but how is this even possible for a compiled language? Will the program simply crash without an error message?
- IsTom 15y agoIt will simply crash with an error message.
- Chirono 15y agoInstead of failing with an error at compile time, it will emit code that, if run, will fail with a 'type error' at run time.
- strager 15y agoIn short, compiled type errors are replaced with `assert(0);` (which doesn't return).
- gtani 15y agoPerfectly valid question. This explains the practice in incremental dev or refactoring of using "undefined" in stub/placeholder functions to get the type signatures but not function bodies in: http://www.fatvat.co.uk/2009/09/generating-text-in-haskell.html http://www.fatvat.co.uk/2009/09/generating-text-in-haskell.h... Also: 2 longish threads about this http://www.reddit.com/r/programming/duplicates/tjeg3/haskell_was_a_statically_typed_language_now_you/ http://www.reddit.com/r/programming/duplicates/tjeg3/haskell...
- ralfn 15y agoWell, they just fix the error by replacing the offending code with code that emits a run-time type error.
- olalonde 15y agoThanks, that explains it.