Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Runtime introspection: What good is it?

by BrowserUk (Patriarch)
on Jul 06, 2008 at 19:03 UTC ( [id://695860]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Runtime introspection: What good is it?
in thread Runtime introspection: What good is it?

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^5: Runtime introspection: What good is it?
by stvn (Monsignor) on Jul 06, 2008 at 20:14 UTC
    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?

    -stvn

        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.

        -stvn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://695860]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-29 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found