views:

557

answers:

6

Rails is a great platform, but it just doesn't have the history that Perl does, so I thought it might be an interesting idea to put them together. Anybody with lots of Rails experience see any problems with this?

+17  A: 

Rails is not a platform. Rails is a web framework written in, and for, the Ruby programming language.

Cody Brocious
+7  A: 

The BBC actually went down a similar path and created their own "Perl on Rails" a while back. It sounds like it worked for them. I haven't seen anything about the code being released though, so you'd have to write your own.

The problem I see is that you'd be on your own as far as testing the framework, documenting it and optimizing it for performance. Rails has been around long enough that many people have already gone through those steps. But if you have the time and energy, Perl and Ruby have enough similarities that a lot o the ideas from Rails could probably be implemented in Perl.

Matt Ephraim
This is building a new framework, though, not running Perl code on the existing framework, as the question seems to be asking.
Cody Brocious
As far as I understand, the BBC did write their own framework and just called it "Perl on Rails'. They used Ruby on Rails internally, but could only use Perl on their public site.
Matt Ephraim
Yes, that's the point I'm trying to make. Writing your own framework for Perl that's Rails-like is not running Perl 'on Rails', it's just making a new framework. See Kent Fredric's answer for a better analysis.
Cody Brocious
Ah yeah, you're right. I reread it. The idea of Perl somehow running on top of the framework hadn't even occurred to me, so I guess I assumed that couldn't be what he was asking :)
Matt Ephraim
+12  A: 

It is totally infeasible.

"Rails" is a framework written in Ruby.

"Ruby on Rails" always struck me as backwards logic.

"Running Perl on Rails" would thus be a nonsense terminology,

Perl On Rails ( which is written in ruby ).

At best, you could attempt to re-write Rails from scratch in Perl, but there's not much point in doing that. All existing Rails utilities are currently written in Ruby, so they would also need porting to Perl.

And why bother, we have Catalyst, and a damned fine list of modules on CPAN that have been around longer

Kent Fredric
+2  A: 

Since Rails is written in Ruby, Perl on Rails implies Rails written in Perl, no?

Making Perl jump through the same hoops seems a little counterproductive - why not use one of the many MVC frameworks already in existence? Just google "mvc framework perl"

Oh, regarding the Beeb, they did indeed build Perl on Rails, but they didn't really want to.

Of course, Perl just doesn't have the history that, say, COBOL does Or ALGOL. What about FORTRAN on Rails? Anyone? Anyone? Bueller?

Mike Woodhouse
How about COBOL on Cogs: http://coboloncogs.org/
mipadi
+1  A: 

Actually, there are at least two "PHP on Rails" projects: TRAX and Akelos, so it is possible to port Rails to other languages (and why shouldn't it be?).

However (as Cody pointed out) Rails is written in and for the Ruby language, and it takes great advantage of Ruby features (probably) not offered by other languages. So I think using an existing MVC framework (like Catalyst), or even writing a new one from scratch makes more sense than porting Rails.

Can Berk Güder
What features does Ruby have that Perl does not? (Not necessarily implemented the same way, but something equivalent, I mean?)
ysth
proper encapsulation is the first thing that comes to mind.
Can Berk Güder
A: 

It seems like it would be possible to deploy rails alongside a mod_perl application e.g. Catalyst, on the same apache virtual host using phusion passenger. But, the mod_perl app would have to handle a sub-URI while phusion passenger handles the root of the site.

You would simply use the SetHandler directive for a specific location, and use the PerlModule directive to specify which perl module handles the request

Jonathan Soeder