When then-open-source developer Jim Hugunin said three years ago he was developing a dynamic open-source language to run on Microsofts relatively new .Net platform, folks thought he was crazy. After all, .Net and open source werent supposed to go together. But now, everyones doing it, and Hugunin works for Microsoft.
Welcome to the world of dynamic programming, where everything from the languages to the players to the partnerships are anything but static. Dynamic languages are flexible languages that enable developers to write code quickly and easily.
“I initially set out to tell Microsoft how terrible .Net was for dynamic languages,” said Hugunin, creator of the IronPython language and a development leader on Microsofts CLR (Common Language Runtime), in Redmond, Wash.
Hugunin said he began work on IronPython—an implementation of the Python language on .Net as an open-source project—only to find out the best way to complete the effort was to join Microsoft.
IBM is building out an EGL (Enterprise Generation Language) that generates COBOL and Java code.
Ruby on Rails leverages the Ruby language to create applications at prototype speed.
The goal of these acronym-laden languages: Simplify the software development process. The winner takes the loyalty of the next generation of developers.
On Sept. 9 at EclipseWorld in Boston, developers can expect to get an update on the Eclipse PHP IDE (integrated development environment) project, in which The Eclipse Foundation is working toward providing a PHP IDE framework for the Eclipse platform.
Like other tool platform providers, The Eclipse Foundation is rushing to support dynamic languages.
The appeal of dynamic languages is clear: As systems continue to grow more complex, developers seek simpler ways to get their work done.
One strong indication that developers are looking for simplicity is the emerging popularity of lightweight programming models such as LAMP (Linux, Apache, MySQL and PHP/Python/Perl) and Ruby on Rails, both of which are based on dynamic languages.
“LAMP is [something] of a backlash against the growing complexity in Java,” said Wayne Duquaine, director of software development at Grandview Systems, in Sebastopol, Calif.
“J2EE [Java 2 Platform, Enterprise Edition] is starting to become a highly complex environment.”
The languages are called dynamic because programs written in them can change their structure as they run. Moreover, dynamic languages are characterized by dynamic typing.
Typing is the process of classifying program variables by the kind of data they hold, such as a string, integer, floating point and so on.
Many of the popular static languages, such as Java, C/C++ and C#, tend to be strongly typed. Strong typing provides strict adherence to rules useful for detecting errors, proponents say.
Dynamic languages perform type checking at run-time, while static languages perform type checking at compile time.
The difference between the two is the time it takes to discover errors. If the language type checks at compile time, there wont be an error at run-time caused by a data type mismatch. If the language waits until run-time to type check, the developer may have to handle an unexpected error then.
However, although static languages reliance on strong typing enables compilers and interpreters to catch more errors early—before they become problems—proponents of dynamic languages say that less-rigorous typing results in smaller, simpler code.
And simpler code tends to attract developers. “I think that dynamic languages are really the next big thing,” said John Lam, a principal consultant and partner at Toronto-based ObjectSharp Consulting.
Instead of fighting these languages, platform vendors such as Sun Microsystems and Microsoft are racing to be the one to best support them on their platform.
Sun is trying to provide support for dynamic languages on the JVM (Java virtual machine), and Microsoft is working to provide support for these languages on CLR.
Whoever gets there first and executes best likely will grab the mind share of developers looking for a more efficient way to work, observers say.
What Sun and Microsoft can offer is a stable, secure platform for dynamic languages to run on and, eventually, supporting tools—such as those for testing, debugging and compiling. Although the vendors lack such tools now, they at least have some of the components in place. Those pieces would take a long time to develop in the open-source community, developers say.
Sun is doing several things to better support dynamic languages, including baking support into the Java platform and making it easier for developers to write code in dynamic languages using the Santa Clara, Calif., companys NetBeans IDE in a project named Coyote.
Meanwhile, Sun also is making changes to the JVM, so, in the future, it can bring over new languages, Hamilton said.
Gilad Bracha, a computational theologist at Sun, said the company is broadening its support for dynamic languages not only to satisfy user demand but also to help broaden the overall community of developers who use the Java platform.
Bracha noted that Sun currently offers support for some dynamic languages on the Java platform, including Jython, Kawa, Groovy and ECMAScript.
“Were solidly committed” to providing enhanced support for dynamic languages by adding a bytecode called invokedynamic and adding hot-swapping support, Bracha said. Hot swapping is the ability to modify code on the fly. Both efforts are part of Java Specification Request 292, the goal of which is to allow scripting languages to be implemented natively on the JVM, Bracha said.
Moreover, Tim Bray, director of Web technologies at Sun, in a recent blog post praised Ruby, calling it, “irresistibly attractive” for programmers proficient in Perl and Java.
Bruce Snyder, a Java developer who is a committer on various Apache projects in Boulder, Colo., said the ability to develop a robust application using a scripting language that runs on the Java platform means that “you get all the benefits of the Java platform as well as the ability to develop enterprise-scalable applications using a scripting language.”
In addition, not everyone needs a compiled language for all their projects, Snyder said.
Some say Java will be better off with dynamic language support.
Marc Fleury, founder of JBoss, now a division of Red Hat in Atlanta, said, “Scripting was always an important part of the programming landscape. … Java has a serious case of Ruby envy, which will be resolved the moment Java adopts these dynamic features.”
Meanwhile, on the .Net side, Microsoft held the Lang.NET symposium on its campus from July 31-Aug. 2, which largely focused on enhancing support for dynamic languages on the Microsoft platform.
Indeed, Hugunin said Microsoft is working to help usher in support for dynamic languages on top of the CLR in a variety of levels and phases.
“What were going to try hard to do is, instead of doing a dynamic language specification, provide a dynamic language library and have guidance on how to use it,” Hugunin said. He added that Microsofts experience with IronPython sets an example for how to implement other dynamic languages on .Net.
In addition, if Microsoft could add the Ruby, Perl and Python libraries into the same pool, programmers could share interoperable languages and pick and choose the right one for a particular job, Hugunin said. “I think theres this democratization of programming coming along,” said Hugunin, adding that dynamic languages will extend the move to democratize programming started by Microsofts Visual Basic.
Meanwhile, Microsoft is hosting a project on its CodePlex development portal to deliver a PHP language compiler for the .Net Framework.
Known as Phalanger, the primary goal of the project, released under Microsofts Shared Source License, is to enable full functionality of existing PHP scripts on .Net without any modification, Microsoft officials said.
Other efforts to bring dynamic languages to .Net include the Gardens Point Ruby.Net Compiler, a project out of Queensland University of Technology, in Brisbane, Australia, to deliver a compiler for Ruby to run on the CLR. Another effort is John Lams RubyCLR, which is a bridge between the Ruby language and the CLR.
Moores law helps
Moores Law Helps
So why the rush toward dynamic languages? Lam said he believes CPU speed and Moores Law are helping to boost dynamic languages, which have been characterized as slow-performing. But advances in processor speed make this a nonissue, he said.
Miguel de Icaza, a Novell vice president in Boston, said faster computers with faster chips and more memory are making dynamic languages suitable for tasks that previously were out of their scope.
“I think that dynamic languages have always enjoyed a strong place in the developer toolbox, and they will continue to,” said de Icaza, who is also founder of the Mono project, which aims to create an open-source implementation of .Net. “Perl, Ruby, Python, Visual Basic and even TCL [Tool Command Language] in its day have always had a strong group of followers,” he said.
Meanwhile, Anders Hejlsberg, a Microsoft software architect in Redmond, Wash., and father of C#, said the days are numbered for imperative programming, which instructs the computer to make room for more declarative programming, which describes what something is like rather than how to create it. This style of programming is especially effective in helping developers take advantage of multicore CPUs, Hejlsberg said.
Hejlsberg said Microsoft has an internal project known as PLinq, which is a parallel implementation of the companys LINQ (Language Integrated Query) technology. LINQ provides integrated querying for objects, databases and XML data.
However, with PLinq, “you write the code the same way, but we arrange for it to run on multiple CPUs,” Hejlsberg said. “So the queries get split up and run on multiple CPUs.”
Although dynamic languages have momentum, Hejlsberg said they lack scale. “Dynamic typing only scales so far,” he said. “When you get into really big projects, its problematic.”
For his part, Lam said its too early to know how dynamic languages will scale. “We just dont have enough experience in building large systems on these things,” he said.
Cedric Beust, an engineer at Google, in Mountain View, Calif., said, “Dynamic languages suffer from some inherent limitations that make them inadequate for large software. So I definitely see them as gaining momentum, but they will never displace enterprise languages such as Java, C# or C++. Some of their features are slowly percolating into enterprise languages, though, which is a good thing.”
Sridhar Iyengar, an IBM distinguished engineer, in Durham, N.C., offered more questions regarding large-scale deployment of applications built with dynamic languages.
“One of the challenges of dynamic languages is how do you test it, how do you debug it and how do you make sure that your application is secure,” Iyengar said. “All of this is tough to do with static languages. Its incredibly harder in dynamic languages.”
Check out eWEEK.coms for the latest news, reviews and analysis in programming environments and developer tools.