Dynamic Languages for Web Applications :: JavaScript

Nov 09, 2011
Diego Vergara

As I promised, I'm going to talk about dynamic languages and a list of URLs for some mashware IDEs based on the paper I discussed the previous post.

So as you probably know, one of my hobbies is to read papers and discuss them. A complimentary paper I found about the mashware subject Using Javascript as a Real Programming Language discusses the advantages of using dynamic languages such as; Ruby, Python, PHP, and JavaScript among others.

First let's discuss some of the characteristics of a dynamic language:

  1. a) Dynamic Typing: the type of declared variable is determined at runtime.
  2. b) Interpretation: source code is read at runtime, translated into an intermediate representation and then executed.
  3. c) Runtime modification: class hierarchies and other structural and behavioral aspects of the program can be modified at runtime. New functions and variables can be added on the fly.

These languages are usually referred as scripting languages, but that's not true at all and these languages can be, and they must also be used in areas other than scripting.

Let's focus on JavaScript (I'd like to learn groovy so I can talk about it in a post): even though this language has been considered a "Toy" language used to create effects - the power to create applications that equals those ones created in Java and C is huge. Even with its drawbacks JavaScript has proved to be an excellent language for applications development. You can check a demo of this affirmation at: Lively Kernel.

However JavaScript still has some missing characteristics that, in my opinion, are the reasons why this language is still perceived as a "toy" language, some of them are:

  1. a) Extreme permissiveness: It's an extremely permissive, error-tolerant language This can lead to problems that are very hard to trace and debug, if the developer accidentally types a variable incorrectly, this will not report an error - the incorrect name will create a new variable which can become a growing error ball.
  2. b) Lack of modularity: JavaScript objects can be represented in a tree structure, however this implies a performance penalty for objects contained deep in the object tree.
  3. c) Hiding capabilities: JavaScript doesn't provide any support for distinguishing between public or private functions and data.
  4. d) Syntactic issues: JavaScript syntax is redundant. For instance, there are three different ways to define a function.

There's a lot of conclusions that Antero Taivalsaari et al exposed in this paper. Probably, after reading this you can ask: then why can't JavaScript be deemed as only a "toy" language? Well obviously, writing an application with this language will require much more careful writing than with some other dynamic language like PHP or Python, but the idea behind this paper is to show that dynamic languages are a correct choice for Web 2.0 applications. So, I recommend reading this paper.

Before ending this post I want to give the name and url of Mashware IDE. Based on this paper all of them have their advantages and drawbacks, but I can only test some features of Yahoo Pipes, so if you find something interesting please let me know.