Max Lybbert
Posts: 314
Nickname: mlybbert
Registered: Apr, 2005
|
|
Language design
|
Posted: Aug 25, 2006 7:28 AM
|
|
I haven't done a great job explaining exactly what I'm commenting on, and what I'm not commenting on, so I'm not upset that people haven't guessed the parameters I've arbitrarily and implicitly chosen.
/* Java should have had multi-methods from the start. It's what most (in my experience) developers expect and you can don't have to use the feature. */
The more I consider language design, the more attracted I am to good metaprogramming systems.
For instance, I'm tempted to use a garbage collecter every so often, but I know that garbage collectors have drawbacks (mainly, you can't guarantee when an object will be collected, so you generally can't guarantee when the finalizer will be run, so you can't use the finalizer to run code that needs to be run at a specific point in time). The language has to give a strategy for memory management and resource management. Perhaps a language could (1) provide a garbage collector automatically, (2) make it possible to turn that collector off if you need to, and (3) provide facilities that make it possible to write (a) a different garbage collector, and (b) smart pointers, or other memry/rsource management techniques.
Likewise, a language has to say "our object system is. ..." For most programmers that solves the puzzle. I'd probably never need to go beyond that myself. But *if* I ever did, it sure would be nice if the language said "... and here are a few hooks/tools/building blocks so that you can create different kinds of obbject/type systems when necessary." You'd want these custom objects and types to look different than the generic versions, so that it'd be easy to keep things straight.
Perl 5 doesn't come with AOP out-of-the box, but it does give a few hooks into the symbol table (typeglobs and the "magic goto" mainly, except that the magic goto's been discontinued http://search.cpan.org/~rgarcia/perl-5.9.3/pod/perl593delta.pod#Magic_goto_and_eval ). It's possible to hijack a call to a subroutine, do whatever you want and then say "goto &sub" to go ahead and do what the sub was supposed to do. This gives you some AOP capabilities, if you ask for them.
And, yes, I know Lisp programmers say Lisp has all the metaprogramming features you could ever want. Unfortunately I haven't been able to get excited enough abut Lisp to actually use it. Take that for what you think it's worth.
|
|