Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Perl 6 and Web Development

by jdrago_999 (Hermit)
on Jun 18, 2009 at 00:47 UTC ( #772603=perlmeditation: print w/ replies, xml ) Need Help??

I've been wondering lately what will web development be like with Perl 6? I have some hopes and ideas that I'll share here:

mod_perl: Hacking like it's 1999

Now, don't get me wrong. I use mod_perl for just about everything. The problem is that because of the super powers mod_perl affords you, there are few (if any) hosting providers that offer mod_perl hosting in the same way that they offer PHP hosting. As in, extremely cheap or free.

I would hope that with Perl6 we can overcome the mod_perl hurdle (mod_perlite or something, as long as hosting providers and admins can get on board with it by default).

Also mod_perl's default setup gets you started with almost less than nothing. Without CGI or similar you can't even process file uploads (really - without hand-parsing the multipart data). mod_perl might be the fastest gun in the West, but only if we're talking about "Hello World!" benchmarks.

Perl Web Pages

If only we could agree on a standard web page templating style that did not also include its own sub-language/dialect, and were actually supported by popular tools like DreamWeaver. ASP seems like an obvious choice, but for whatever reason it just hasn't caught on.

Given the new "Rule" syntax in Perl6 and its ability to modify the syntax within lexical scope I imagine that parsing templates (i.e. ASP scripts or whatever) could be done much more efficiently.

Back to my mod_perl argument - it would be great to have a standard CGI environment that spares us a trip to the Clinton era and simply, elegantly and quickly does the job of reading requests, sending responses and managing session/application state. All this without having to swallow the Red Pill of goofy syntax and getting clobbered over the head with the $MethodologyDeJour two-by-four.

Perl6 Web Server?

Rather than bolting Perl web page functionality onto an existing web server, why not just make the web server out of Perl6? Even if there is a performance penalty, the trade-off would be a native Perl environment and all the modules you need to have already loaded up. The threading model for Perl6 (as I understand it) would be great for such an application.

WSDL Please

Even though WSDL is what it is, somehow it makes those other languages' lives easier. So we should be able to easily generate WSDL to reflect services exposed by our web applications. Actually this seems like something that would be possible now with Moose.

What can we do NOW?

Is Rakudo at the point where we can start coding anything on it? Is the language stable enough that a 1,000-line-of-code module won't be rendered completely broken next week because the Perl6 grammar changed in any significant way?

Can I start coding Perl6 now? (Without using Perl5)

Comment on Perl 6 and Web Development
Re: Perl 6 and Web Development
by perrin (Chancellor) on Jun 18, 2009 at 02:36 UTC

    Sorry to go off here, but I think you're way off-base on some of these. I'm a member of the Apache Software Foundation, so chalk this up to bias if you like.

    mod_perl

    Your complaint is that you can't find a cheap enough ISP. How cheap is cheap enough? You can get a virtual server dirt cheap these days. You can run on EC2. Or, if it's mod_perl itself that you don't like and not the cost of hosting, you can run FastCGI, which is widely available on cheap ISPs. There is no ISP problem for Perl5.

    Also, mod_perlite offers nothing interesting beyond mod_perl, and the idea that it will become ubiquitous on ISPs makes no sense. I've gone into the details on this before.

    Perl Web Pages

    I think it's pretty clear by now that there will never be one templating system to rule them all, in Perl or any other language. There are intelligent arguments to be made on both sides of the mini-language vs. in-line perl debate and quality tools available for both. Thankfully most people don't write new ones and put them on CPAN anymore, but I don't think there will ever be just one.

    And it's not clear to me what you dislike about the current crop of web dev systems (reading requests, managing sessions, etc.).

    Perl6 Web Server

    Do you know how hard it is to write a decent HTTP server? Never mind the performance question -- just try to get all the details of HTTP and the many random clients out there correct, let alone fast, and you'll be busy for years. Then consider that web servers are one of the biggest security concerns ever, and think about how much time has been invested in securing the code in popular servers like Apache. It's not perl that's the problem here but rather the amount of work involved in getting this stuff right. Starting from scratch is a bad idea.

    WSDL

    Hey, we agree on something! I'm more concerned about reading WSDL than writing it, but it would certainly help. SOAP clients are far too painful in Perl right now.

      Perrin you definitely get my ++ here.

      mod_perl

      Maybe FastCGI is the way to go. Did I miss the bus on that? Is it the way of the future with regards to running Perl6 on the web?

      And it's not about the price (for me anyways). It's about the widespread, default install base and availability. Perl6 might be the greatest thing since sliced bread but if you have to get root privileges to even get started, it will never catch on. At least not until Perl6 is installed by default on the most popular Linux distributions - which might not happen for at least another couple of years.

      Perl Web Pages

      The current crop of web dev systems are still in the stone ages. All of them without exception. Some may have moved ahead of the pack into the New Stone Age (with pottery and stick-figure paintings) but that's about it.

      Not to worry. I feel the same way about Ruby on Rails, PHP and ASP.Net (Vanilla, MVC and AJAX).

      I suppose the good news is that there is plenty of room for improvement. A Catalyst + Perl6 setup could be really slick. Add to that a Perl6 ORM layer and we're talking.

      I'd like to get hacking on something - mostly just for the sake of learning Perl6 while doing something that interests me.

      Perl6 Web Server

      Do you know how hard it is to write a decent HTTP server?

      It's been done in C at least a couple times. I'm sure it's possible in Perl. Just think of all the cool stuff you'll get:

      1. INSTANT street cred
      2. ????
      3. Profit!!!!!!!

      Seriously - yes writing a secure, high-performance http server is not something to be taken lightly. At least part of the security problems in the http servers written in C were simply because they were written in C. Assuming that "somebody else" who knows what they're doing has already made sure that Parrot is secure (or *will* make it secure), writing an http server in Perl6 means that we instantly can run it on anything Parrot is ported to.

      WSDL

      I was hoping 5 years ago that it would just *go away* but unfortunately we're stuck with it for the foreseeable future. Anything to make this a non-issue when integrating Perl systems with .Net or Java systems would be great.

        FastCGI is about as old as mod_perl, but it works and you can use it today on the majority of ISPs. This is something we can thank Ruby and PHP for pushing. The bigger issue for you is going to be getting Perl6 onto ISPs. That will probably not happen until vendors start bundling it.

        The thing about those C web servers is that most of them got going by cannibalizing an existing server, like Apache. Otherwise, the job would have been pretty daunting. It's not that people can't create a big new thing -- just look at Linux -- but they can't do it quickly from scratch with few people working on it. I think you'd be better off spending your energy elsewhere, since I don't see any real problem with the existing web server solutions. In fact, the only reason to write an HTTP server these days is if you have a real game-changing idea for it, e.g. the non-blocking I/O architecture that spawned the last crop of new servers.

      I'm going to have to beg to differ on the availability of low cost web serving for people who are just trying to get into it.

      EC 2 will give me a small Linux machine for 10 cents/hour. That's about $70/month and I need to be comfortable administering my own machine. If I go somewhere like http://www.westhost.com/web-hosting/index.html I can get a web host with FastCGI for $13/month. But I have to know to ask for it. (Writing a bunch of CGI then finding out that you really should rewrite it for mod_perl sucks. Yes, we know how to use Catalyst to write an application that will run either way, but beginners don't.) The same place offers me PHP for $9/month. If I go to http://www.hostmonster.com/ I can get up and running with PHP for $4/month.

      For a business those costs are trivial compared to the cost of hiring an employee who can do something with that site. But to a starving student who just wants to make their own cool site, those cost differences are very significant. And I am sure that those cost differences don't hurt PHP's adoption rates one bit.

        I just googled for virtual server hosting and found a ton of cheap stuff. RackSpace has servers with root access for $11/month + bandwidth. Spry.com has Linux VPS servers for $33/month. ServerPoint is $30/month. Those were just the first ads I clicked on. It's more than $4, but on the other hand I can't even get hostmonster.com to load. Anyone who isn't willing to pay $30/month to have a site probably doesn't need more than static pages and CGI, although they could certainly get perl with FastCGI for $6 or so from places like GoDaddy.

        I'm really not concerned about PHP. It's open source, many of my friends use it, and I don't have any problem with it succeeding.

