go ahead... be a heretic | |
PerlMonks |
IronPerl for Java/.netby kal (Hermit) |
on Mar 31, 2004 at 15:11 UTC ( [id://341307]=perlmeditation: print w/replies, xml ) | Need Help?? |
The "Perl couldn't run well on Java/.net" is a meme I've certainly believed and bought into, and a lot of other smart people have done as well. Perl is a sufficiently different language - loose typing to being with - from the languages that .net is typically concerned with (and definitely not like Java) that it's quite a believeable story. Jim Hugunin presented a paper at PyCON 2004 well worth a read: it's called IronPython: a fast Python implementation for .net and mono (mono, if you don't know, is the implementation of .net written by the Ximian folk at Novell and others, and runs on GNU/Linux among other platforms). His paper, backed up by some real code, shows that actually, contrary to intuition, .net can host a dynamic language with some reasonable turn of pace. You can't get the code from ironpython.com, it's highly unlikely to be production ready, but appears to be roughly complete and produces fully managed code. If Python, why not Perl? There are a number of reasons why Perl would be slightly more difficult to pull off; the big one is probably the difficulty of writing a Perl parser. However, this is a similar challenge to that being taken up by Ponie (Perl On New Internals Engine), which doesn't write a new parser, merely makes perl emit parrot. It might be reasonably possible to use Ponie as a front-end to .net as well as Parrot, although there is a still an issue (Parrot is a register-based VM, .net is stack based). Or perhaps a system to translate Parrot bytecode to and from .net would be more useful. I would personally love to be able to target .net with Perl. But, then, I'd also like to be able to target Java and Parrot - it's really just an added ability, rather than something I'd require. It's a nice-to-have. However, it would be terribly cool. I leave you with the wise words of Charles and David: Any old iron, any old iron, any any any old iron In short, it would be an interesting exercise to explore how Perl might interact with .net. IronPython has shown that the intuition isn't necessarily correct, it would be interesting to see how well Perl can be implemented. And whether or not the new clothes would be worth wearing.
Back to
Meditations
|
|