Download Evaluating Languages Evaluating Languages

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Announcements
Evaluating Languages
• Join the course moodle and introduce
yourself. Be sure to upload a picture of
yourself to your profile!
• Textbook available in CU Bookstore
(thanks Dain)
• Assignment 1 out tonight, due Thu Sep 3
at 11:55pm
Prof. Evan Chang
Meeting 2, CSCI 3155, Fall 2009
– Find a partner, Post on general forum
2
Feedback
Perils of JavaSchools
• Many wanted to get a better “feeling”
for different languages (for various
applications)
• Comments?
– stay tuned
3
4
Perils of JavaSchools
• Comments?
Evaluating Languages
5
1
Take-Home Message
Why so many languages?
• Languages are adopted to fill a void and
may have little to do with “quality”
• No universally accepted metrics for
good design
• There are some criteria and
characteristics that help us evaluate
languages
• Table 1.1 (in Sebesta) provides a
starting point
7
8
Opinion on Language Design
So many languages
• Languages are adopted to fill a void
• Examples:
– Enable a previously difficult/impossible application
– Orthogonal to language design quality (almost)
• Training is the dominant adoption cost
– Languages with many users are replaced rarely
– But easy to start in a new niche.
–
–
–
–
–
–
–
–
AI: symbolic computation (
)
Scientific Computing: high performance (
)
Business: report generation (
)
Systems Programming: low-level access (C)
Scripting (
)
Distributed Systems: mobile computation (Java)
Web (
)
Special purpose languages: …
9
10
So many languages
Language Paradigms
• Examples:
• Imperative
–
–
–
–
–
–
–
–
– Fortran, Algol, Cobol, C, Pascal
AI: symbolic computation (Lisp, Prolog)
Scientific Computing: high performance (Fortran)
Business: report generation (COBOL)
Systems Programming: low-level access (C)
Scripting (Perl, Python, TCL)
Distributed Systems: mobile computation (Java)
Web (PHP)
Special purpose languages: …
• Functional
– Lisp, Scheme, ML, Haskell
• Object oriented
– Smalltalk, Eiffel, Self, C++, Java, C#, Javascript
• Logic
– Prolog
• Concurrent
– CSP, dialects of the above languages
• Special purpose
– TEX, Postscript, TrueType, sh, HTML, make
11
12
2
What makes a good language?
What are criteria for evaluating langs?
• No universally accepted metrics for
design
• “A good language is one people use” ?
13
What are criteria for evaluating langs?
14
Designing good languages is hard
• Goals almost always conflict.
• Examples:
– Safety checks cost something in either
compilation or execution time.
– Type systems restrict programming style in
exchange for strong guarantees.
15
16
What are some characteristics of
languages?
Story: Java Bytecode Subroutines
• Java bytecode programs contain subroutines
(jsr) that run in the caller’s stack frame (why?)
• jsr complicates the formal semantics of
bytecodes
– Several verifier bugs were in code implementing jsr
– 30% of typing rules, 50% of soundness proof due to jsr
• It is not worth it:
– In 650K lines of Java code, 230 subroutines, saving
2427 bytes, or 0.02%
– 13 times more space could be saved by renaming the
language back to Oak
17
• Sebesta, Table 1.1
–
–
–
–
–
–
–
–
–
Simplicity
Orthogonality
Data types and structures
Syntax considerations
Support for abstraction
Expressivity
Type checking
Exceptions
Restricted aliasing
18
3
Simplicity
Orthogonality
19
Data types and structures
20
Syntax considerations
21
Support for abstraction
22
Expressivity
23
24
4
Type checking
Exception handling
25
26
Restricted aliasing
For Next Time
• What is aliasing?
• Reading
• Online discussion forum
• Start homework assignment 1
27
28
5