Industry


Ads by TechWords

See your link here


David Intersimone's picture
David Intersimone

Once More into the Code

Polyglot programming -- development in multiple languages

When I ask developers "what programming language do you use?", the answer I often get is a single language.  Most developers define themselves as a Java, C++, Delphi, C#, Visual Basic, PHP, Ruby or Python developer.  Some web developers will say they use JavaScript.  In fact, most developers use several programming languages.  Who doesn't also use JavaScript, HTML, XML, WSDL, SQL and other languages (domain specific, procedural, markup, functional, object-oriented, etc.)?

To build web applications developers need to leverage a server-side language like PHP, Perl, Python and client-side language like JavaScript.  To build enterprise business objects many developers will choose to use Java, C++ or to wrap legacy systems with SOAP and RESTful web services.  In systems with multiple processors and multiple cores some developers are now using functional programming languages like Haskell, Erlang and Scala.

Neal Ford, Software Architect and Meme Wrangler at Thoughtworks, (in his blog post on December 5, 2006) calls this use of multiple programming languages "polyglot programming".  He says, "Now, increasingly, we're expanding our horizons. More and more, applications are written with Ajax frameworks (i.e., JavaScript). If you consider the embedded languages we use, it's even broader: XML is used as an embedded configuration language widely in both the Java and .NET worlds."

There is also a website focused on polyglot programming.  The website is "dedicated to exploring the benefits (and drawbacks) of combining multiple programming languages and multiple "modularity paradigms" in application development. The "paradigms" include Object-Oriented Programming, Aspect-Oriented Programming, Functional Programming, etc."

What combination of languages do you (or should you) use in most of your application development?  Is there a perfect language combination for all of your work?    Depending on the requirements, you will at least consider a mix of four language choices: an object-oriented language, SQL, a markup language and a scripting language.  There are many articles and conference presentations describing the "right language for the right job".

Several examples of polyglot programming are listed on the Polyglot (computing) Wikipedia page:

Sadek Drobi, in an InfoQ article, discussed "Paradigm based Polyglot Programming".  "To be able to do the right decision one should keep in mind that the main reason of adopting polyglot programming is to be able to choose the right programming language for the domain problem at hand. But then, the question is how to choose the right language for a given domain or sub-domain?"  He guides developers to take into consideration the properties of each programming language, the paradigm (or paradigms) that a language embodies and to choose the right languages for the application domain or sub-domain.

For native code development, you can (often) link code from several compiled language programs to create executables, libraries and dynamic link libraries or shared objects.  For managed code development, the byte-code based Java and .NET virtual machines both support multiple programming languages.  When you need to mix programming and scripting languages you will often have to use multiple runtimes.  Does this sound too complicated?  Years ago, developing and deploying applications built with multiple languages required a team of software developers.  Today, we don't think twice about leveraging multiple languages in our every day development work.

What programming, scripting, domain specific and markup language combinations do you use?  Post a comment below.

Programming is Life!

Recent news for developers:

Swine Flu Emergency Should Put IT on Alert
Android 2.0 SDK is released
Thinking Functionally In Ruby
Software That Gets Reduced, Reused, Recycled
Software That Fixes Itself
8 Awesome Mashups Made Possible by APIs
Interview with a Digg.com Software Engineer Kurt Wilms
World's Smallest Computers Made of DNA and Other Biological Molecules Made to 'Think' Logically
Healthcare Information Integration
Most Enterprises Lack a 'Real-Time' Strategy
Ubuntu Linux 9.10 'Karmic Koala' Starts Its Climb


David Intersimone (David I) is the Vice President of Developer Relations and Chief Evangelist for Embarcadero Technologies. My company blog is at http://blogs.embarcadero.com/davidi

What People Are Saying

Ok

Ok article, but as a old-timer I can not but wonder why people these days consider writing something in some markup as "programming".

Do you really "program" HTML?

Not all work is on small machines.

Assembler and REXX on the mainframe, Shell Script,
Bash, REXX, HTML, JavaScript, VB, etc. on those
little weenie machines.. ;)

people answer with their primary language

My primary programming language is VB, both .Net and VB6, so that is what I would answer if you asked me that question. I know and use many other languages also.

However, being unemployed, I scan the job boards daily, and I see at least 50 ads wanting 2 years of C# for every 1 ad I see wanting VB.Net. I've already taught myself C#, but I can't teach myself to have 2 years experience working with it. So I am being punished for the choices of my former employers.

Polyglot programming is

Polyglot programming is actually easiest for the hobbyists. Typically, they're the ones doing it for fun and doing their own build scripts by hand, building all the code in a text editor.

For professional programmers that have to knock out large quantities of work, IDEs and code generators have become a requirement. Unfortunately polyglot programming becomes quite difficult in those environments. :-(

I personally prefer to use Java, Scala, and Clojure for current projects, but the IDE/integration issues mean that most times it turns into Java only code. I also use C#, F#, C, C++, Common Lisp, Scheme, x86 Assembly, and Modula-2, but only one language per project for ones where an IDE is available due to those same integration issues.

My own

I'm making my own programming language and virtual machine :D

I know VB.Net, and am also

I know VB.Net, and am also currently programming in Java and C++ (still learning/improving in both). I also plan to start learning C# soon, and will eventually learn JavaScript and Python.