Scripting Languages
Home Operating Systems Windows XP Objects Java

Abstract

Increases in computer execution speed and changes in the application mix are making scripting languages more and more important for the present and future applications. Scripting languages are mainly designed for gluing applications together. They use type less approaches to achieve a higher level of programming and more rapid application development.

There is an overview on Programming Languages. There are a number of script languages for different purposes. Here in this overview, I discuss the need for the script languages, their distinct benefits, the domains where the scripting languages stand tall relative to system programming languages. Finally, their significant contributions on the Web especially on the server-side of Web applications for creating dynamic and interactive web pages.

Dynamic Web Server Applications

The world wide web has evolved from serving static web pages, where web sites acted as little more than electronic billboards, to serve dynamic web pages. This evolution of the world wide web has brought several exciting technologies that facilitate the more serious business of deploying applications on the Web as opposed to simply displaying pages or images. Today's web sites have more sophisticated user-interfaces in the form of dynamic web pages that are responsive to the user's actions. Scripts running on either the server and/or the browser allow access to applications and data in a way that hitherto had only been available using traditional non web-based user interfaces. These developments make it possible for Web programming. Technologies such as Common Gateway Interface (CGI) and different programming and script languages started to get the attention of Web application developers. CGI scripts can be programmed using many different programming languages. Perl is being mainly used as a scripting language for developing CGI-based scripts. As CGI is an interface, the scripting language has to implement certain methods to make the scripts CGI-compliant.

Scripting Languages

Scripting languages are designed for accomplishing different tasks. They are designed for gluing. They assume the existence of a set of powerful components and are intended primarily for connecting components. Scripting languages are typeless to simplify connections among components and provide rapid application development.

Scripting languages and system programming languages are complimentary and most computer platforms have included both kinds of languages. The languages typically used together in component frameworks, where components are created with system programming languages and glued together with scripting languages. However, several recent trends, such as faster machines, better scripting languages, the increasing importance of graphical user interfaces and component architectures and the growth of the Internet, have greatly expanded the applicability of scripting languages.

Scripting languages such as Perl, Python, Rexx, Tcl, Visual Basic and the Unix shells represent a very different style of programming. Scripting languages assume that a collection of useful components already exist in other languages. They are not intended for coding applications from scratch but for combining existing components developed in system programming languages. For example, Tcl and Visual Basic can be used to arrange collections of user interface controls on the screen and Unix shell scripts are used to assemble filter programs into pipelines. Scripting languages are often used to extend the features of components. Scripting languages are sometimes called as system integration languages or glue languages.

Scripting languages are generally typeless. To simplify the task of connecting components, scripting languages tend to be typeless. All things look and behave the same so that they are interchangeable. For example, in Tcl or Visual Basic, a variable can hold a string one moment and an integer the next. Code and data are often interchangeable so that a program can write another program and then execute it on the fly. Scripting languages are often string-oriented, as they provide uniform representation for many different things.

A typeless language makes it much easier to hook together components. There are no a priori restrictions on how things can be used, and all components and values are represented in a uniform fashion. Thus any component or value can be used in any situation; components developed for one purpose can be for totally different purposes never foreseen by the creator of the component. Thus typeless nature also encourages significant reusability. The idea here is to design interesting components using system programming languages, to glue them together using scripting languages into applications. This division of labor provides a natural framework for reusability. Also all scripting languages have some support for OO programming and thus acquire the advantages of OO programming. Also scripting languages, being typeless languages, need lesser number of code lines for a task, while system programming languages needs more number of lines of code for achieving the same.

The typeless nature of scripting languages could allow errors to go undetected, but in practice, scripting languages are equally safe as higher-level languages. Strong typing allows errors to be noticed at compile time itself, but scripting languages do their error checking at the last possible moment, when a value is used.

