BBC Creates 'Perl on Rails' 216
Bogtha writes "Long-time users of Perl for their public websites, and having successfully used Ruby on Rails for internal websites, the BBC have fused the two by creating a 'Perl on Rails' that has the advantages of rapid development that Rails brings, while performing well enough to be used for the Beeb's high-traffic public websites. This is already powering one of their websites, and is set to be used in the controversial iPlayer project as well."
Holy Crap (Score:3, Funny)
Re:Holy Crap (Score:5, Funny)
Yes, but add a few $'s and %'s in the right places, and it turns into a one-line cross-platform implementation of iPlayer written in Perl. (If your Perl code can be understood by humans without extreme effort, you're just not trying.)
Re:Holy Crap (Score:5, Funny)
Re: (Score:2)
Uh...
$ = variable
@ = array
% = associative array
as in:
$foo = "Hello world";
print $foo;
or:
@bar = ('hello',"\n",'world');
foreach(@bar) {
print $_;
}
IIRC. I'm sure I got something wrong; I've been doing most of my work in PHP, and, more recently, Python. Haven't done much with Perl in years.
Re: (Score:2)
print foreach (@bar);
But your code is functional.
Re: (Score:2)
Glad to hear I didn't screw up my 5 or 6 lines
Re:Holy Crap (Score:5, Funny)
I don't see the problem...
understand it easily if longtime perl programmer($self);
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re:Holy Crap (Score:5, Insightful)
"Long-time users of Perl for their public websites," - an appositive
"and having successfully used Ruby on Rails for internal websites," - another appositive, successfully connected with a conjunction
"the BBC" - the subject of the sentence (which the appositives are in apposition to)
"have fused the two by creating a 'Perl on Rails'" - a perfectly fine predicate
"that has the advantages of rapid development that Rails brings," - with a relative clause
"while performing well enough to be used for the Beeb's high-traffic public websites." - and another modifying clause.
In short: it's a sentence. It's grammatical. It's comprehensible. Quit whining.
Re: (Score:3, Funny)
Re: (Score:3, Funny)
Re: (Score:2)
Re: (Score:2, Funny)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Madness, I say (Score:5, Funny)
Re: (Score:2, Funny)
Re: (Score:3, Funny)
I'm not getting involved with any of this. I'm holding out for Rails on Rails. You don't have to write any code, you just submit a bid and the project is finished.
Re: (Score:2)
I'm holding out for Assembly Language on Rails.
As a side note: It's not Assembler. That is the thing that does the assembling. You don't write in compiler, do you?
Re: (Score:2)
All of my computer programs are the same "Hello World" application I did for my first project in college. I just rewrite the compiler from scratch to create new programs from it.
You insensitive clod.
Re:Madness, I say (Score:5, Insightful)
Sounds to me like a bunch of Perl coders with a few million lines of corporate code who thought this would be easier than learning another language for one specific smallish project.
Re:Madness, I say (Score:4, Interesting)
I seriously doubt they have very much Perl code around; there's not much dynamic content on BBC. I really can't imagine what their circumstances would have to be for it to be a sane option to rewrite Ruby on Rails in Perl
Re:Madness, I say (Score:5, Insightful)
Flat files that are pre-generated from a database backend, maybe. As in a cron job each night that does something like "for show in db.select(shows): generatestaticpage(show)". I'd be amazed if the whole site was just one big Dreamweaver folder that gets published.
"We have a database engine. We have a template system. We have a language that everyone in-house knows. Let's write a generalized method for combining the three!"
I suspect that happens a lot more often than you'd think. If anything, I consider it a testament to the BBC that they've decided to release their code so that everyone else doesn't have to reinvent it.
Disclaimer: I much prefer Python, and to me the BBC is that extra channel that has "Coupling" and "Ramsay's Kitchen Nightmares". I have no special love for Perl or the BBC. I just think that it's pretty cool of them to do this and wish them luck.
Nice sig, BTW. :-)
Re: (Score:2)
Like most organisations the BBC has its own technical ecosystem; the BBC's is pretty much restricted to Perl and static files. This means that the vast majority of the BBC's website is statically published - in other words HTML is created internally and FTP'ed to the web servers.
And a couple of implication, including an effective hard limit on the number of files you can save in a single directory (many older, but still commonly used, filesystems just scan through every file in a directory to find a particular filename so performance rapidly degrades with thousands, or tens of thousands, of files in one directory), the inherent complexity of keeping the links between pages up to date and valid and, the sheer number of static files that would need to be generate to deliver the sort of aggregation pages we wanted to create when we launched /programmes; let alone our plans for /music and personalisation.
I really think the BBC is running without using a database, I wouldn't have believed it either but it's right there straight from the horse's mouth.
Nice sig, BTW. :-)
Ta (but you forgot the (PBUH) after the smiley face, you insensitive clod)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
On my Dish Network system, it's on BBC America.
Re: (Score:2)
Make your mind up please?
If you have static content and a high load then a database is overkill.
Re: (Score:2)
What I'm wondering is why they don't just use an existing framework and scrap whatever restrictions are keeping them using Perl and flat files.
Re: (Score:2)
They are deploying their Perl on Rails app so that they can have more dynamic content, which they couldn't have before because they're limited to static files and perl scripts.
Well, I still think the correct interpretation is that they have a huge number of templated pages that are regularly statically generated. Maybe it's not a daily cron job that recreates the whole site, but a script that takes a template you just edited and turns it into a static page by running some Perl magic on it.
I'm guessing that "static" here means "non-interactive", not that each page exists in source form as the complete end-user-ready HTML. A huge advantage of this is that your webserver can e
Re: (Score:3, Insightful)
It's called putting all your eggs in one basket. When the language is no longer popular they'll be begging anyone with experience of it to join and trying to rewrite the entire monstrosity. Don't believe me? Think about Oracle forms. Half my job is replacing legacy code. What you're describing is a neat way of creating a HUGE le
Re: (Score:2)
That's a risk you take regardless of the language, and I'd be a lot more comfortable committing to something like Perl which has been around for a very long time and still has very strong advocates, rather than something like Ruby on Rails that's only recently become popular (not to mention PHP which only really seems to appeal to the lowest common denominator).
Perl has pretty much stood the test of time, though. There's a lot of people with "legacy" pre-.Net VB/ASP code, which at the time was hyped as th
Re: (Score:2)
Perl won't live forever. No language will. I'd call C the steadiest of the lot and even that's been on the wane for some years (for business apps - I know it's not dead for game development etc.). Languages don't all die together though and by actually using a few different languages and platforms you give yourself some breathing space - as each one dies y
Re: (Score:3, Interesting)
> easier than learning another language for one specific smallish project.
Sounds to me like a bunch of Perl coders looked at their friends' code and find their ideas interesting, and is worthwhile to implement in their favorite language. Why people never learn to admit that some people think Perl looks nicer than the language they love most?
Re: (Score:3, Funny)
For most of the same reasons that make it hard to admit that their wife is an alcoholic or that their son wants to become a Hari Krishna. There are certain truths that make it difficult to believe in a rational society. Yours is one of them.
Re: (Score:3, Insightful)
Yeah! Especially HTML!
Re: (Score:2)
If you'd read the article[1] you'd have found out that they use Ruby on Rails internally, and that's why they replicated its functionality in Perl. The reason they did that was because they weren't allowed to use anything other than Perl.
[1] Hahahahahahahahahaha[gasp]hahahahahahah
"need" is the new "want" (Score:4, Funny)
This is just word-inflation. in the same way that children nowadays "need" a chocolate bar.
In business, the best way to see if someone really "needs" something is to see how much hassle they're willing to suffer to get it. For example, if they need a $1000 product, then I'd need a 20 page justification. If they need to attend a conference in 'Vegas, I need them to work weekends to catch-up the time etc. You get the idea.
Re:Madness, I say (Score:4, Insightful)
Re: (Score:2)
The world needs both conservative people like yourself, as well as the people always looking for the next greatest thing. You would be programming in assembly without them, and a lot less work would get done without people like you.
Ruby and Python are next generation languages that both address issues with languages such as Perl. They exist for a reason. I personally really like Ruby as it does Per
Re: (Score:3, Informative)
The best reason to use the existing technology is because you're currently using it.
They could do a bit in Pythin, and another bit in PHP with perhaps a snippet of RoR in there that someone did a prototype in to see if could replace the entire codebase (ha), with a couple of C modules someone wrote for some fast-access parts, maybe with a VB.NET module that was written by someone experimenting with the latest 'coolest' tech, and a slice of Java written by an intern once.
Or they could leave that k
Something to do with Fast CGI? (Score:2)
I know there is Mongrel now, but even the creators don't seem to trust it enough to let it run stand-alone and recommend you run it behind an Apache proxy. Not something I can imagine the BBC - or anyone with a large web farm - wanting to live with.
Wow. A consultants dream (Score:4, Insightful)
Re:Wow. A consultants dream (Score:5, Insightful)
And "job security" language choices is just as much a problem with regular employees as consultants. As a consultant there's been more then one occasion where I had to go and clean up the mess after some bored employee made an "interesting" language or framework choice presumably to keep themselves interested.
-- John.
Re: (Score:2)
Just like the flamewar that exploded yesterday over HTML/CSS, the success of a language is largely dependent upon how easy it is for newbs or non-technical folk (ie. designers) to pick up. Not all of us have PhDs in CS, or enough time to pour over volumes of texts to learn the language. If you make the language easy to learn, and put in safeguards against common newb mistakes, it's b
Re: (Score:2)
I put a language in my bag of tricks if it gives me leverage to solve a wide class of problems in an effective and efficient manner. I ended up liking Perl syntax just fine once I had learned it.
In any event, it's hard to call Perl an unsuccessful language. Based on the breadth and depth of available CPAN modules, and the fact that Perl support is a given on most web hosts, you hav
Re: (Score:2)
However, programmer-friendliness is crucial these days for new languages. The number of fairly apt computer users is quickly growing, whereas the number of professional programmers isn't changing all that much. It therefore stands to reason that languages that don't requi
Re: (Score:3, Insightful)
I think it more accurate to say that Perl code is readable to the person that wrote that particular piece of code. Since there are a million and one ways to do anything in Perl (and this is considered a 'strength'), then when another Perl hacker comes along and can't understand what the previous Perl hacker did, they rewrite the whole thing the way they know how to do it. That doesn't meet my definition of 'readable.'
Re: (Score:2)
Re: (Score:2)
> that wrote that particular piece of code.
If documented properly, it readable by others too.
The issue is that many programmers take undue advantage of Perl conciseness by not documenting their particular sleights of hand.
Re: (Score:2)
Perl is readable to those that know Perl. I know Perl and I find idiomatic Perl readable.
The question isn't whether or not those who know a language find it readable. Of course they do. The question is how readable the language is to those who haven't studied the language for years, and how much study it takes before the language is readable. In this sense, Perl is quite a poor language.
And "job security" language choices is just as much a problem with regular employees as consultants. As a consultant there's been more then one occasion where I had to go and clean up the mess after some bored employee made an "interesting" language or framework choice presumably to keep themselves interested.
If I seem bitter, it's because 98% of the messes I have to clean up are written in Perl. The best thing I can say for Perl (and C++) right now is that it's a great "crap magnet". That is, if something's n
Re: (Score:2)
So, what do you know, maintenance work is often given to junior engineers, who are as a rule do not
Super (Score:5, Funny)
Re:Super (Score:4, Insightful)
Re: (Score:2, Insightful)
Additionally the expressiveness of Ruby combined with the conventions
Re: (Score:2)
Conspiracy! (Score:5, Funny)
"Perl on Rails for Dummies"
"Perl on Rails for Idiots"
"Perl on Rails Bible"
"Perl on Rails in 24 Hours"
"Perl on Rails in a Nutshell"
"Perl on Rails: The Missing Manual"
Re: (Score:2)
Re:Conspiracy! (Score:5, Funny)
Re: (Score:3, Informative)
http://www.packtpub.com/catalyst-perl-web-application/book [packtpub.com]
It's much better than the Rails books though
Re: (Score:2)
Don't get your hopes up (Score:4, Funny)
That could be reasonable actually (Score:2)
Re:Don't get your hopes up (Score:4, Funny)
Could be worse. Could be released under the TVL (TV Licence), where you'd have to pay £135.50 per year to run the software. (Or £45.50 if your web site is in black and white instead of color.)
The good news then would be that if you live in your parents' basement and they have a TV Licence paid for, you can host the web site under their licence as long as the server is located in your parents' house.
Re: (Score:2)
glark (Score:3, Funny)
As long as it somehow involves more and better Dr. Who reruns, I'm happy.
What? Their website? I want Dr. Who reruns on that, then. The ones with the curly haired guy.
Thanks a lot Beeb.. (Score:4, Funny)
Re: (Score:2)
Never underestimate the insanity of the British Public Sector.
Re: (Score:2, Insightful)
Sniff. At the very least, we'd feel better if others could learn that it's Perl and not perl.
$ is for scalar, @ is for array, # is for hash
Not so hard, was it? Notice the mnemonic qualities? Much of Perl has a striking resemblance to natural language, given that it's author, Larry Wall [wikipedia.org] is a trained linguist. For
Re: (Score:3, Insightful)
Re: (Score:2, Informative)
... and several of the other trained linguists who use and develop Perl.
Re: (Score:2)
Re:Thanks a lot Beeb.. (Score:4, Interesting)
Yes, to some degree. The primary goal of Perl, like other programming languages, is to communicate with other programmers. There appear to be two schools of thought on how to do this. One of them comes from the mathematicians, who appreciate simplicity and uniformity of expression (as least per their on definitions of both) as a primary design criterion. The other comes from the linguists, who (in my opinion) have somewhat better ideas of how people (not just mathematicians) really communicate.
I'm not saying that one is bad and the other is good. You'd never likely get the Turing model or the lambda calculus out of a linguist, for example, and COBOL and AppleScript aren't great examples of applying linguistic principles to language design either -- so there's a balance to strike between them.
I agree to some degree, but just because no one has ever done it perfectly doesn't mean it's not worth doing.
Yes, actually. Remember that Perl is an artificial language, so it can simultaneously be more and less a pastiche than English. Consistency and syntactical similarity of semantics are important in natural language (avoid false cognates) but even more so in a programming language. The Perl 6 designers believe strongly that similar things should look similar and dissimilar things should look dissimilar. As well, concepts such as noun markers and subject-verb agreement (context) are present in Perl, as well as pronouns (topicalization). This brings up other problems such as ambiguous antecedents.
The designers evaluate new operators and concepts in terms quite heavily. Mnemonics are important, as well as the proper length of identifiers and semantics of their names. For example, Perl 6 uses say instead of println because we believe it will be a frequent operation -- more frequent than print and as such deserves a shorter identifier. Whatever the syntax for accessing the current continuation will be, it's likely to be somewhat longer, as it's not something we want people to need to use more than a few times.
Re: (Score:2)
From (my) snark to (your) informativeness in two posts. Bravo. Thanks for taking the time; I understand that this is something you are intimately involved with and in a position to speak about authoritatively.
The principle that a programming language should be designed in light of its function as a medium of communication between programmers seems like a very insightful one, and I can understand that with that goal in mind, study of human communication is probably more useful than study of algor
Re:Thanks a lot Beeb.. (Score:4, Insightful)
% is for hash. And that's not really a good rule.
Given %hash, it's called @hash{@keys} when you slice it, and $hash{$key} when you only want one element. References always are scalar, so even though $foo->{bar}[42][2]{baz} is referencing a hash of arrays of arrays of hashes, you have a $ on the front.
Once you know the rules, it's fine... but it's not necessarily Perl's finest point (and this all changes in Perl 6 as a result). Even if you like Perl, you have to admit that there are lots of things wrong with it.
There are just less things wrong with Perl than any other language
Re: (Score:2, Interesting)
I know you know this, but others don't.
The hash is always called 'hash'. The sigil provides datatype information for the intended return value of your access to the variable -- just about everything in Perl is an expression and has a return value. Program evaluation follows a model remarkably similar to what a functional language might use, evaluating sub-expressions as needed. I'm sure the internals c
Re: (Score:2)
Semantics Nitpick Counter-Attack #42562
Your confirmation for this waste of my employers time is 608232.
Plus, i'm on your side mon seigneur. If you want to find the source of its declining popularity please remember CGI.pm and Perl/TK. We did it to ourselves, despite improvements =).
Re: (Score:2)
otherwise it's humble old perl.
Re: (Score:2)
Re: (Score:2)
Well, I know *I* feel like I've been struck after having to look at some Perl code. Trained linguist? Jesus!
But what is Rails standing on? (Score:5, Funny)
The developer gave a superior smile before replying, "What is Rails standing on?"
"You're very clever, young man, very clever," said the old lady. "But it's Rails all the way down!" [wikipedia.org]
Time to domain-squat! (Score:2)
I'm not a perl coder, so I don't know (Score:2)
Rails running off with Perl (Score:2)
Never mind the merits of perl or ruby (Score:2)
How do we stop this train and get off?
An
Re: (Score:3, Interesting)
Complain to your elected representatives, perhaps? Now THAT's thinking outside the box!
slow whitelisting of CPAN modules (Score:2, Insightful)
If someone knows someone fr
Re: (Score:3, Insightful)
Surely the BBC of all organizations... (Score:5, Funny)
Re: (Score:3, Insightful)
Seriously though I dont know what the BBC is doing, smoking its way through £130m PA ($260m) of public money on computer "projects", like re-inventing mplayer/iPlayer/MediaPlayer.. Haven't we already done this? Shouldn't Aunty Beeb leave the hard-coding to the free market & concentrate on what it does best - artistic/jounalistic output?
Re:Great another framework (Score:4, Interesting)
IMHO another example of management red-tape costing developers time and resources.
Re: (Score:2, Insightful)
Re: (Score:2)
Re:Great another framework (Score:4, Interesting)
Catalyst aims to be an extensible framework. Sure, there are recommendations for new projects, such as using DBIx::Class as the ORM, or Template Toolkit for your view, but these aren't written in stone. Each layer is flexible. You can use CPAN modules to build your own models and views. Want world GDP data? Make a model that calls WebService::CIA. Have your own custom database model already? Use it! (SixApart did this with Catalyst + their partitioned database system + Memcached).
Catalyst is a little rough around the edges for some of the simpler cases that you might use RoR for, such as a plain old CRUD form system, which Rails will nicely generate for you, but for more complex applications Catalyst is not a bad choice.
Re: (Score:2, Insightful)
Have you ever tried to swap out ActiveRecord in its entirety for something else? The corresponding change in Catalyst is much easier than in Rails. (Rails 2.0 might have changed this; I don't know.) Rails is very proudly opinionated, while Catalyst goes to great lengths not to enforce any single particular component.
Nice synecdoche, but Auntie Beeb's progra
We need a story about Russian railroads (Score:2)