Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
a Powerful,
Easy-to-Use,
Open-Source
Scripting
Language
Stephen Ferg
Bureau of Labor
Statistics
1
What we're
going to talk
about...
Executive Summary
Topics
Scripting languages
Python
Issues surrounding use of Python
Open-Source Software
What is a "scripting"
language?
Interpreted
No data declarations
No compilation step
5
In the beginning...
Assembler, C
Fortran, Cobol, Algol
PL/1, Pascal, Basic, C++, Java
Command languages
JCL
TSO CLists, CMS "execs"
Batch files
6
awk
sed
grep
UNIX shell
scripting
languages
Rexx
Tcl, TK
Perl
Python
PHP
Ruby
SAS
Vastly increased
productivity!
10
VB
100
Python, Perl,
Ruby, TCL
Java
10
C++
C
Assembler
None
System Languages
Degree of Typing
Strong
From "Scripting: Higher Level Programming for the 21st Century" by John K. Ousterhout.
11
This version prepared by Dana Moore and updated by Stephen Ferg
12
John Ousterhout
For the last fifteen years a fundamental change
has been occurring in the way people write
computer programs. ...from system programming
languages to scripting languages. This article
explains why scripting languages will handle many
of the programming tasks of the next century
better than system programming languages.
Scripting languages represent a different set of tradeoffs than
system programming languages. They give up execution speed
and strong typing but provide significantly higher programmer
productivity and software reuse.
This tradeoff makes increasing sense as computers become
faster and cheaper compared to programmers.
Scripting: Higher Level Programmingfor the 21st Century - IEEE Computer 1998
13
Robert C. Martin
I think there is a trend in language that will become
more and more evident as the decade progresses. I think
we are seeing an end to the emphasis on statically typed
languages like C++, Java, Eiffel, Pascal, and Ada.
I expect to see an ever increasing use of dynamically
typed languages, such as Python, Ruby, and even
Smalltalk. These languages, and languages of their kind,
will be mainstream industrial languages in the coming
years.
14
Tim O'Reilly
Why Scripting Languages
Matter
People
are so stuck in the personal computer paradigm that
they don't recognize that the nature of applications has
undergone a profound change in the last decade, with most of
the new killer apps running on what has been called the LAMP
platform (Linux-Apache-MySQL-PHP | Perl | Python). People
understand the importance of Linux, Apache and MySQL... but
they still struggle with understanding the "P" in LAMP.
The reason why dynamic languages like Perl, Python, and PHP
are so important is key to understanding the paradigm shift.
Unlike applications from the previous paradigm, web
applications are not released in one to three year cycles. They
are updated every day, sometimes every hour.
15
Agile programming
languages
We really should stop
calling them
"scripting" languages.
"Agile" languages
would be more accurate.
Kevin Altis and Ward Cunningham
16
Powerful
Easy-to-learn
Easy-to-use
Open-Source
"Python" from
"Monty Python's Flying Circus"
17
no DO.. END
no BEGIN..END
no { .. }
19
Indentation as a controlstructure
for i in range(20):
if i%3 == 0:
print i
if i%5 == 0:
print "Bingo!"
print "---"
0
Bingo!
------3
------6
------9
------12
------15
Bingo!
------18
-----
20
Python's advantages
Extensible
22
A fan of
Monty Python's Flying
Circus
23
"Doctor Fun has the dubious distinction of being the first web cartoon.
Doctor Fun was not, however, the first cartoon on the Internet." - http://www.ibiblio.org/Dave/index
25
T-shirt Slogan
Python:
Programming the way Guido
indented it
26
The
Theoretical Physics Division at Los Alam
os National Laboratory
uses Python to control large-scale
physics codes on massively parallel
supercomputers, high-end servers, and
clusters.
31
Should we be using
Python? ....
32
Issues to Consider
when Evaluating
a Programming Language
33
Frank Stajano
GUI
strings
regular expressions
database connectivity
HTTP, CGI, HTML, XML
numeric processing
debugger
object persistence
35
38
39
Is productivity an issue?
Bruce Eckel
Andy Hertzfeld
40
41
42
Is maintainability an issue?
43
Is weirdness an issue?
"Python's use of whitespace stopped
feeling unnatural after about twenty
minutes.
I just indented code, pretty much as I
would have done in a C program
anyway, and it worked."
Eric S. Raymond
44
45
Is support an issue?
Python is an "open-source" language.
It has no vendor.
Does that mean we'll have support
problems?
What about...
Vendor longevity?
Consulting & training support?
Books and reference materials?
Tools? IDEs, debuggers, screen-painters?
46
What is "Open-Source"?
48
50
"LAMP"
Linux
Apache
MySql
PHP | Perl | Python
51
Is Open-Source software
used in the Federal
Government?
http://egovos.org/pdf/dodfoss.pdf
52
The Open Source Reference Book 2003 What Local/National Governments, the
Defense Establishment, and The Global
1000 Need To Know About Open Source
Software (November 2003)
Is vendor longevity an
issue?
What if Guido got run over by a bus?
58
Is mindshare an issue?
The Python community is very
active and growing rapidly
EuroPython conference
Newsgroup
Activity
comp.lang.*
December
2002
Statistics compiled
by
Aaron K. Johnson.
java
c++
c
perl
python
basic
ruby
lisp
tcl
pascal
smalltalk
fortran
cobol
26953
19913
13874
10486
9647
7909
6466
6132
5256
4229
2398
2355
1845
61
1
2
3
4
5
6
July 2003
7
8
9
10
based on the
11
number of hits
12
returned by a
Google search 13
14
TIOBE
Popularity of
Programming
Languages
Index
Java
44.3
C 36.8
C++
33.2
Perl
18.3
(Visual) Basic
15.5
PHP
7.6
SQL
6.0
C#
3.5
JavaScript 3.3
Delphi/Pascal/Kylix
3.1
Python 2.6
COBOL 2.3
SAS
2.2
Fortran
1.9
Index is available at
62
comp.lang.python -- Outstanding!!
http://groups.google.com/groups
?&group=comp.lang.python
63
Not much!
Zope Corp.
Fourthought, Inc. - XML tools for Python and XML
and web-based applications.
64
Is Ease-of-Learning an
issue?
65
66
Online Materials?
Tools? - IDEs
IDLE comes
with
Python
WingIDE
excellent
IDE with
visual
debugger
$35 and $180 -- http://wingide.com/
68
Visual Python
Python plug-in for Visual Studio .NET.
Python-specific features within the familiar Visual Studio environment.
Visual Python integrates seamlessly with Visual Studio .NET, allowing
programmers to leverage features of Microsoft's popular development
tool suite.
http://www.activestate.com/Products/Visual_Python
69
A screenshot of wxDesigner
70
71
Bruce Eckel
His book Thinking in C++ was given
the Software Development Jolt Award
for best book published in 1995.
Thinking in Java received Java World Reader's Choice Award
and Java World Editor's Choice Award for best book, the
Java Developer's Journal Editor's Choice Award for books,
the Software Development Productivity Award in 1999, the
third edition received the Software Development Magazine
Jolt award for best technical book, 2002.
One of "the industry's leading lights" ( Windows Tech
Journal, September 1996).
72
73
Eric S. Raymond
Well-known Unix guru,
Linux advocate, and
author
The Cathedral and the Bazaar
www.catb.org/~esr/writings/cathedral-bazaar/cathedralbazaar/
The New Hacker's Dictionary
http://www.jargon.8hz.com/jargon_toc.html
Homesteading the Noosphere
http://www.firstmonday.dk/issues/issue3_10/raymond/
77
Why Python?
This could be an opportunity to get some
hands-on experience with Python...
I charged ahead and roughed out some
code ...
http://pythonology.org/success&story
=esr
78
Martin C. Brown
82
Nicholas Petreley
ComputerWorld columnist
83
85
XMLeverything's
processingjust fine here but then
86
Ease-of-learning is important
An application is written in four different
languages (Java, C, Perl, and Unix shellscript) because it was built by four
different developers who were expert in
four different languages.
Everybody knows this is a problem, but
nobody has time to learn another
language.
One solution -- a single common language
that is both powerful enough to handle a
wide variety of tasks, and easy enough to 87
The End
Questions? Comments?
89