with Lyn Greiner
(March 2005)
What place do scripting languages (in general, and Perl in particular) have in today's computing environment?
Very simply, they're the glue that holds complex systems together. They allow developers to hook together commercial and Open Source software packages, and to coordinate the resulting systems.
But, increasingly, they're also fully fledged development platforms in their own right. For example, many large commercial applications are now programmed predominantly in Perl or Python. And, of course, PHP is the bedrock on which a huge number of on-line businesses are built.
Where do you see them going? Where will scripting be in five years? Do you see it being replaced by compiled languages?
If anything, I think the trend is in the other direction: interpreted or "just-in-time" compiled languages will increasingly take over from pre- compiled languages. Compilation will eventually come to be seen for what it is: merely an optimization tool, and one whose use is almost always premature.
It'll still be useful when shipping stand-alone code beyond environments you control, but increasingly compilation will be seen as a packaging technique.
Of course, the other aspect of that is that the line between compilation and interpretation--which has always been a little arbitrary--will blur even further. Perl already has an on-the-fly compilation phase in front of the interpreter, but it targets Perl's internal "assembly language", rather than the underlying hardware's.
The future will be about consistency across platforms, so compilers will increasingly need to target abstract "virtual machines" (like Sun's JVM or Microsoft's CLR) that are layered over the hardware. At which point, are you compiling or interpreting? And does it matter?
What do you see as the attraction of scripting languages? Why?
Interpreted languages do two things much better than compiled languages. Firstly, they provide more sophisticated programming tools and support for more advanced programming techniques. For example, Perl provides hashed look-up tables and arbitrary-length arrays as core data types. C doesn't even have a proper string type. Likewise, Perl's data sorting facilities are integrated into the language, so the sorting criteria are directly programmable.
Having all the basic tools of programming (i.e. high-level data types and common algorithms) built into the language, rather than having to build them yourself, means that you need to write less code to solve a given problem. Scripting languages let you use power-tools and pre- fabricated panels to build your home, instead of having to build a stone axe to cut down the timbers to shore up the mine to extract the iron to forge the saw to mill the lumber to get the posts to sink the foundations on top of which you'll eventually construct your dwelling, once you've gone back to the mine to get more iron to cast an adze and some nails and a hammer, and used them to build a ladder and...well, you get the idea.
The second major attraction of intepreted languages is that they let you do incremental development very quickly, without the constant irritation of sitting around waiting for compiles to finish. Many Perl programmers-- myself included--develop directly in their favorite text editor: write some code, hit a function key, and see it execute immediately. No frustrating pause, no break in your concentration. That "immediacy" and "seamlessness" is a huge benefit, and often overlooked.
What are their drawbacks? How are you addressing these issues?
Execution speed is still a major issue. In Perl we're addressing that by building a new blazingly fast virtual machine called Parrot (www.parrotcode.org) on which the next major version of Perl will run.
Is scripting adoption by businesses growing? Shrinking? Why do you say this?
I really only get to observe this issue through the tiny window of my own training business, but everything I see indicates that scripting continues to be at the core of most business's on-line activities...even if no-one except their system administrators, DBAs, and core developers knows it.
Languages like Perl and Python and PHP are what hold their I.T. infrastructure together. They're the tools that allow organizations to move data between databases, between formats, between applications, between platforms. As the need to do that continues to grow (and it will), scripting languages will continue to grow with it.
If there were one core thing you could change about scripting languages, what would it be? Why do you say this?
If I could change one thing it would be the misperception that these languages are toys; that they're not suitable for "serious" development. There is any amount of evidence to the contrary, but the stereotype persists, and it keeps too many programmers from being able to use these extraordinary tools that would make their jobs easier, and their products better.
What sort of changes and enhancements are you planning for Perl in the next year? Why?
Wow, where do I start. The Perl 6 project (dev.perl.org/perl6), whose goal is to develop the next major version of the language, is finally coming to fruition. Over the next twelve months we'll see two new Perl compilers being built in parallel, bringing a huge range of new and powerful features to the language. It's an exciting time.
What are the biggest things users have asked for?
Many of the biggest things are little things: fixes to some of the few rough edges that remained in the language, such as the ability to write:
if (0 < $number < 1) {...}
or a "print line" command, to avoid having to manually add a newline to every output statement.
Of the bigger "big things", the biggest is clearly the new object orientation features. We're adding declarative classes, strong encapsulation, multiple dispatch, component-based class construction, and cross-language support to the core of the language. Developing OO applications in Perl 6 will be vastly easier and cleaner than it was in Perl 5. We're aiming to become the standard against which other object-oriented languages are measured.
What is one cool thing developers can do with Perl that they might not think it could do?
That's another of those "where-to-start?" questions. I don't think I can stop at just one. So here's a quick list of two dozen cool things they can do with Perl:
- Pull data from an Ingres database and shove it into Oracle, or vice versa (in about 10 lines of code).
- Hook into Babelfish to do automated text translation.
- Retrieve stock quotes from the NYSE, Nikkei, ASX, TSE, or other stock exchanges.
- Replace all the .. tags in an HTML document with .. tags (in about five lines of code).
- Draw organization charts, flow-charts, network designs, and other kinds of graphs.
- Do heavy number-crunching very efficiently.
- Process and generate ActiveX events
- Control their TiVo
- Use A.I.techniques to automatically classify documents by content
- Get access to the European Southern Observatory's astronomical catalog
- Encode and decode MP3 audio
- Create UPC barcodes
- Track their FedEx shipments
- Automate their on-line payments
- Automate their on-line banking
- Remotely administer a Cisco router
- Generate synthetic speech
- Send and receive SMS messages
- Process Gedcom genealogy files
- Retrieve an image of the flag of a given country
- Find the country in which a particular IP address is located
- Grab the current weather, or a forecast, from the NOAA
- Read, edit, and compose MIDI files
- Build Gantt charts for project management
- Calculate no-decompression limits on repetitive SCUBA dives
- Automate MS Office applications and Internet Explorer via OLE
- Build test suites to verify the user interface of their interactive websites.