Re: Perl 6 and Web Development
by merlponk (Scribe) on Jun 18, 2009 at 06:16 UTC
    Well, I do like Mason for a simple "CGI environment". It's between plain mod_perl and something like Catalyst and does have some nice concepts in my opinion. And the setup isn't that complicated either...
      While I like Mason, and fully agree that it offers some very useful and clever concepts, I have to disagree if you are implying that it's easy to install. I have never had a Mason install go without hitch (and I've installed 20+ RT systems).


      - Boldra
Re: Perl 6 and Web Development
by moritz (Cardinal) on Jun 18, 2009 at 06:26 UTC
    Rather than bolting Perl web page functionality onto an existing web server, why not just make the web server out of Perl6?

    It's already been done: HTTP::Daemon. Of course so far that's a rather simplistic module, but it can evolve for sure. It just needs people doing it.

Re: Perl 6 and Web Development
by Limbic~Region (Chancellor) on Jun 18, 2009 at 14:05 UTC
    jdrago_999,
    Can I start coding Perl6 now? (Without using Perl5)

    You should have been at last year's YAPC::NA lightning talks. Did you know about mod_parrot? I believe Jeff Horowitz is leading that project and it should make for some pretty fast web code (in the future). If you want to know more, you should hang out on #parrot (irc.perl.org) or #perl6 (irc.freenode.org) and get real time interaction with those in the know.

    Cheers - L~R

Re: Perl 6 and Web Development
by sundialsvc4 (Abbot) on Jun 22, 2009 at 15:29 UTC

    If you want a glimpse of “where web development is going,” do not be “thinking like it's 1999” or you will surely never see the sea-change until long after it has passed you by.

    We don't need another “improvement” to the HTTP web-server. Apache and IIS (ick...) are both good enough for the purpose, and we don't need another one.

    Think outside the ‘web site.’ This metaphor is extremely limited, at best. We won't even be building web-sites, as we know them today, for too much longer, although of course we'll be maintaining them forever. Information does not need to be “either ‘here’ or ‘there.’” (How very 20th century...) We build complicated templating systems that mix metaphors because right now we have to. We've done it for so long that we've gotten very good at it, but as a result we become snow-blind to the possibility that things will be fundamentally different, even to the point of sweeping away our own jobs as we now know them (and making us all say, “good riddance”).

    I wrote some thoughts on that here...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-12-29 01:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls