Title: What is Scheme
1What is Scheme?
2Imagine
Taking a class about bicycling And never getting
on a bike! So we propose to you, to spend some
cycles learning about computer programming Will
you be ready for the Tour de France?
3The Inevitable...
If we propose to study CS, we need the
convenience of a symbolic language to express and
communicate our instructions. Hence, well use
a computer language to learn about processes and
procedures.
43. Which Computer Language?
5Flavors
A ABC ABEL ABCL ACCENT ACTOR ADA ADL AGORA AKL
ALEF ALEPH ALF ALGOL ALLOY AMBER AMIGA E AML AMPL
appall AVAIL AWK B BABEL BASIC BAWK BeBOP BEFUNGE
BETA BEGL BERTRAND BIGWIG BISTRO BLISS BLUE
BRIAN BRILLIANT BSL C C C C C (GNU CECIL
CHARITY CHEETAH CHiLL CILK CLAIRE CLARITY CLEAN
CLIPS CLOS CLU COBOL COLD FUSION COMAL COMMON
LISP COOL COMPONENT PASCAL CORAL COQ CORBA COSY
CWEB DAD DARK BASIC DELPHI DEMETER DIALECT
DRAGOON DYLAN DYNACE E ECLIPSE Eiffel EGG ELF
ELASTIC C ELLIE EMERALD ENIAC ERLANG ESCHER
EuLISP EUPHORIA FRANZ LISP FMPL FORMS/3 FORTH
FORTRAN G GEL GENTLE GNU E GDEL GREEN GUILE
HASKELL HOPE HPCODE HUGO ICI ICON INFER ISWIM J
JADE JAVA JAVA BEANS JAVASCRIPT JoCAML JOY JUICE
K KALEIDOSCOPE KEVO LAGOONA LAMINA LAURE LEDA
LENS LIANA LIFE LIMBO LINDA LIS LISP LML LOGO
LOOEE LOOKS LORE LPC LUA LUSTRE M4 MAGENTA MAGMA
MATCHMAKER MATLAB MCPL MELD MELD C MENTAT MERCURY
MEROON MIRANDA MISA ML MODULA 2 MODULA 3 MOPS
MOZART MUMPS NAPIER 88 NAWK NEON NESL NET REXX
NEWTON NIAL O2 OAKLISP OBERON OBJ OBJECTIVE C
OBJECTIVE CAML OBJECT OBLIQ OCCAM OCTAVE OLABL
OMEGA ONTIC OPAL ORCA OSCAR OSQL OZ PAL PARASOL
PARLOG PASCAL PERL PECOS PFL PHOCUS PHANTOM PHP
PICO PICT PIKE PILE PIRANHA PIRL PIZZA PL/B PL/I
PLANKALKUL PLAIN PLIANT POLKA POLYGOTH PRESTO
PROGRESS POOL POP POPTALK POSTSCRIPT POWERBUILDER
PROBE PROFAN PROGRAPH PROLOG PROMETHEUS PROTEUS
PY PYTHON Q QUEST R REBOL REFINE REGINA RELFUN
REXX RPG RUBY S SAS SATHER SCALLOP SCHEME
SCREAMER SCRIPT X SED SEL SELF SEQUENCE L SEPIA
SIMULA SINA SIRI SISAL SMALLTALK SMSL SNAML
SNOBOL SNOOPS SPANNER SQUEAK SQL SR SUNEIDO T3X
Tcl/TK TECO TELESCRIPT TELOS TEMPO THETA TOM TOP
TRAITS TRELLIS TURBO PASCAL TURING TYCOON UFO
UNLAMBDA V VIRT VISUAL BASIC VISUAL BASICSCRIPT
VISUAL C WINDUCTOR WINTERP WOOL XLISP XML YAFL
YERK YORICK Z ZPL ZUSE XSCHEME
Assembler, C, C, Fortran, Java, Scheme, Lisp
6?
Whats the purpose of a computer language?
7Asked Another Way
Why are there so many computer languages? (Why
not create one computer language?) For whom does
one write programs in a language? (Why not write
them in 1s and 0s?)
?
8Typically
- Different types of problems lead to different
approaches with computer languages - Scientific computation - Fortran
- List processing - Lisp
- Business programming - Cobol
- Systems programming - C
- CS Education - Pascal
- Internet program distribution - Java
9Computer Languages
Computer languages have two related
purposes efficiently provide instructions to
machines that execute programs and
procedures provide a clear written record of
the theory or idea expressed in the
procedure
1.
Computer consumption
2.
Human consumption
10Computer Languages
We could program in 1s and 0s (machine language),
but will instead employ a high-level language.
Were using a language called Scheme, plus
introducing some basic software tools (Matlab,
Excel, HTML, etc.) But note that -- we are
not restricted to the language -- ideas
expressed in the language can be
expressed in any other language
11Note!
This is not a class in Scheme programming This
is a class about computation and problem
solving In fact, Scheme was chosen precisely
because it doesn't get in the way of the course
objectives
Scheme is "incidental but essential" to the
course subject. Were more concerned about
programming.
12Why Scheme?
13Scheme?
The choice of Scheme for beginners is
natural. Permits programmers to focus on two key
elements of programming Programs as relations
between quantities Evaluating programs for
specific inputs. Using just this core language,
students can develop complete programs during the
first session with a teacher.
14Scheme?
The choice of Scheme for beginners is
natural. Easily arranged as a tower of language
levels. As you learn more about programming and
the language, we can expose you to richer layers
of the language, which allows you to write more
interesting and more concise programs.
15Scheme?
The choice of Scheme for beginners is
natural. The DrScheme programming environment
offers a truly interactive evaluator.
Definitions window where we define
programs Interactions window which acts like a
pocket calculator. We can enter expressions into
the latter, and DrScheme determines their values.
In other words, computation starts with
pocket-calculator arithmetic, which you know
quite well, and quickly proceeds from there to
calculations with structures, lists, and
trees--the kinds of data that computer programs
really manipulate.
16Scheme?
The choice of Scheme for beginners is
natural. Use of an interactive evaluator with a
rich data language permits us to focus on problem
solving and program design activities. An
interactive mode of evaluation encourages you to
experiment in all kinds of ways and thus
stimulates your curiosity.
17Scheme?
The choice of Scheme for beginners is
natural. The nature of Scheme requires
programmers to use good abstraction to solve a
problem. Many computer scientists consider
learning a functional language like Scheme to be
an essential part of learning the process of
abstraction.
18But we wanted to use a cool real-world language!!!
19Scheme child of Lisp
Real-world use -- NASAs 1999 Software of the
Year was a Lisp program controlling the Deep
Space 1 spacecraft. -- Powers parts of Yahoos
backend -- CAD software engines used Lisp --
Its used by professionally trained software
engineers
20Why Use Scheme?
Core Material at other Universities Berkeley
Brown CMU Indiana MIT Rice
Utah Yale
21Why Use Scheme?
Speed -- Rapid prototyping -- Development
time (more expensive than
execution time) is faster
22Why Use Scheme?
Speed (contd) -- Scheme execution time
compares well to many other fast
languages We have repeated Prechelt's study
using Lisp as the implementation language. Our
results show that Lisp's performance is
comparable to or better than C in terms of
execution speed, with significantly lower
variability which translates into reduced project
risk. Furthermore, development time is
significantly lower and less variable than either
C or Java. NASA study of Lisp www-aig.jpl.n
asa.gov/public/home/gat/lisp-study.html
23Why Use Scheme?
Cost Free!
Money allocated for an expensive C
compiler for your son or daughter may now be
spent on golf clubs or living room furniture
24On to Scheme
)
25On to Scheme
)))))))
26On to Scheme
))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))) )))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))) ))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))) )))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))) ))))))
))))))))))))))))))))))))))))))))))))))))))))))))))
)))) )))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))) ))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))) )))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))) ))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))) )
))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))) ))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))) )))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))) ))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))) )))))))
))))))))))))))))))))))))))))))))))))))))))))))))))
)))
27Installing Dr. Scheme
http//www.htdp.org
28In cs1321, you will use the DrScheme program as
your editor and development environment
29Definitions Window
Interactions Window
30Execute buttons loads the Definitions into
the Interactions window
31Saving your work
32Important
Be sure to set the language level in Dr. Scheme
to Beginning Scheme, then click on "Execute
33So
- Scheme can execute a single line of code as soon
as it is typed into the interactions window - ( 2 2)
- 4
34(No Transcript)
35Questions?
36Today's Assignment
- Install Scheme
- In the definitions window,
- Put your name and gtnum preceded by
- solve
- 3 X ( 3 4 ) X 18 4
- 7
-
- Execute
- Step through the evaluation
- Print it out
- Bring to class Thursday
37Questions?
38(No Transcript)