0% found this document useful (0 votes)
2 views8 pages

Unit 3

The document outlines the characteristics, uses, and applications of scripting languages, highlighting features such as integrated compile and run, low overheads, and enhanced functionality. It discusses traditional and modern scripting, including their roles in system administration, web scripting, and enterprise-level implementations. The document emphasizes the growing importance and versatility of scripting languages in various domains, including web development and automation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

Unit 3

The document outlines the characteristics, uses, and applications of scripting languages, highlighting features such as integrated compile and run, low overheads, and enhanced functionality. It discusses traditional and modern scripting, including their roles in system administration, web scripting, and enterprise-level implementations. The document emphasizes the growing importance and versatility of scripting languages in various domains, including web development and automation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

UNIT 3

CHARACTERISTICS OF SCRIPTING LANGUAGE


Some of the features that characterize scripting languages are
 Integrated compile and run
 Low overheads and ease of use
 Enhanced functionality
 Efficiency is not an issue
Integrated compile and run
 Scripting languages are characterized as integrated language
 They operate on an immediate execution basis, without the need to issue separate
commands to compile the program and then to run the resulting object file, and without the
need to link extensive libraries into the object code.
 This immediate execution is important because scripting is an interactive, experimental
activity that does not fit well with the edit-compile-link-run cycle of conventional
programming.
 A few are indeed as strict interpreters, reading the source file in a single forward pass
without look ahead or backtracking, and performing appropriate as soon as a valid
keyword or construct is recognized.
[Eg.] UNIX shell and versions of Tcl up to version 7.6
 Most of the languages in current use employ a hybrid technique, compiling to an
intermediate form which is the interpreted.
 This intermediate form is usually a representation of the parse tree, at run-time, making it
possible to provide informative diagnosis in case of error.
 In Visual Basic actually builds the parse tree when code is typed, thus providing immediate
feedback on many syntax errors.
Low overheads and ease of use
 Scripting languages have minimum number of clutter.
 Here, variable declarations are optional: variables can be declared by use, and initialized
to something sensible when first used.
 The number of different data types is limited: frequently everything is a string, with
automatic string to number conversion when it requires.
 The number of different data structure is limited: frequently used only data structures is
array.
Enhanced functionality
 Scripting languages have enhanced functionality in some areas.
[Eg.] Most languages provide powerful string manipulation based on the regular expressions,
while other languages provide easy access to low level operating system facilities.
Efficiency is not an issue
 Ease of use is achieved at the expense of efficiency
[Eg.] Interpretation rather than compiling
 Many scripts will be used only once.
[Eg.] Shell scripts written by a system administrator
 Other scripts will be used on a regular basis.
[Eg.] CGI Scripts

USES FOR SCRIPTING LANGUAGES

The uses of scripting languages is explained under

 Traditional scripting
 Modern Scripting

Traditional scripting
The activities of traditional scripting include

 System administration: automating everyday tasks, building data reduction tools


 Controlling applications remotely
 System and application extensions
 'Experimental' programming
 Building command-line interfaces to applications based on C libraries
 Server-side form processing on the Web using CGI.

System Administration:
 Automating everyday tasks, building data reduction tools, and controlling systems remotely.
 System administrators often use scripts to automate tasks such as adding new users or
backing up file systems. Shell scripts, sequences of shell commands executed from a file,
serve this purpose well.

Experimental Programming:

 Scripting languages are ideal for 'experimental programming,' where requirements are
unclear at the outset, and multiple iterations are needed.
 They allow quick experimentation without the overhead of traditional edit-compile-link-load
cycles.

Building Command-Line Interfaces:

Scripting languages help create command-line interfaces for applications based on C libraries,
enabling users to automate and control applications effectively.

Server-Side Scripting:

Handling web forms and other server-side tasks using CGI (Common Gateway Interface).

Application Automation:

Remote control of applications, often requiring conditional logic to handle different stages of
interaction. This capability evolved from controlling dial-up links to modern remote application
automation.

System and Application Extensions:

Enhancing system and application capabilities through scripting. For example, early desktop
applications allowed users to automate sequences of operations using macros, which evolved
into sophisticated scripting capabilities like those in Visual Basic for Applications (VBA).

Text Manipulation:

o Specialized scripting languages like AWK and Perl are used for processing and manipulating
textual data. They integrate capabilities for text manipulation with system command
execution, making them powerful tools for system administrators and developers.
Modern Scripting

Modern scripting languages often incorporate object-oriented principles and are used in more
advanced and varied contexts:

Visual Scripting:

 Constructing graphical interfaces using visual objects like controls in Visual Basic or widgets
in Tcl/Tk and Perl-Tk. These objects respond to events such as mouse clicks, and the
response actions are defined by scripts.
 Visual scripting is used to create new applications or to develop visual interfaces for existing
applications, often as prototypes.

Scriptable Components:

 Modern applications are built around the concept of scriptable components, which expose
interfaces conforming to a scripting architecture.
 Components may include visual elements, parts of compound documents, or more substantial
functional objects like spellcheckers or database interfaces.

Client-Side and Server-Side Web Scripting:

Enhancing web pages with client-side scripts (e.g., JavaScript) for dynamic interaction and
server-side scripts for backend processing.

Component-Ware and Glue Code:

 Developing applications from off-the-shelf components. Scripting languages serve as 'glue' to


connect different parts of an application or multiple applications.
 This approach allows combining powerful, media-rich applications with compiled routines
written in low-level languages for performance-critical operations.

WEB SCRIPTING

 The web is one of the most fertile areas for the application of scripting languages today.
 Web scripting can be divided into three main areas:
