Scripting languages spark new programming era

Newfangled development platforms are dominating the Web. Take a tour of the options

The era of scripting languages is opening up programming to the masses and extending the Web as an application platform.

Even the traditional Java and Microsoft languages have had to make room for scripting languages, which offer developers a quick way to build Web applications and have gained multitudes of adherents. Indeed, programming technology powerhouses Microsoft and Sun both cite their own accommodations for these languages: Sun has opened up the Java Virtual Machine to support scripting languages, and Microsoft offers .Net-based versions of the Ruby and Python languages.

[ Read Paul Krill's Q&A with Mozilla's Brendan Eich on the new version of JavaScript, disputes with Microsoft, and the language's path to the present. ]

There are numerous scripting languages, also called dynamic languages because they are interpreted and compiled at runtime. But a handful of them come to mind as the most prominent: JavaScript, PHP, Perl, Python, and Ruby.

Developers overseeing these languages continue to map out improvements, and each cites benefits of their particular platform. Although all the scripting languages are similar, they do have differences in aesthetics and feel, says David Heinemeier Hansson, creator of the Ruby-based Ruby on Rails Web framework. "For certain people, Ruby is just what fits their brain and for other people, Python is just what fits their brain." But the underlying concepts and capabilities are essentially the same. "I think we're all generally in the same boat," he says.

Ease of use, flexibility are key drivers

The ease of use of scripting languages is a main attraction, says Michael Cote, an analyst at RedMonk. These languages also offer flexibility, he says. "Usually, with the dynamic language, you can change things a lot easier when it's running," Cote says.

Additionally, variables do not have to be defined ahead of time, says Andi Gutmans, co-CTO of Zend Technologies and a core developer of PHP. "You can easily concatenate strings with one another," and run an application without having to compile it, he says.

"The main difference compared to statically typed languages like C, C++, and Java is their dynamic nature, which is also one of the reasons why many people consider them to be more productive," Gutmans says.

Although scripting languages are hardly new, today's powerful computers make them viable platforms, says Joshua McAdams, a representative for the Perl Foundation. "The computers have grown to where they can handle the dynamic languages better," he says.

The flexibility of these languages also could be viewed as a strike against them, according to Cote. Scripting languages could be compared to a lawless society while Java would be authoritarian, he says. He also mentioned issues with maturity. "There's not necessarily the tools and practices," associated with the new languages, Cote says.

AJAXleds the pack
Perhaps the leader of the scripting language juggernaut is JavaScript, popular for enabling rich client activities in browsers. It has become a linchpin of the popular AJAX (Asynchronous JavaScript and XML) technique for building rich Internet applications. JavaScript may even be considered part of popular culture, having been mentioned during a "Saturday Night Live" skit several years ago.

JavaScript author Brendan Eich, CTO at Mozilla, recalled the origin of JavaScript in the 1995 timeframe. "The idea was to make something that Web designers, people who may or may not have much programming training, could use to add a little bit of animation or a little bit of smarts to their Web forms and their Web pages," Eich says.

JavaScript has been cited as being a bit difficult to use by some. Eich says there have been conflicts between the Internet Explorer document object model and use of JavaScript, but the emergence of JavaScript libraries is helping resolve the difficulties that disconnect has created, Eich says.

Work is proceeding on JavaScript 2 and the accompanying ECMAscript 4 standard, Eich says. "[With the upgrade], we’re trying to address programming in the large, because no one thought JavaScript would be used at the wide scale it is," Eich says.

PHP dominates the server side
PHP, meanwhile, has established itself as a dominant server-side language in the scripting realm, powering applications such as the Sugar CRM platform. The language makes no pretenses about being for general-purpose use, Gutmans says. "The reason why we're so popular is because we focus only on Web. We try and do the best thing for the Web," he says.

PHP enables embedding of code within HTML pages, making it the first language to do that, Gutmans says. Presentation logic can be embedded within the actual context of the Web page, he adds. PHP also supports Web services, database access, and image manipulation. "You've got about 40,000 functions that are all Web-oriented," Gutmans says.

Like JavaScript, PHP also offers more simplicity than older languages. "It's very easy to pick up and then it will also scale with your needs," Gutmans explains. "I often call it the Visual Basic of the Web."

Java is PHP's biggest rival, Gutmans says. But PHP offers an edge in time to completion and expense, he says. "Java [has] very long development cycles [and requires] very expensive engineers." Also, Java applications typically require four to 10 times the code of a PHP application, he added.

Work is proceeding on the planned PHP 5.3 upgrade to the platform, featuring support for namespaces to enable better code organization and reuse. An internationalization extension, and performance and memory improvements are eyed as well. The upgrade is expected by the end of the year, Gutmans says.

PHP: a large user base
PHP has been around a long time, and some advocates of newer languages say it's past its prime. PHP adherents disagree. Perl is complex and hard to maintain, Gutmans says. "Perl has pretty much disappeared when it comes to the Web."

But McAdams defended Perl's vitality, citing examples of major users. "I would ask him what Ticketmaster and Amazon use for their back ends," McAdams says. "[Perl] has a very large user base in Web apps but also has a strong presence in the financial industry."

The 20-year-old Perl platform offers speed of development and flexibility, McAdams says. Another highlight of Perl is access to extensions via the Comprehensive Perl Archive Network (CPAN), featuring 16,000 extensions for capabilities such as database connectivity, Web applications, and XML, McAdams says.

"One of the biggest things about Perl is [it has] a very active worldwide community," which holds 10 to 20 conferences and workshops a year, McAdams says. Perl also offers more maturity than rivals such as PHP, Python, and Ruby. 

Perl is undergoing a major upgrade with its planned version 6. "Perl will be a completely different language than Perl 5," offering better object orientation, McAdams says. But the Perl 5 variant of the language will continue as well.

Python used all over the map
Python has been used for everything from writing cell phone systems to Web applications to stand-alone applications, says Raymond Hettinger, a core developer of the platform. Main benefits include reliability and its readability; one developer can maintain code written by another, Hettinger emphasized.

Ruby and Python are almost exactly in the same category, Hettinger says. "They have similar performance, design, and applications," he says. Python, though, typically runs slower than compiled languages such as C, but it is dramatically easier to program with and much more concise, McAdams says. "A typical program in C that runs 1,000 lines can often be expressed in 100 to 150 lines in Python," McAdams says.

That may be why Python is serving as the initial language supported by the Google App Engine platform for developing and hosting of Web applications.

Ruby and Rails come on strong
The newcomer dynamic language, Ruby, originated in Japan as a general purpose language used for just about anything short of games programming, notes Bruce Williams, a software developer, or "Rubyist," at FiveRuns.

"It's a very elegant language, it's easy to work with, and because it's not compiled, it's also very quick," Williams says. Developers gain advantages in expressiveness, he says. But it has the same weaknesses as any language that is not compiled thus would not be of use in high-performance applications, says Williams.

Complementing Ruby is the Ruby on Rails Web framework. "I think the big thing that you're going to see anybody talk about with Ruby and with Rails is the speed at which you can develop, which translates to the money side of the house," Williams says.  Development is quick and developers are happy, he says.

From CIO: 8 Free Online Courses to Grow Your Tech Skills
Join the discussion
Be the first to comment on this article. Our Commenting Policies