3 ms·
Thanks a lot for the detailed answer and resources - will check them out over time. I had bought the Camel book and had read most of it, years ago. I know Curti
by vram22 10y ago
Thanks a lot for the detailed answer and resources - will check them out over time. I had bought the Camel book and had read most of it, years ago. I know Curtis a bit, nice guy.
>It has what they call gradual typing in that it is dynamic like python, but you can add types to functions that help to catch lots of errors.
Is this something like in Haskell, where I've read (not sure of the details) that you can define types related to the parts of the application or business domain / business logic, which then enables more error-checking by the compiler when you use those types in your code? It may be things like instead of using just an int, if it is meant to represent say height of humans, you might add constraints like height > 0 and height <= 10 feet (because you think or know that no human can be taller than that). Then the compiler will warn you or give an error if you try to assign a value to a height variable, which is outside that range.
Pascal has a version of this feature oo, but maybe Haskell has more support for this stuff - not sure.
- throwaway7645 10y agoNever got too far into Haskell despite reading up on it several times and writing a little code, but adding constraints does sound exactly like this. One of the prototype P6 implementations was written in Haskell, so P6 stole some features. The only thing I'm not sure about is Haskell does this at compile-time and P6 does this at run-time I believe.
- vram22 10y agoGot it, thanks.
- vram22 10y agoSpeaking of Python and Perl, that reminds me - I blogged this a few days ago - just for fun: Perl-like "unless" (reverse if) feature in Python: https://jugad2.blogspot.in/2017/02/perl-like-unless-reverse-if-feature-in.html https://jugad2.blogspot.in/2017/02/perl-like-unless-reverse-...