Scripting languages are interpreted. Interpreted languages provide rapid turnaround during development by eliminating compile time errors. Interpreters also make applications more flexible by allowing users to program the applications at run time. Interpreters also allow powerful effects to be achieved by generating code on the fly. On the negative side, scripting languages are less efficient as they use interpreters rather than compilers. Also their basic components are chosen for power and ease of use rather than an efficient mapping onto the underlying hardware. For example, scripting languages often use variable-length strings in situations where a system programming language would use a binary value that fits in a single machine word, and they use hash tables where system programming languages use indexed arrays.

Applications for scripting languages are generally smaller and the performance of a scripting applications tends to be dominated by the performance of the components. Scripting languages are higher-level than system programming languages in the sense that a single statement does more work on average. A typical statement in a scripting language executes hundreds or thousands of machine instructions, whereas a typical statement in a system programming language executes about five machine instructions. The reason behind this is due to the usage of interpreters and the primitive operations in scripting languages have greater functionality. Scripting languages allow rapid development of gluing-oriented applications. For gluing and system integration, applications can be developed five to 10 times faster with a scripting language

Thus scripting languages are better suited for developing the applications if their main task is to connect preexisting components; if the application has to manipulate a variety of things; if the application include a GUI; if the application has to do a lot of string processing; and if the application need to be extensible. Scripting languages are very easy to learn and write because they have simpler syntax and they do not have complex features such as objects and threads. Also there are more number of applications that have been coded using scripting languages rather than system programming languages.

Finally, scripting languages represent a different set of trade-offs than system programming languages. They sacrifice execution speed and strength of typing to provide significantly higher programmer productivity and software reuse. This trade-off is to make more sense as computers become faster and cheaper and the value of programmers goes up. Scripting languages are well suited for gluing applications where the complexity is in the connections. Gluing tasks are becoming more and more prevalent, so scripting will become an increasingly important programming paradigm in this twenty-first century. Thus it is expected that scripting languages are going to be a major force in application development especially in the Internet programming tasks, GUIs, and Component frameworks.

The scripting languages on the Web can be further subdivided into two: Server-side and Client-side scripting languages.

Server-Side Scripting Languages

The creation of dynamic content that is necessary for real-world applications to be accessed through web pages, has largely been achieved through server-side scripting languages apart from CGI scripts, such as Active Server Pages (ASP), Java Server Pages (JSP) and Servlets, Python and PHP scripts.

Traditionally the creation of dynamic web pages was largely achieved through CGI. The actual script can be written in any scripting language or any language as long as the compiler or interpreter is available on the server machine provided the output generated is intelligible to the CGI interface. The one disadvantage coming with CGI scripts is slow performance as the web server has to spawn a separate process to handle each execution of a CGI script. There came a number of enhancements for the issues concerning with CGI scripts and in the course of time, many specialized server-side scripting languages have been designed to improve the performance with additional novel server-oriented features. But still CGI programming goes in full steam among the software developers and be a solid base for other server-side programming languages to come up and grow to meet the needs.

Practical Extraction and Report Language (Perl) is one of the most widely used languages for Web programming today. Larry Wall began developing this high-level programming language in 1987. The goal set for Perl was to make it a programming language to monitor large software projects and generate reports. Perl's advantages lies in the facts that it is more powerful than shell scripting and more flexible than C and it is fitted with rich text-processing capabilities. Finally, it makes common programming tasks straightforward and easy. Perl is famous for its power and flexibility.

The actual power of server-side scripting languages is not due to this capability alone, but due to the fact that several of these languages have a wide repertoire of connectivity and accessibility APIs that allow these scripts to interact with back-end databases and other specialized servers.

The server-side scripts are interpreted by the web server. Most server-side scripting languages usually embed their scripting components within a HTML file. So, when the web server reads them from the file system to service a request from a browser, it interprets the script and generates the appropriate HTML to be returned to the browser. This contrasts with ordinary web pages where the server fetches an HTML-only static page directly from the file system and passes it onto the browser without any interpretation. The script interpretation might not actually be done by the web server but by a special software called CGI interpreter in the case of CGI scripts. If the script language used is PHP, then it is PHP interpreter.

Back to Top