Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

IronPerl for Java/.net

by 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
You look sweet, talk about a treat,
you're lookin' dapper from your napper to your feet
Dressed in style, brand new tile, your fathers old green tie on
But wouldn't giver you tuppence for your old watch back
Old iron, 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.

Replies are listed 'Best First'.
Re: IronPerl for Java/.net
by seattlejohn (Deacon) on Mar 31, 2004 at 19:45 UTC
    If you're interested in integrating Perl and .NET, you might want to check out the PerlNET tool in the ActiveState PDK. I used it last year to take a Perl class we had and wrap it so that a C# program could instantiate it and call its methods just like any other .NET class.

    Getting the build process set up right required a little finagling (and the documentation, at least at the time, was not entirely clear), but once we figured it out it worked just great.

            $perlmonks{seattlejohn} = 'John Clyman';

Re: IronPerl for Java/.net
by flyingmoose (Priest) on Mar 31, 2004 at 18:48 UTC
    Why not Perl? Perl intends to dominate the world through the use of Parrot and supporting other languages through Parrot, rather than cowering before Microsoft 'standards'. Why work on this when someone could instead contribute to Parrot, and blow .NET/Mono (which is basically doomed due to MS involvement) away?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://341307]
Front-paged by broquaint
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found