ada, scheme, r
DESCRIPTION
Ada, Scheme, R. Emory Wingard. Ada. History. Department of Defense in search of high level language around 1975. Requirements drafted for the language. Competition between vendors to produce language narrowed down to four. Cii-Honeywell/Bull's language design won.(1979). History cont. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/1.jpg)
Ada, Scheme, REmory Wingard
![Page 2: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/2.jpg)
Ada
![Page 3: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/3.jpg)
History• Department of Defense in search of high
level language around 1975.
• Requirements drafted for the language.
• Competition between vendors to produce language narrowed down to four.
• Cii-Honeywell/Bull's language design won.(1979)
![Page 4: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/4.jpg)
History cont.
• Large requirements called for a large language.
• Was not released to the public during testing.
• Dr. Jean Ichbiah headed the French team
• Based on Pascal
![Page 5: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/5.jpg)
The Compiler
• Compilers for Ada were not developed until four years after the language was completed.
• Compilers are trademarked.
• Slow compile-time and run-time performance in the beginning.
![Page 6: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/6.jpg)
Versions
• Original: Ada 83
• Ada 95
• Ada 2005
• Current version: Ada 2012
![Page 7: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/7.jpg)
Usage
• Embedded systems
• Modern principles of software engineering
• Large software systems
![Page 8: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/8.jpg)
Structure of programs
• Programs composed of program units
• Program units have subprograms, packages, task units, protected units, and generic units.
• Units consist of two parts: specifications and the body
• Most can be compiled separately
![Page 9: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/9.jpg)
Subprograms
• Used to express algorithms
• Two kinds: procedures and functions
• Procedure is a way to bring up actions
• Functions provide computation of a value.
![Page 10: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/10.jpg)
Packages• Considered the highlight of Ada
• Program units that encapsulate a group of related declarations and control visibility.
• Supports definition of interfaces and implementations
• Information hiding and abstract data types
• Structure for larger systems
![Page 11: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/11.jpg)
Exception Handling
• Based on PL/I and CLU
• Handled locally in the code so reference environment is the same.
• Inadequate for task.
• No extension to Ada 95 for exception handling.
![Page 12: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/12.jpg)
Types
• Integer
• Character
• Boolean
• Float
• String
*Considered to be strongly typed*
![Page 13: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/13.jpg)
• Readability?
• Writability?
• Cost?
![Page 14: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/14.jpg)
RFunctional, Statistical Computing, Graphics, Data
Analysis
![Page 15: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/15.jpg)
History
• Implementation of the S programming language
• Created by Ross Ihaka and Robert Gentleman
![Page 16: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/16.jpg)
Advantages
• Open sourced
• Available across multiple platforms
• Ease of design of graphics
• Data analysis
![Page 17: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/17.jpg)
Packages• Stores data sets and functions.
• Similar to classes in Java
• Functions in packages are related
• Large number of packages for many different purposes
• Only a handful loaded by default
![Page 18: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/18.jpg)
Commands• Two forms: expressions assignments
• Expression are printed immediately, values are not stored
• Assignments pass values to variables, these results are not printed
• Commands can be grouped by braces
• Separation of commands done by semi-colons
![Page 19: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/19.jpg)
expression/assignment examples
![Page 20: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/20.jpg)
Objects
• Numeric vectors, character vectors, lists, functions
• Actually everything in R are objects
• example
![Page 21: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/21.jpg)
Constants
• Building blocks for data objects
• Numbers, character values, and symbols
• examples.
![Page 22: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/22.jpg)
Precedence rules• function calls and grouping expressions
• Index and lookup operators
• Arithmetic
• Comparison
• Formulas
• Assignment
• Help
![Page 23: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/23.jpg)
Control Structures
• Conditional Statements
if (condition) true_expression else false_expression
![Page 24: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/24.jpg)
Scheme
![Page 25: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/25.jpg)
Overview
• Developed in the 70s at MIT
• An extension of LISP
• Uses: optimizing compilers, financial analysis packages, operating systems, and writing text editiors
![Page 26: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/26.jpg)
The Interpreter
• Interactive
• Infinite read-evaluate-print loop
• Very small, increased reliability
![Page 27: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/27.jpg)
Programs• Collection of functional definitions
• DEFINE
• binds names to a value
• binds names to lambda expressions
• prototypes
• expression
![Page 28: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/28.jpg)
Programs cont.• Block structured
• keywords and variables are lexically scoped
• This makes the programs modular
• Increases readability and reliability
• Maintenance is easier
![Page 29: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/29.jpg)
Programs cont.
• Scope of binding determined before evaluation of program by compiler
• Makes the code more efficient
![Page 30: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/30.jpg)
Arithmetic
• Scheme uses prefix notation
• This simplifies precedence and associativity of operators
• example
![Page 31: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/31.jpg)
Data Structures• Scheme uses lists rather than arrays
• Shown as sequences of objects surrounded by parenthesis.
• quote is used to tell the program that the list is to be treated as data and not a procedure
• List manipulation:
• car- returns the first element in a list
• cdr- returns the rest of the list
• cons- used to construct list
![Page 32: Ada, Scheme, R](https://reader034.vdocuments.net/reader034/viewer/2022051401/56814577550346895db2487c/html5/thumbnails/32.jpg)
Advantages
• Portable
• Used to teach programming in high schools
• Very small and simplistic