|There's more than one way to do things|
Perl 6 and Web Developmentby jdrago_999 (Hermit)
|on Jun 18, 2009 at 00:47 UTC||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.
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)