0% found this document useful (0 votes)
22 views26 pages

Alternative Paradigms 6

Uploaded by

kotavidhya68
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views26 pages

Alternative Paradigms 6

Uploaded by

kotavidhya68
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 26

Alternative Paradigms:

Scripting Languages
What is a Scripting Language?
A script or scripting language is a computer language that does not
need the compilation step and is rather interpreted one by one at
runtime.
• Scripts are often utilized to create dynamic web applications
nowadays because they are linked to web development.

• Server-Side Scripting Languages and Client-Side Scripting Languages


are the two types of scripting languages.

• Python, PHP, and Perl are examples of server-side scripting languages,


while JavaScript is the greatest example of a client-side scripting
language.
Common characteristics of Scripting
Language
Scripting languages are a type of programming language that have
several characteristics

Interpreted
Scripts are usually interpreted directly from source code or bytecode,
rather than being compiled.
Short and simple
Scripts are typically relatively short and simple, but there is no limit on
their size or complexity.
Automates tasks
Scripts automate tasks that would otherwise be performed manually by
a person.
Limited language
Scripting languages generally have limited capabilities compared to
general-purpose languages.
Dynamic typing
The type of a variable can change at runtime, making it easier to write
flexible code.
Case-sensitive
Some languages, like JavaScript, are case-sensitive, meaning that
identifiers must be typed with consistent capitalization of letters.
Server-side or client-side
Server-side scripts run on the web server before a webpage loads,
while client-side scripts are processed on the client side.
Starts at the top
Scripts typically start executing at the first line of code.
There are multiple scripting languages available some are as follows:

bash: default command interpreter on most GNU/Linux


Ruby: It is a scripting and pure object-oriented programming language
Node js: It is not a programming language that reads and writes files on
a computer/server and handles networking
Python: It has high-level data structures built in.

Perl: It is a scripting as well as dynamic programming language with


innovative features.
Application of Scripting Languages

Scripting languages are used on the server-side as well as the client-


side and are also widely used in web applications.
Like Python scripts, Perl, Shell is all the scripting languages, which are
used in system administration.
It is used to construct plugins and extensions for current applications,
as well as in games and multimedia.
Advantages of scripting languages
• Easy learning: There is not much need for the knowledge of web
technology.
• Fast editing: It uses a small amount of data structures and variables.
• Interactivity: It includes background and foreground colors and so on,
which helps to create enhanced web pages.
• Functionality: They are different from normal programming
languages.
Some other key points of advantages of scripting languages are also
given below:
It can port easily between different operating systems.
It directly executes the files without needing compilation but
sometimes may be required to compile when necessary.
It is an open-source platform that makes capable of users to view and
edit the script when required.
As compared to an actual program, it is much faster to develop.
Disadvantages of scripting languages
It enables users to view and code that may be prohibited by some
companies.
These languages did not compile the file and interpret it directly, which
need to install an interpreter or separate program by the users before
running the script.
Compared with a compiled program, scripting languages may be slow in
some situations.
Different Problem domains
Shell / command line Language
1) File Name and Variable Expantion

Ls *.pdf

Ls fig1.pdf fig2.pdf fig3.pdf

For image in *.png


Do
Png3pdf $image
Done
For image in *.png Do Png3pdf $image Done
2) Test , Queries and Condition

For image in *.png


Do
Target=${image .png} .pdf
If [$image –nt $target]
Then
Png3pdf $image
fi
Done
3) Pipes and redirection

(|) vertical Bar


-l count no. lines
-u removes duplication

4) Quoting and Expantion


5) Function
etc
Definitions
Name: Identifiers that allow us to refer to variables, constants,
functions, types, operations, and so on
Binding: An association of a name with an object
Scope: The lifetime of a binding of a name to an object.
Consider this example of a variable binding:
{
S1
int x = e;
S2
}
• x is a name
• int x = e; is a binding – associates x with a variable – assigns the result of evaluating
e to the variable
• The scope of x is where the binding is active – typically the statements S2 that
follow the binding
Static and Dynamic scope
Scope is an important concept in programming languages – one cannot
read or write large programs without properly understanding the
concept of scope.

The scope of a variable in a program is the lines of code in the program


where the variable can be accessed.
Int x=5;
Int fun2()
{
Return x;
}
Int fun1()
{
Int x=500;
Return fun2();
}
Int main()
{
Printf(“%d”, fun1());
}}
Int x=5;
Int fun2()
{
Return x;
}
Int fun1()
{
Int x=500;
Return fun2();
}
Int main()
{
Printf(“%d”, fun1());
}}
Variables

Variables are containers


for storing data (storing data values).
Declare a JavaScriptVariable:
• Usingvar
• Usinglet
• Usingconst
declaredwiththevarkeyword:
var x=5;
var y=6;
varz= x+y;
o/p: The valueof z is: 11

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy