1 / 15

Taxonomy of Programming Languages

This document provides an overview of programming languages, including their syntax, data types, and generations. It also covers imperative and declarative programming languages, domain-specific languages, and parallel languages.

darlened
Télécharger la présentation

Taxonomy of Programming Languages

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. Taxonomy of Programming Languages CSCI 432 Computer Science Theory

  2. Misc Notes • We have been studying languages all semester. • Languages defined by Finite Automata • Regular Languages • etc

  3. Importance of Types The syntax of a language is governed by the constraints that define its data types. For example: • everything in Java is a class • most scripting languages use weak type checking

  4. High Level v. Low Level Low Level Language: • eg, Assembly • every instruction is done by a piece of hardware • faster than compiled or interpreted High Level Language High Level Language: • easier to code, manage, test, etc.

  5. Compiled v. Interpreted Advantages of Compiled • the machine code in the .exe file runs fast • compiler probably optimizes your code Advantages of Interpreted • portable

  6. Imperative Programming Languages English definition of "Imperative" - essential, authoritative command statements that change the machine's state • this is the majority of programming languages • some imperative languages have declarative properties • two subtypes • procedural • object-oriented

  7. Components of Imperative Langs • Sequence • how to control program flow from one statement to the next • eg blocks of code, procedures, functions, recursion • Selection • making decisions • eg ifstatements and case statements • Iteration • repeating instructions • eg for loops and while loops

  8. Declarative Programming Languages specify what is to be done, not how to do it • does not specify control flow or order of operations • examples • HTML • SQL

  9. Generations • 2nd Generation Languages (2GL) • Assembly • 3rd Generation Languages (3GL) • Higher level than 2GL, like C and C++ • some 3GLs, like Python, have libraries of routines that give them 4GL characteristics

  10. Generations • 4th Generation Language (4GL) • Operating on large collections of data • for example: SQL, report writers • 5th Generation Language (5GL) • Problem solving based on constraints instead of algorithms • Artificial Intelligence programming • area of research for past 20 years, without significant progress • given a set of constraints, finding an algorithm to solve the problem is usually very difficult, thus usually requires a programmer (3GL or 4GL)

  11. Domain Specific Languages as opposed to a General Purpose Language Examples: • HTML • statistical modeling languages • OpenGL shading language • software engineering - eg requirements specifications • shells - ls, ps, grep, sort, head, wc, …

  12. Parallel Languages non-parallel a[]=b[]+c[] : for (i=0; i<size; i++) a[i] = b[i] + c[i]; Compiler and OS: forall(i=0; i<size; i++) a[i] = b[i] + c[i]; Programmer: function add (start, stop) { for (i=start; i<stop; i++) a[i] = b[i] + c[i]; } for (processor=0;processor<8;processor++) clone (processor, add(processor*size/8,(processor+1)*size/8));

  13. FORTRAN and COBOL Example FORTRAN Code PROGRAM DEMO PRINT *, 'Enter number?' READ *, X IF (X.LE.0) THEN PRINT *, 'That is negative.' STOP END IF PRINT *, 'That is positive.' STOP END

  14. LISP • List Processing • Everything is a list • ((Jimmy Carter), (Ronald Reagan), (George Bush), …….) • >(defunfactorial (N) • (if (= N 1) • 1 • (* N (factorial (- N 1))))) • >(eval factorial(5)) • (120)

  15. CLIPS • known facts and rules that work on facts • logic programming language (assert (person (name Steve Dannelly) (occupation Professor) (home Rock Hill))) (facts) (defrulefire-emergency (emergency (type fire)) => (assert (response (action sprinkler-on))) )

More Related