unit 1-introduction to scripts

9
SCRIPTING LANGUAGES BY SANA MATEEN 6/13/2016 1 Introduction to scripts and scripting

Upload: sana-mateen

Post on 08-Apr-2017

13 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: Unit 1-introduction to scripts

Introduction to scripts and scripting 1

SCRIPTING LANGUAGESBY

SANA MATEEN

6/13/2016

Page 2: Unit 1-introduction to scripts

Introduction to scripts and scripting 2

INTRODUCTION TO SCRIPTS AND SCRIPTING Script is a program written for special runtime environment that

automate the execution of tasks. Scripting is the action of writing scripts using scripting language. Scripting Language are used to extend the functionality of

software . For example enhancing web pages by providing dynamic content.

They are designed to automate frequently used task that usually involve calling or passing commands to external program.

Examples: 1. PERL- PRACTICAL EXTRACTION AND REPORT LANGUAGE2. PHP-Hypertext Preprocessor(Personal Home Page)3. TCL-Tool Command Language and PYTHON

TCL6/13/2016

Page 3: Unit 1-introduction to scripts

Introduction to scripts and scripting 3

SCRIPTING VS. PROGRAMMING: IS THERE A DIFFERENCE?Scripting Programming

Scripts are interpreted . It means they are processed from scratch every time you run them.

Programs are executed.

Problems addressed by Scripting language Building applications from off-the-shelf components. Example:

Use of Visual Basic to develop GUI using prebuilt Visual Controls.

Controlling applications that have a programmable interface(protocols to be followed while building a software).

Speed of development is more important than runtime efficiency.

6/13/2016

Page 4: Unit 1-introduction to scripts

Introduction to scripts and scripting 4

ORIGIN OF SCRIPTING The UNIX O.S developers coined the term shellscript for sequence of

commands that were read from a file and followed in sequence. Script is a file that is intended to be executed directly rather than being

compiled. Examples of scripts with respect to unix system are: AWK: This utility reads the standard input line by line and takes an action on

part of entire line. These actions are specified in awk script that consist of list of instructions.

Perl: is a scripting language developed by Larry Wall, especially designed for text processing.

Though Perl is not officially an acronym but many times it is used as it stands for Practical Extraction and Report Language.

It runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.

6/13/2016

Page 5: Unit 1-introduction to scripts

Introduction to scripts and scripting 5

ORIGIN OF SCRIPTING In DOS(Disk Operating System), use of dial up connection to remote

system require scripts that automate the sequence of operation required to establish a connection to remote system.

Use rasphone( Remote Access Phonebook) command.

Another occurrence of script was in Apple Macintosh HyperCard Application, which is one of the Hypertext system.

6/13/2016

Page 6: Unit 1-introduction to scripts

Introduction to scripts and scripting 6

SCRIPTING TODAY Scripting allows application to be developed much faster than

traditional methods allow. We can use it to manipulate,customize,automate the facilities of

existing system. Eg: Use of client side scripting and Dynamic HTML to create

interactive and feature rich enhanced web pages. Using Scripting Language with its rich functionality .These are used

by UNIX admin for System maintenance work, like managing user permissions.

Windows system admin adopt Perl for their work. Apache web server has an embedded Perl interpreter for CGI scripts

6/13/2016

Page 7: Unit 1-introduction to scripts

Introduction to scripts and scripting 7

CGI SCRIPT ISAPI TECHNOLOGY CGI stands for Common

Gateway Interface. It defines a standard way in

which information may be passed to and from the browser and server.

CGI scripts can be written using PERL.

ISAPI stands for Internet Server Application Program Interface technology . It is set of window program calls that let you write a web server application that will run faster than CGI.

We can create Dynamic Link Library application file using this technology.

We can write an ISAPI script in any language that will create an executable object on your system. For example, C++, Visual Basic, or Perl script on Windows.

6/13/2016

Page 8: Unit 1-introduction to scripts

Introduction to scripts and scripting 8

CHARACTERISTICS OF SCRIPTING LANGUAGE Integrated Compile and Run

Scripting Language behave as if they were interpreted. They are often an interactive, experimental activity that doesn’t fit well with the “edit-compile-link-run” cycle of conventional programming.A few Scripting Languages like Unix Shell and TCL(Tool Command Language) version 7 are indeed implemented as strict interpreters.However most of the languages in current use opt for hybrid technique which involve compiling to an intermediate form which is then interpreted.

Low Overhead and ease of useBased on the usage variables can be declared and initialized . Later focus was on explicit variable declaration, which requires that you declare every variable before you use it.Eg: Dim sum As Integer (or) sum=10;

Enhanced FunctionalityMost of the languages provide powerful string manipulation based on the use of regular expression(A regular expression is a string of characters that define the pattern or patterns you are viewing. ). Some languages support easy access to API or Object model exported by application.

6/13/2016

Page 9: Unit 1-introduction to scripts

Introduction to scripts and scripting 9

CHARACTERISTICS OF SCRIPTING LANGUAGE Efficiency is not an issue

Ease of use is achieved at the expense of efficiencyeg: interpretation rather than compilingFocus is not on high performance but on the speed of development together with ability to make changes to meet new requirement.

6/13/2016