o Processing web forms
o Creating pages with enhanced visual effects and user interaction
o Generating pages dynamically from material held in a database

Processing Web Forms

 From the early days of the web, HTML has allowed a basic form of user interaction through
the use of forms. These forms are defined by HTML tags within a document. In the original
implementation, when a user submits a form, the information entered is encoded and sent to
the server, where it is processed by a CGI (Common Gateway Interface) script. This script
eventually generates an HTML page that is sent back to the browser.

Key aspects of processing web forms include:

 Data Encoding and Decoding: When a form is submitted, the data needs to be encoded in a
way that the server can understand. CGI scripts on the server decode this data to process it.
 Text Manipulation: Creating the HTML response page often involves extensive text
manipulation.
 System Access: The script might need to run other processes or establish network
connections to gather or process the required information.
 Given these requirements, Perl has become the language of choice for CGI scripting due to
its text manipulation capabilities and handling of untrusted data.
 For more immediate feedback, some form processing can be done on the client side using
languages like JavaScript or VBScript. This client-side validation can check the form data
before it is sent to the server, improving the user experience by catching errors early.

Dynamic Web Pages

 Dynamic web pages provide enhanced visual effects and user interactions.
 This is achieved through scripting languages that interact with the Document Object Model
(DOM) of the webpage.
 The DOM represents all elements of a webpage (like headings, emphasized text, tables, and
form components) as scriptable objects.

Dynamic scripting involves:

 Client-Side Scripting: Languages like JavaScript (or JScript in Microsoft environments)


can manipulate these DOM elements to create dynamic effects such as animations,
interactive forms, and responsive designs that adjust to user inputs or browser
capabilities.
 Browser Capabilities: Scripts can gather information about the user's browser to
optimize the presentation and functionality of the webpage.

Microsoft's ActiveX technology enhances user interaction by allowing the embedding of


ActiveX controls, which are visual objects that can be scripted for complex interactions. This
makes webpages more interactive and engaging.

Dynamically Generated HTML

Another significant use of web scripting is the generation of HTML content dynamically on the
server. This approach is particularly useful for creating pages that draw content from a database.
Common implementations include:

 Server-Side Scripting: Languages like PHP, ASP (Active Server Pages), and JSP
(JavaServer Pages) generate HTML dynamically based on the data retrieved from
databases.
 Database Integration: This allows for the creation of dynamic content that can change
based on user inputs, database updates, or other factors.

For example, Microsoft's IIS Web server supports Active Server Pages (ASP), which allows
embedding scripts written in JScript or VBScript within HTML pages. This facilitates the
creation of dynamic and data-driven web pages.
UNIVERSE OF SCRIPTING LANGUAGES

 The world of scripting languages is vast and multifaceted, comprising various overlapping
domains each with its unique applications and characteristics.
 These domains can be broadly categorized into traditional scripting, modern scripting, and
web scripting, each forming integral parts of what we might call the "scripting universe."
 This universe includes several overlapping worlds:

1. Traditional Scripting in the UNIX World


o Languages: Primarily Perl and Tcl.
o Applications: These languages were originally used for system administration
tasks, automating everyday processes, building data reduction tools, controlling
remote systems, and creating command-line interfaces.
o Platforms: Initially exclusive to UNIX, Perl and Tcl are now available on most
platforms, making their powerful text processing and automation capabilities
widely accessible.
2. Microsoft World of Visual Basic and ActiveX Controls
o Languages: Visual Basic (including Visual Basic for Applications - VBA) and
scripting for ActiveX controls.
o Applications: Used extensively in Windows environments to automate tasks
within Microsoft Office applications, create sophisticated macros, and enhance
user interfaces through embedded visual objects (ActiveX controls).
o Features: This world emphasizes ease of use and integration with the Windows
operating system and its applications, providing powerful tools for automation
and user interface enhancement.
3. Scripting Compound Documents
o Languages: VBA, among others.
o Applications: Focuses on scripting within compound documents, such as those
created in Microsoft Office, where different types of data (text, graphics,
spreadsheets) can be embedded and manipulated within a single document.
o Capabilities: Allows for the automation of complex document workflows and
integration of various types of content within a single cohesive framework.
4. Client-Side and Server-Side Web Scripting
o Languages: JavaScript/JScript, VBScript, Perl, Tcl, and others.
o Applications: Includes creating interactive and dynamic web pages, processing
web forms, and generating content dynamically from databases.
o Client-Side Scripting: Languages like JavaScript and VBScript enhance user
interaction by manipulating the Document Object Model (DOM) within the
browser.
o Server-Side Scripting: Technologies like PHP, ASP, JSP, and server-side
implementations of Perl and Tcl dynamically generate web content based on user
input and database interactions.

Emerging Applications of Scripting Languages

The scripting universe continues to expand with new and innovative applications:

1. Enterprise-Level Implementations
o Examples: Tcl has been used to develop robust manufacturing systems, while Perl
has been employed to implement enterprise-wide document management systems for
large aerospace companies.
o Advantages: The significant increase in processor power in recent years has
mitigated the performance concerns traditionally associated with scripting languages.
This allows organizations to leverage the order-of-magnitude increase in productivity
that scripting languages offer, resulting in faster development cycles and more
flexible solutions.
2. Increased Productivity and Efficiency
o Modern Context: The ease of use and rapid development capabilities of scripting
languages make them ideal for prototyping, automating complex workflows, and
building interactive applications quickly and efficiently.
o Performance Considerations: With modern hardware, the performance overhead of
scripting languages is often negligible compared to the productivity gains they
provide. This shift has made scripting languages an attractive option for a wide range
of applications beyond their traditional uses.

You might also like