Scripting Languages CS 351 – Programming Paradigms.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

 2005 Pearson Education, Inc. All rights reserved Introduction.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Server-Side vs. Client-Side Scripting Languages
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
Introduction to PHP. PHP Origins Rasmus LerdorfRasmus Lerdorf (born Greenland, ed Canada) PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP.
Multiple Tiers in Action
Scripting Languages CS351 – Programming Paradigms.
Scripting Languages CS351 – Programming Paradigms.
Scripting Languages. Originally, a script was a file containing a sequence of commands that needed to be executed Control structures were added to make.
Hello, world! Dissect HelloWorld.java Compile it Run it.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
PHP: Hypertext Processor Fred Durao
UFCEKG-20-2 Data, Schemas & Applications Lecture 4 Server Side Scripting & PHP.
Intro to PHP Introduction to server-side scripts (It’s all good :D) © TAFE NSW
+ Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere Two-stage debugging Java is an Object Oriented Programming.
Web Design Scripting and the Web. Books on Scripting.
Copyright © Curt Hill PhP History and Introduction.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
INTERNET APPLICATION DEVELOPMENT For More visit:
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
November 2003Bent Thomsen - FIT 6-11 IT – som værktøj Bent Thomsen Institut for Datalogi Aalborg Universitet.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Architecture of the web Client Server retrieved or generated web page.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
Introduction to PHP Advanced Database System Lab no.1.
What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP supports.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
CS 598 Scripting Languages Design and Implementation 1. Introduction 1.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
1 PHP Intro PHP Introduction After this lecture, you should be able to: Know the fundamental concepts of Web Scripting Languages in general, PHP in particular.
Creating FunctionstMyn1 Creating Functions Function can be divided into two groups: –Internal (built in) functions –User-defined functions.
Scripting Languages Info derived largely from Programming Language Pragmatics, by Michael Scott.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic properties and characteristics of external files ❏ To.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
Lecture 1b- Introduction
CS 330 Class 7 Comments on Exam Programming plan for today:
Scripting Languages Info derived largely from Programming Language Pragmatics, by Michael Scott.
Basic 1964 PC general purpose Imperative Small Easy to use.
Introduction and Principles
Introduction Python is an interpreted, object-oriented and high-level programming language, which is different from a compiled one like C/C++/Java. Its.
Chapter 7 Text Input/Output Objectives
PHP / MySQL Introduction
PHP Introduction.
Introduction to Computers and Python
PHP.
Introduction to Java Brief history of Java Sample Java Program
Lecture 10: The Web Server Wednesday February 14, /10/2019
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
General Computer Science for Engineers CISC 106 Lecture 03
Web Application Development Using PHP
Presentation transcript:

Scripting Languages CS 351 – Programming Paradigms

Introduction Traditional programming languages are concerned with building a self contained environment that receives input and produces output. Most ``real-world’’ computing however involves the use of multiple programs. For example: Imagine a system that stores a list of numbers in a txt file, 1 per line. Each number must be passed to a database as a parameter for an SQL query. Each query returns a string representing an OS command that must be executed. What is the best way of achieving this scenario?

Option 1 We could write all of this as a Java program: public int getNumFromFile () { … return Integer.parseInt(BufferedReader.readLine()); } public String executeSQL ( int c ) { … return SQL(“select command from table where command = ”+c); } public void executeCommand ( String command ) { … Runtime.exec(command); }

Option 1 cont… What are the drawbacks of this approach? Languages such as Java stress efficiency, portability and maintainability. Their type systems are based upon hardware- level concepts. Examples of this include: fixed sized integers, floating point numbers, characters and arrays. So how can we re-write the problem? Through the use of a scripting language.

Scripting Languages Scripting languages stress flexibility, rapid development and dynamic checking. Their type systems embrace very high level concepts such as tables, patterns, lists and files. There a number of distinct groups that fall under the scripting language family. Languages such as Perl and Python are known as ``glue’’ languages because they were designed to glue existing programs together. There are other extensible types of scripting languages used in the WWW also.

Option 2 Consider the first problem again: read –r var1 < commands.txt while $var1 –ne “” do echo “select command from table where command =“$var1 > query.txt mysql command read –r var2 < command exec $var2 read –r var1 < commands.txt done Using a simple bash script we can solve the whole problem in less than 10 lines!* * May not be exactly correct

What exactly is a scripting language? Scripting languages descend from two main types of ancestors. The first set of scripting languages are those designed to execute terminal commands in batch mode. Examples of this are bash scripts and ``.bat’’ files for MS-DOS. The other type of scripting languages are those designed for text- processing and report generation. Examples of these include the very useful sed and awk. From these two languages grew Perl. Some other general purpose scripting languages about include Tcl, Ruby, Python, and VBScript.

Scripting and the WWW In the early-mid nineties, Perl was adopted to become the language of choice for server-side processing. One guy kept a lot of handy Perl scripts to track access to his home page. These scripts eventually morphed into the a fully fledged independent language known as PHP. This is the most popular server side scripting language. Other competitors to PHP include JSP and VBScript. For client side processing, there is Javascript, a very watered down version of Java created by Netscape 10 years ago.

Common Characteristics of Scripting languages. 1. Both Batch and Interactive use. 2. Economy of Expression. 3. Lack of declarations; simple scoping rules 4. Flexible dynamic typing. 5. Easy access to other programs. 6. Sophisticated Pattern matching. 7. High-level data types.

1 – Batch and Interactive Use Perl has a JIT compiler that reads the entire program before execution. Other languages are quite happy to only execute a line as soon as it has been read. Python, Tcl and Ruby will also accept commands from the keyboard.

2 – Economy of Expression To support rapid development and interactive use, scripting languages require very little boilerplate code. This can be illustrated very clearly by the following example: public static void main(String args[]) { System.out.println(“Hello!”); } print “Hello!\n” Another example is reading a file word by word.