SL Unit I
SL Unit I
Coding vs Scripting
• Coding refers to the use of any computer language to compose instructions for
computers, the programs they run, or both.
• They are usually short, fast, and interpreted from source code or bytecode. Such
environments include software applications, web pages, and even embedded systems
in operating system shells and games.
• Scripting languages support "script," which is small program written for a specific
runtime environment. These are interpreted at runtime rather than compiled.
• It means, to convert the source code to machine code, scripting languages use an
interpreter, not the compiler.
• Speed: The programming languages are faster in speed because of using a compiler,
which usually runs faster as it finds all the errors at once after analysing the program.
In contrast, Scripting languages are slow as they use an interpreter that analyses a
program line by line. Every time it detects an error, it stops further execution until the
error gets removed.
Origin of Scripting
• The use of the word ‘script’ in a computing context dates back to the early
1970s,when the originators of the UNIX operating system create the term ‘shell
script’ for sequence of commands that were to be read from a file and follow in
sequence as if they had been typed in at the keyboard
• The name ‘script ‘ being used for a text file that was intended to be executed directly
rather than being compiled to a different form of file prior to execution.
• Other early occurrences of the term ‘script’ can be found. For example, in a DOS-
based system, use of a dial-up connection to a remote system required a
communication package that used proprietary language to write scripts to automate
the sequence of operations required to establish a connection to a remote system.
• However, scripts only become interesting when they have the added value that comes
from using programming concepts such as loops and branches.
Scripting today
SCRIPTING IS USED WITH 3 DIFFRENT MEANINGS:
1. A new style of programming which allows applications to be developed much faster than
traditional methods allow, and makes it possible for applications to evolve rapidly to meet
changing user requirements.
3. Using a scripting language with its rich functionality and ease of use as an alternate to
a conventional language for general programming tasks, particularly system programming
and administration. Examples: UNIX system administrators for a long time used scripting
languages for system maintenance tasks, and administrators of WINDOWS NT systems are
adopting a scripting language, PERL for their work.
➢ Scripting languages may be designed for use by end users of a program – end-user
development – or may be only for internal use by developers, so they can write
portions of the program in the scripting language.
➢ Scripts are often created or modified by the person executing them, but they are also
often distributed, such as when large portions of games are written in a scripting
language.
Integrated compile and run: SL’s are usually characterized as interpreted languages, but
this is just an over simplification. They operate on an immediate execution, without need to
issue separate command 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 is done automatically. A
few SL’S are indeed implemented as strict interpreters.
Low overheads and ease of use:
1. Variables can be declared by use
2. The number of different data types is usually limited
3. Everything is string by context it will be converted as number (vice versa)
4. Number of data structures is limited (arrays)
Enhanced functionality: SL’s usually have enhanced functionality in some areas. For
example, most languages provide string manipulation based on the use of regular expressions,
while other languages provide easy access to low-level operating system facilities, or to the
API, or object exported by an application.
Efficiency is not an issue: Ease of use is achieved at the expense of efficiency, because
efficiency is not an issue in the applications for which SL’S are designed.
Some of the prominent characteristics of scripting language are as follows:
• It is open-source, which means a user can have full control to view and edit it.
• It is easy to learn and work with.
• Comparatively faster to develop than an actual program.
• It has a limited number of data structures which makes it easy to write and edit.
• The language is beneficial to bring interactivity in web pages.
• It helps in creating new applications in web browsers.
• It is used to create plug-ins and extensions.
Advantages
• It is an easy and quick process to learn coding in Scripting language, and for this,
much knowledge of web technology is not needed.
• With the help of scripting languages, we can add visualization interfaces and
combinations to web pages. Most of the latest web pages need scripting languages for
creating enhanced web pages, fascinating UI, and many more.
• There is less number of data structures and variable to be used, which make it highly
efficient.
Disadvantages
• The main disadvantage of scripting languages is that they are slower than compiled
languages or programming languages because the interpreter in scripting languages
read and analyse each statement line by line during the execution.
• Every time the interpreter detects an error during the execution of program, it stops
further execution until the error gets taken away.
1. Visual scripting: A collection of visual objects are used to construct a graphical interface.
This process of constructing a graphical interface is known as visual scripting.
The properties of visual objects include text on button, background and foreground
colours. These properties of objects can be changed by writing program in a suitable
language.
The outstanding visual scripting system is visual basic. It is used to develop new
applications. Visual scripting is also used to create enhanced web pages.
2. Scripting components: In scripting languages we use the idea to control the scriptable
objects belonging to scripting architecture.
Microsoft's visual basic and excel are the first applications that used the concept of
scriptable objects. To support all the applications of Microsoft the concept of scriptable
objects was developed.
3. Web scripting: web scripting is classified into three forms. They are processing forms,
dynamic web pages, dynamically generating HTML.
3. Markup languages:
➢ Markup languages are a special case in the sense that they are not a real programming
languages, but rather a set of special command words called ’tags’ used to mark up
parts of text documents, that are later used by special programs called processors, to
do all kinds of transformations to the text, such as displaying it in a browser, or
converting it to some other data format.
➢ The basic idea of markup languages is the separation of contents and structure, and
also including formatting commands and interactive objects into the documents.
➢ The first markup language named GML (Generic Markup Language) was created in
1969 by IBM.
➢ Most of these languages were originally created for the Unix environment.
➢ The Perl programming language was made for report generation, which is even
reflected in its name (Practical Extraction and Report Language).
➢ It is commonly said that the primary reason for it’s enormous popularity is the ability
to write simple and efficient CGI scripts for forming dynamic web pages with this
language.
➢ The Python language was originally made as a tool for accessing system services of
the experimental operating system Amoeba.
➢ Unlike Perl and Python, which make it easy to write completely standalone programs,
Tcl relies heavily on C and C++ extension modules.
Web scripting
➢ The process of creating and embedding scripts in a web page is known as web-
scripting.
➢ Web scripting is used to create dynamic content that allows for user interaction with a
web page.
➢ Scripts may be written for a variety of purposes such as for automating processes on a
local-computer or to generate web pages.
➢ The programming languages in which scripts are written are called scripting language,
there are many scripting languages available today.
➢ Common scripting languages are VBScript, JavaScript, ASP, PHP, PERL, JSP etc.
Types of Scripts
There are two distinct varieties of scripts, namely:
• Client-Side Scripts
• Server-Side Scripts
Client-Side Scripts
• Interaction within a web page can be enabled through the use of client-side scripting.
• Downloading of the client-side scripts occurs at the client's end, after which the
browser is responsible for interpreting and running the scripts.
• The scripting that runs on the client side is dependent on the browser. To put that
another way, the client-side browser needs to have scripting enabled before scripts
can be run.
• When client-side interaction is used, client-side scripting is what's needed to make it
work.
• Examples of possible applications for client-side scripting are as follows:
o To obtain information from the screen or browser of the user.
o Online games.
o Modifying the way pages look in the browser without having to reload the
page itself; for example, rolling your mouse over a hyperlink will highlight
that link without having to reload the page.
• VBScript, JavaScript, and jQuery are three languages that are frequently used for
client-side scripting.
Server-Side Scripts
• Using server-side scripting, you are able to finish or carry out a task on the server and
• Because the server is the one doing all of the work in server-side scripting, it does not
matter which browser is being used on the client end of the connection.
• When the information is sent to a server to be processed at the server end, the
scripting that runs on the server is called server-side scripting.
This processing requires string manipulation to construct the HTML page that
constitutes the replay, and may also require system access, to run other processes and to
establish network connections. Perl is also a language that uses CGI scripting.
Alternatively for processing the form with script running on the server it is possible to
do some client –side processing within the browser to validate form data before sending it to
the server by using JavaScript, VBScript etc.
Microsoft’s ActiveX technology allows the creation of pages with more elaborate user
interaction by using embedded visual objects called ActiveX controls. These controls are
scriptable objects, and can in fact be scripted in a variety of languages. This can be scripted
by using Perl scripting engine.