What language is that?
Perl 5 with type annotations, yes it doesn't compile, it is simply for illustrative purposes. Your mythical "everything can be determined at compile-time" language doesn't exist yet either, you have yet to provide a version of my clone function which does not use any runtime introspection?
| [reply] [Watch: Dir/Any] |
Your mythical "everything can be determined at compile-time" language doesn't exist yet either,
Haskell?
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [Watch: Dir/Any] |
Well, Haskell can do a lot at compile time yes, but as with OCaml, it has limits. Haskell also places a large burden on the programmer in that to really use it effectively with any degree of (compile-time decided) dynamism, you have to really, truly grasp the type system in full.
In fact, if you really want to expand your mind in weird ways, try and grok all the code on this page. It describes some advanced techniques using OCaml's object system and module system that require a non-trivial amount of complexity to achieve the level of dynamism that Perl/Python/Ruby programmers take for granted. Of course the benefit here is that OCaml can assure you that your program is well typed and therefore remove an entire class of errors. The Ocaml compiler can also aggressively optimize this code since it can rely on the type-soundness when making decisions. But like I said before, its a waterbed, the cost of these things show up in complexity for the end programmer.
You also might want to note that even the Haskell/OCaml guys know they have limitations, otherwise Template Haskell and MetaOcaml wouldn't exist. These two language extensions provide what is called "multi-stage programming" or "compile-time metaprogramming", which again, provide the level of dynamism that Perl/Python/Ruby programmers take for granted.
| [reply] [Watch: Dir/Any] |