1 / 32

Ada, Scheme, R

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.

ace
Download Presentation

Ada, Scheme, R

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ada, Scheme, R • Emory Wingard

  2. Ada

  3. 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)

  4. 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

  5. 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.

  6. Versions • Original: Ada 83 • Ada 95 • Ada 2005 • Current version: Ada 2012

  7. Usage • Embedded systems • Modern principles of software engineering • Large software systems

  8. 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

  9. Subprograms • Used to express algorithms • Two kinds: procedures and functions • Procedure is a way to bring up actions • Functions provide computation of a value.

  10. 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

  11. 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.

  12. Types • Integer • Character • Boolean • Float • String • *Considered to be strongly typed*

  13. Readability? • Writability? • Cost?

  14. R • Functional, Statistical Computing, Graphics, Data Analysis

  15. History • Implementation of the S programming language • Created by Ross Ihaka and Robert Gentleman

  16. Advantages • Open sourced • Available across multiple platforms • Ease of design of graphics • Data analysis

  17. 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

  18. 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

  19. expression/assignment examples

  20. Objects • Numeric vectors, character vectors, lists, functions • Actually everything in R are objects • example

  21. Constants • Building blocks for data objects • Numbers, character values, and symbols • examples.

  22. Precedence rules • function calls and grouping expressions • Index and lookup operators • Arithmetic • Comparison • Formulas • Assignment • Help

  23. Control Structures • Conditional Statements • if (condition) true_expression else false_expression

  24. Scheme

  25. Overview • Developed in the 70s at MIT • An extension of LISP • Uses: optimizing compilers, financial analysis packages, operating systems, and writing text editiors

  26. The Interpreter • Interactive • Infinite read-evaluate-print loop • Very small, increased reliability

  27. Programs • Collection of functional definitions • DEFINE • binds names to a value • binds names to lambda expressions • prototypes • expression

  28. Programs cont. • Block structured • keywords and variables are lexically scoped • This makes the programs modular • Increases readability and reliability • Maintenance is easier

  29. Programs cont. • Scope of binding determined before evaluation of program by compiler • Makes the code more efficient

  30. Arithmetic • Scheme uses prefix notation • This simplifies precedence and associativity of operators • example

  31. 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

  32. Advantages • Portable • Used to teach programming in high schools • Very small and simplistic

More Related