SlideShare ist ein Scribd-Unternehmen logo
1 von 36
The ALGOL Family

CSE341
Programming Languages
Overview
   Historical perspective
   ALGOL Goals
   BNF (Backus-Naur Form)
   ALGOL 58
   ALGOL 60
   ALGOL 68
   Success and Failure of ALGOL
   Conclusion
History
   ALGOrithmic Language
   Developed in Europe by an international group,
    consisting of 7 different countries, in the late 1950’s
   Very similar to FORTRAN
   Peter Naur and J.W. Backus worked on the project.
    Was the debut of the BNF syntax.
   Designed specifically for programming scientific
    computations
History (Continued)
   Never became as commercially popular as FORTRAN
    or COBOL
       Was not compatible with IBM

   Is considered the most important programming language
    in terms of influence on later language development
   Many similar languages can (and are) referred to as
    “ALGOL-like”
       JAVA, C, C++, Pascal, Ada, FORTRAN, etc.
ALGOL Goals
   To be as close as possible to standard math notation
      Also very readable without much more explanation


   Should be possible to use it to describe algorithms in publications
      A form of it is still used today


   Should be mechanically translatable into machine language
    programs
BNF (Backus-Naur Form)
   Was first to use BNF (Backus-Naur Form)
      Same Backus that created Fortran
          He also was one of the main creators of Algol
          And he created functional programming
          And won the Turing award in ’77
      Right. Back to BNF
      BNF example:
          <value> := <number> | <variable> | <expression>
          <number> := <integer> | <float>
          <integer> := <integer><digit> | <digit>
          <digit> := 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
   Language was designed by committee
   Report is a “paradigm of brevity and clarity”
      Most languages today require 1000’s of pages
      Brevity and clarity contributed to reputation as simple, elegant language
Three Language Versions
   Reference language
      Used by the committee, described in the report, and used in
       official Algol publications
   Publication language
      Allowed for differences in the character set for different
       languages
      Europeans and Americans couldn’t decide on which character to
       use for the decimal point!
   Hardware representations
      Condensed languages for machine input
ALGOL 58
The beginning
   June 1957 – ACM requested a committee to
    look into a universal programming language
   European and American groups got together in
    Zurich.
     No  current language covers everything
     Creating more non-ideal languages doesn’t help the
      situation
     Each passing month more people start using other
      languages
     How can the logical structure of existing languages be
      adjusted
ALGOL 58
New Features
   Types
     Integer
     Real
     Boolean
   Formal vs Actual parameters
   Declaration
   for statements
   Switch
   Compound statements
   Begin end delimiters
   Three level language description
   Call by name
ALGOL 58
Function vs Procedure
   Nature of the body
      Expression
      Compound statement
   Parameter evaluation mechanism
      Value of any actual parameter
      Text of any actual parameter
   Identifier collision
      Non-parameter identifiers are global to the definition
      Communication only through parameters
   Place of use
      An operand in an expression
      A statement or an operand in an expression
Call by name vs. by value
   Call by name is default
   Call by name: re-evaluate the actual parameter on every
    use
      For actual parameters that are simple variables, it’s
       the same as call by reference
      For actual parameters that are expressions, the
       expression is re-evaluated on each access
   No other language ever used call by name…
Call by name
begin
  integer n;
  procedure p (k: integer)   parameter is n+10 (not just 10)
     begin
       print (k);            prints n+10, which is 10
       n := n+1;             n is still 0; thus, n becomes 1
       print (k);            prints n+10, which is 11
     end;
                             n is set to 0
  n := 0;                    parameter is n+10 (not just 10)
  p (n+10);
end;
Example
   Computing Illustrate ( Compute The Mean ):
    // the main program (this is a comment)
    begin
            integer N;
            Read Int(N);

          begin
                     real array Data[1:N];
                     real sum, avg;
                     integer i; sum:=0;
                     for i:=1 step 1 until N do
                                 begin real val;
                                 Read Real(val);
                                 Data[i]:=if val<0 then -val else val
                     end;

                     for i:=1 step 1 until N do
                                 sum:=sum + Data[i];
                     avg:=sum/N;
                     Print Real(avg)
          end
    end
Example(Continued)
   I/O Illustrate: because ALGOL had no IO facilities. The following
    code could run on an ALGOL implementation for a Burroughs A-
    Series mainframe.

    BEGIN
    FILE F (KIND=REMOTE);
    EBCDIC ARRAY E [0:11];
    REPLACE E BY "HELLO WORLD!";
    WHILE TRUE DO
         BEGIN
         WRITE (F, *, E);
         END;
    END.
Problems with Algol58

   Didn’t include a I/O library
     Thus, each implementation had a different
      means for I/O
     This caused compatibility problems
     And no standard way to write a Hello World
      program
ALGOL 60
   Basic Language of 1960
     Simple imperative language + functions
     Successful syntax, BNF -- used by many successors
           statement oriented
           begin … end blocks (like C { … } )
           if … then … else
    Recursive functions and stack storage allocation
    Type discipline was improved by later languages
    Very influential but not widely used in US
 Tony Hoare: “Here is a language so far ahead of its time
  that it was not only an improvement on its predecessors but
  also on nearly all of its successors.”
ALGOL 60
Proposed Changes
   The empty statement was adopted
   Modifications to operation hierarchy
      Unary operators having higher precedence than binary operators was adopted
      Implied multiplication was rejected
      Relation sequences were rejected
   The else clause was adopted
   Strings, lists, trees, matrices, and complex numbers were rejected as types
   Multiple assignment statements were adopted
        Created a new problem, A[i] := i := e
   Recursion became possible in obvious ways
   Constants were rejected
ALGOL 60
What’s New
   Block
   Call by value/name
   Typed procedures
   Declaration scope
   Dynamic arrays
   Side effects
   Global and local variables
   Step, until, while, if then else
   Activation records
   Recursive decent parsers
   No I/O
Algol 60 Sample

real procedure average(A,n);
  real array A; integer n;                       no array bounds
  begin
       real sum; sum := 0;
       for i = 1 step 1 until n do
               sum := sum + A[i];
       average := sum/n                           no ; here
  end;
                    set procedure return value by assignment
Algol Oddity
   Question:
      Is x := x equivalent to doing nothing?
   Interesting answer in Algol
       integer procedure p;
       begin
                ….
                p := p
              ….
         end;
      Assignment here is actually a recursive call
Problems with Algol60
   Holes in type discipline
      Parameter types can be arrays, but
          No array bounds

      Parameter types can be procedures, but
          No argument or return types for procedure parameters

   Problems with parameter passing mechanisms
      Pass-by-name “Copy rule” duplicates code,         interacting
       badly with side effects
      Pass-by-value expensive for arrays
   Some awkward control issues
      goto out of block requires memory management
ALGOL 68
   Considered difficult to understand
       Idiosyncratic terminology
            Types were called “modes”
            Arrays were called “multiple values”
       Used vW grammars instead of BNF
            Context-sensitive grammar invented by van Wijngaarden
     Elaborate type system
     Complicated type conversions

   Fixed some problems of Algol 60
       Eliminated pass-by-name
   Not widely adopted
ALGOL 68
What’s New modes
Many new types, called
        Primatives
             Bits
             Bytes
             String
             Sema (a semaphore)
             Complex
             File
             Pipe
             Channel
             format
        Additional
             Flex (Flexible array)
             Heap (space on the heap)
             Loc (local space on the stack)
             Ref (pointer)
             Long (bigger ints/reals)
             Short (smaller ints/reals)

   Declaration of custom types/modes
Algol 68 Modes
Primitive modes      Compound
   Modes
 int                --arrays
 Real               --structures
 Char               --procedures
 bool               --sets
 string              --pointers
 Compl(complex)
 bits
 bytes
                      Rich, structured, and orthogonal
                      type system is a major contribution
 Sema (semaphore)
                      of Algol 68.
 Format (I/O)
 file
Other Features of Algol 68
   Storage management
      Local storage on stack
      Heap storage and garbage collection
   Parameter passing
      Pass-by-value
      Use pointer types to obtain pass-by-reference
   Assignable procedure variables
Structure
   ALGOL68 is block structured w/ static scope rules
   ALGOL68's model of computation:
       static
       stack: block/procedure AR's; local data objects
       heap: “heap” -- dynamic-- data objects
   ALGOL68 is an expression-oriented language
Basic Syntax
   Addition : “ + ”
   Subtraction : “ - ”
   Multiplication : “ * ”
   Division : “ / ”
   Exponentiation : “ ** ”
   Assignment : “ := ”
   Boolean Expressions
      = , > , < , <= , >= , /=
Recursion
   Algol 68 Supports recursion
    Example:
        real procedure factorial (n);
        begin
           if n = 1 then
                 factorial := 1;
                    else
               factorial := n* factorial(n-1);
        end;
Arrays
   Three types of arrays: real, integer, Boolean
   Each array must contain all the same types
   All arrays are of type real unless specified
   Can have multidimensional arrays
   Declarations:

     array name1[1:100];             (1D array of type real)
     real array name2(-3:6,20:40);   (2D array of type real)
     integer array name3,name4(1:46);(2 1D arrays of type integer)
     Boolean array name5(-10:n);     (1D array of type Boolean)
                                      (Allocated Dynamically)
Block Structure
   First language to implement a block structure
   Similar in form to pascal
    begin
      …..
    end;
   Each block can have its own variables, visible only to
    that block (local variables). After the block is exited the
    values of all the local variables are lost.
Block Structure example
   Example:
    begin
      own integer i; integer j,k;
      i := j + k;
    end;
        The integer i will have the value of j+k stored the next time
         the block is entered
   By using the “own” statement the variable will retain its
    value for the next time the block is entered
Parameter Passing
   Two types of parameter passing: by Value, by Name

   Pass by Value works the same as in most other languages

   Pass by Name is similar to pass by reference, but it adds flexibility

       All parameters are pass by name unless otherwise specified
      Example: can make a call “sum(i,2,5,x+6)” to the procedure sum
        procedure sum(i,j,k,l); value i,j,k;
        begin
           i := i + j + k + l
        end;
     (will execute as i := i + 2 + 5 + (x+6))
ALGOL
Successes and Failures
   Programming computers – Partial Success
       Core language is strong, no I/O is a serious shortcoming
   Publication of algorithms – Very Successful
   Stimulus to compiler design – Success with a seed of
    corruption
       It only stimulated compiler design because it was difficult
   Stimulated formal language research – Success
       Not the goal of the ALGOL effort
   Description of ALGOL 60 – Failure
     Difficult to understand for the uninitiated reader
     Needs an informal explanation
Conclusion
   General purpose algorithmic language with a clean
    consistent and unambiguous syntax.
   Comprehensive fully-checked type-system covering
    structures, unions, pointers, arrays and procedures.
   Procedures may be nested inside procedures and can
    deliver values of any type without you having to worry
    about where the storage is coming from.
   User-defined operators including user-defined operator
    symbols.
   Powerful control structures can deliver values of any
    type.
Conclusion (Continued)
   Dynamic sized arrays know their current bounds.
   Array and structure displays can be used in any context.
   Parallel programming with semaphores.
   Complex arithmetic.
   Declarations can be interleaved with statements.
   Clear distinction between value semantics and reference
    semantics.
   No distinction between compile-time constants and run-
    time values.
References
   Lindsey, C.H., “A History of ALGOL 68.” History of Programming
    Languages, ACM Press. 1993. 97-132
   Naur, Peter, “Successes and failures of the ALGOL effort”, ALGOL
    Bulletin #28, Computer History Museum. 1986. 58-62
   Thomson, C.M., “Algol 68 as a Living Language”, ALGOL Bulletin
    #47, Computer History Museum. 1981. 21-24
   Perlis, Alan, “The American side of the development of Algol”, The
    first ACM SIGPLAN conference on History of programming
    languages, ACM Press. 1978. 3-14
   Naur, Peter. “The European side of the last phase of the
    development of ALGOL 60”, The first ACM SIGPLAN conference on
    History of programming languages, ACM Press. 1978. 15-44

Weitere ähnliche Inhalte

Was ist angesagt?

2_2Specification of Tokens.ppt
2_2Specification of Tokens.ppt2_2Specification of Tokens.ppt
2_2Specification of Tokens.pptRatnakar Mikkili
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of AutomataFarooq Mian
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free GrammarAkhil Kaushik
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Animesh Chaturvedi
 
Functions in python slide share
Functions in python slide shareFunctions in python slide share
Functions in python slide shareDevashish Kumar
 
Regular Languages
Regular LanguagesRegular Languages
Regular Languagesparmeet834
 
Automata theory - CFG and normal forms
Automata theory - CFG and normal formsAutomata theory - CFG and normal forms
Automata theory - CFG and normal formsAkila Krishnamoorthy
 
What is Python Lambda Function? Python Tutorial | Edureka
What is Python Lambda Function? Python Tutorial | EdurekaWhat is Python Lambda Function? Python Tutorial | Edureka
What is Python Lambda Function? Python Tutorial | EdurekaEdureka!
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)Naman Joshi
 
context free language
context free languagecontext free language
context free languagekhush_boo31
 

Was ist angesagt? (20)

Python final ppt
Python final pptPython final ppt
Python final ppt
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
 
Python basics
Python basicsPython basics
Python basics
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
2_2Specification of Tokens.ppt
2_2Specification of Tokens.ppt2_2Specification of Tokens.ppt
2_2Specification of Tokens.ppt
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free Grammar
 
Flat unit 3
Flat unit 3Flat unit 3
Flat unit 3
 
Python Flow Control
Python Flow ControlPython Flow Control
Python Flow Control
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
 
LISP: Introduction to lisp
LISP: Introduction to lispLISP: Introduction to lisp
LISP: Introduction to lisp
 
Functions in python slide share
Functions in python slide shareFunctions in python slide share
Functions in python slide share
 
Regular Languages
Regular LanguagesRegular Languages
Regular Languages
 
Automata theory - CFG and normal forms
Automata theory - CFG and normal formsAutomata theory - CFG and normal forms
Automata theory - CFG and normal forms
 
What is Python Lambda Function? Python Tutorial | Edureka
What is Python Lambda Function? Python Tutorial | EdurekaWhat is Python Lambda Function? Python Tutorial | Edureka
What is Python Lambda Function? Python Tutorial | Edureka
 
LR Parsing
LR ParsingLR Parsing
LR Parsing
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)
 
context free language
context free languagecontext free language
context free language
 
Python Flow Control
Python Flow ControlPython Flow Control
Python Flow Control
 

Ähnlich wie ALGOL ailesi programlama dilleri

Evaluation and analysis of ALGOL, PASCAL and ADA
Evaluation and analysis of ALGOL, PASCAL and ADAEvaluation and analysis of ALGOL, PASCAL and ADA
Evaluation and analysis of ALGOL, PASCAL and ADADilanka Dias
 
Maclennan chap5-pascal
Maclennan chap5-pascalMaclennan chap5-pascal
Maclennan chap5-pascalSerghei Urban
 
presentation_intro_to_python
presentation_intro_to_pythonpresentation_intro_to_python
presentation_intro_to_pythongunanandJha2
 
presentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.pptpresentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.pptMohitChaudhary637683
 
ParaSail
ParaSail  ParaSail
ParaSail AdaCore
 
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdfsamiwaris2
 
Programing paradigm &amp; implementation
Programing paradigm &amp; implementationPrograming paradigm &amp; implementation
Programing paradigm &amp; implementationBilal Maqbool ツ
 
Erlang Message Passing Concurrency, For The Win
Erlang  Message  Passing  Concurrency,  For  The  WinErlang  Message  Passing  Concurrency,  For  The  Win
Erlang Message Passing Concurrency, For The Winl xf
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Rasan Samarasinghe
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golangBasil N G
 

Ähnlich wie ALGOL ailesi programlama dilleri (20)

Evaluation and analysis of ALGOL, PASCAL and ADA
Evaluation and analysis of ALGOL, PASCAL and ADAEvaluation and analysis of ALGOL, PASCAL and ADA
Evaluation and analysis of ALGOL, PASCAL and ADA
 
Maclennan chap5-pascal
Maclennan chap5-pascalMaclennan chap5-pascal
Maclennan chap5-pascal
 
Unit -1 CAP.pptx
Unit -1 CAP.pptxUnit -1 CAP.pptx
Unit -1 CAP.pptx
 
presentation_intro_to_python
presentation_intro_to_pythonpresentation_intro_to_python
presentation_intro_to_python
 
presentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.pptpresentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.ppt
 
ParaSail
ParaSail  ParaSail
ParaSail
 
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
 
3.5
3.53.5
3.5
 
Theperlreview
TheperlreviewTheperlreview
Theperlreview
 
PARADIGM IT.pptx
PARADIGM IT.pptxPARADIGM IT.pptx
PARADIGM IT.pptx
 
Introduction to F#
Introduction to F#Introduction to F#
Introduction to F#
 
F# 101
F# 101F# 101
F# 101
 
Erlang, an overview
Erlang, an overviewErlang, an overview
Erlang, an overview
 
Pascal programming language
Pascal programming languagePascal programming language
Pascal programming language
 
Programing paradigm &amp; implementation
Programing paradigm &amp; implementationPrograming paradigm &amp; implementation
Programing paradigm &amp; implementation
 
Erlang Message Passing Concurrency, For The Win
Erlang  Message  Passing  Concurrency,  For  The  WinErlang  Message  Passing  Concurrency,  For  The  Win
Erlang Message Passing Concurrency, For The Win
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++
 
python and perl
python and perlpython and perl
python and perl
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golang
 

Mehr von Cumhuriyet Üniversitesi (8)

Gereksinim Analizi Dokümanı Hazırlama
Gereksinim Analizi Dokümanı HazırlamaGereksinim Analizi Dokümanı Hazırlama
Gereksinim Analizi Dokümanı Hazırlama
 
Pascal
Pascal Pascal
Pascal
 
Phyton Programlama Dili
Phyton Programlama DiliPhyton Programlama Dili
Phyton Programlama Dili
 
Prolog
PrologProlog
Prolog
 
Teknik Rapor Nasıl Yazılır?
Teknik Rapor Nasıl Yazılır?Teknik Rapor Nasıl Yazılır?
Teknik Rapor Nasıl Yazılır?
 
Veri madenciliği ve ids
Veri madenciliği ve idsVeri madenciliği ve ids
Veri madenciliği ve ids
 
Veritabanları
VeritabanlarıVeritabanları
Veritabanları
 
Delphi 7
Delphi 7Delphi 7
Delphi 7
 

Kürzlich hochgeladen

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 

Kürzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

ALGOL ailesi programlama dilleri

  • 2. Overview  Historical perspective  ALGOL Goals  BNF (Backus-Naur Form)  ALGOL 58  ALGOL 60  ALGOL 68  Success and Failure of ALGOL  Conclusion
  • 3. History  ALGOrithmic Language  Developed in Europe by an international group, consisting of 7 different countries, in the late 1950’s  Very similar to FORTRAN  Peter Naur and J.W. Backus worked on the project. Was the debut of the BNF syntax.  Designed specifically for programming scientific computations
  • 4. History (Continued)  Never became as commercially popular as FORTRAN or COBOL  Was not compatible with IBM  Is considered the most important programming language in terms of influence on later language development  Many similar languages can (and are) referred to as “ALGOL-like”  JAVA, C, C++, Pascal, Ada, FORTRAN, etc.
  • 5. ALGOL Goals  To be as close as possible to standard math notation  Also very readable without much more explanation  Should be possible to use it to describe algorithms in publications  A form of it is still used today  Should be mechanically translatable into machine language programs
  • 6. BNF (Backus-Naur Form)  Was first to use BNF (Backus-Naur Form)  Same Backus that created Fortran  He also was one of the main creators of Algol  And he created functional programming  And won the Turing award in ’77  Right. Back to BNF  BNF example:  <value> := <number> | <variable> | <expression>  <number> := <integer> | <float>  <integer> := <integer><digit> | <digit>  <digit> := 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Language was designed by committee  Report is a “paradigm of brevity and clarity”  Most languages today require 1000’s of pages  Brevity and clarity contributed to reputation as simple, elegant language
  • 7. Three Language Versions  Reference language  Used by the committee, described in the report, and used in official Algol publications  Publication language  Allowed for differences in the character set for different languages  Europeans and Americans couldn’t decide on which character to use for the decimal point!  Hardware representations  Condensed languages for machine input
  • 8. ALGOL 58 The beginning  June 1957 – ACM requested a committee to look into a universal programming language  European and American groups got together in Zurich.  No current language covers everything  Creating more non-ideal languages doesn’t help the situation  Each passing month more people start using other languages  How can the logical structure of existing languages be adjusted
  • 9. ALGOL 58 New Features  Types  Integer  Real  Boolean  Formal vs Actual parameters  Declaration  for statements  Switch  Compound statements  Begin end delimiters  Three level language description  Call by name
  • 10. ALGOL 58 Function vs Procedure  Nature of the body  Expression  Compound statement  Parameter evaluation mechanism  Value of any actual parameter  Text of any actual parameter  Identifier collision  Non-parameter identifiers are global to the definition  Communication only through parameters  Place of use  An operand in an expression  A statement or an operand in an expression
  • 11. Call by name vs. by value  Call by name is default  Call by name: re-evaluate the actual parameter on every use  For actual parameters that are simple variables, it’s the same as call by reference  For actual parameters that are expressions, the expression is re-evaluated on each access  No other language ever used call by name…
  • 12. Call by name begin integer n; procedure p (k: integer) parameter is n+10 (not just 10) begin print (k); prints n+10, which is 10 n := n+1; n is still 0; thus, n becomes 1 print (k); prints n+10, which is 11 end; n is set to 0 n := 0; parameter is n+10 (not just 10) p (n+10); end;
  • 13. Example  Computing Illustrate ( Compute The Mean ): // the main program (this is a comment) begin integer N; Read Int(N); begin real array Data[1:N]; real sum, avg; integer i; sum:=0; for i:=1 step 1 until N do begin real val; Read Real(val); Data[i]:=if val<0 then -val else val end; for i:=1 step 1 until N do sum:=sum + Data[i]; avg:=sum/N; Print Real(avg) end end
  • 14. Example(Continued)  I/O Illustrate: because ALGOL had no IO facilities. The following code could run on an ALGOL implementation for a Burroughs A- Series mainframe. BEGIN FILE F (KIND=REMOTE); EBCDIC ARRAY E [0:11]; REPLACE E BY "HELLO WORLD!"; WHILE TRUE DO BEGIN WRITE (F, *, E); END; END.
  • 15. Problems with Algol58  Didn’t include a I/O library  Thus, each implementation had a different means for I/O  This caused compatibility problems  And no standard way to write a Hello World program
  • 16. ALGOL 60  Basic Language of 1960  Simple imperative language + functions  Successful syntax, BNF -- used by many successors  statement oriented  begin … end blocks (like C { … } )  if … then … else Recursive functions and stack storage allocation  Type discipline was improved by later languages  Very influential but not widely used in US  Tony Hoare: “Here is a language so far ahead of its time that it was not only an improvement on its predecessors but also on nearly all of its successors.”
  • 17. ALGOL 60 Proposed Changes  The empty statement was adopted  Modifications to operation hierarchy  Unary operators having higher precedence than binary operators was adopted  Implied multiplication was rejected  Relation sequences were rejected  The else clause was adopted  Strings, lists, trees, matrices, and complex numbers were rejected as types  Multiple assignment statements were adopted  Created a new problem, A[i] := i := e  Recursion became possible in obvious ways  Constants were rejected
  • 18. ALGOL 60 What’s New  Block  Call by value/name  Typed procedures  Declaration scope  Dynamic arrays  Side effects  Global and local variables  Step, until, while, if then else  Activation records  Recursive decent parsers  No I/O
  • 19. Algol 60 Sample real procedure average(A,n); real array A; integer n; no array bounds begin real sum; sum := 0; for i = 1 step 1 until n do sum := sum + A[i]; average := sum/n no ; here end; set procedure return value by assignment
  • 20. Algol Oddity  Question:  Is x := x equivalent to doing nothing?  Interesting answer in Algol integer procedure p; begin …. p := p …. end;  Assignment here is actually a recursive call
  • 21. Problems with Algol60  Holes in type discipline  Parameter types can be arrays, but  No array bounds  Parameter types can be procedures, but  No argument or return types for procedure parameters  Problems with parameter passing mechanisms  Pass-by-name “Copy rule” duplicates code, interacting badly with side effects  Pass-by-value expensive for arrays  Some awkward control issues  goto out of block requires memory management
  • 22. ALGOL 68  Considered difficult to understand  Idiosyncratic terminology  Types were called “modes”  Arrays were called “multiple values”  Used vW grammars instead of BNF  Context-sensitive grammar invented by van Wijngaarden  Elaborate type system  Complicated type conversions  Fixed some problems of Algol 60  Eliminated pass-by-name  Not widely adopted
  • 23. ALGOL 68 What’s New modes Many new types, called  Primatives  Bits  Bytes  String  Sema (a semaphore)  Complex  File  Pipe  Channel  format  Additional  Flex (Flexible array)  Heap (space on the heap)  Loc (local space on the stack)  Ref (pointer)  Long (bigger ints/reals)  Short (smaller ints/reals)  Declaration of custom types/modes
  • 24. Algol 68 Modes Primitive modes Compound Modes  int --arrays  Real --structures  Char --procedures  bool --sets  string --pointers  Compl(complex)  bits  bytes Rich, structured, and orthogonal type system is a major contribution  Sema (semaphore) of Algol 68.  Format (I/O)  file
  • 25. Other Features of Algol 68  Storage management  Local storage on stack  Heap storage and garbage collection  Parameter passing  Pass-by-value  Use pointer types to obtain pass-by-reference  Assignable procedure variables
  • 26. Structure  ALGOL68 is block structured w/ static scope rules  ALGOL68's model of computation:  static  stack: block/procedure AR's; local data objects  heap: “heap” -- dynamic-- data objects  ALGOL68 is an expression-oriented language
  • 27. Basic Syntax  Addition : “ + ”  Subtraction : “ - ”  Multiplication : “ * ”  Division : “ / ”  Exponentiation : “ ** ”  Assignment : “ := ”  Boolean Expressions  = , > , < , <= , >= , /=
  • 28. Recursion  Algol 68 Supports recursion Example: real procedure factorial (n); begin if n = 1 then factorial := 1; else factorial := n* factorial(n-1); end;
  • 29. Arrays  Three types of arrays: real, integer, Boolean  Each array must contain all the same types  All arrays are of type real unless specified  Can have multidimensional arrays  Declarations:  array name1[1:100]; (1D array of type real)  real array name2(-3:6,20:40); (2D array of type real)  integer array name3,name4(1:46);(2 1D arrays of type integer)  Boolean array name5(-10:n); (1D array of type Boolean) (Allocated Dynamically)
  • 30. Block Structure  First language to implement a block structure  Similar in form to pascal begin ….. end;  Each block can have its own variables, visible only to that block (local variables). After the block is exited the values of all the local variables are lost.
  • 31. Block Structure example  Example: begin own integer i; integer j,k; i := j + k; end;  The integer i will have the value of j+k stored the next time the block is entered  By using the “own” statement the variable will retain its value for the next time the block is entered
  • 32. Parameter Passing  Two types of parameter passing: by Value, by Name  Pass by Value works the same as in most other languages  Pass by Name is similar to pass by reference, but it adds flexibility  All parameters are pass by name unless otherwise specified  Example: can make a call “sum(i,2,5,x+6)” to the procedure sum procedure sum(i,j,k,l); value i,j,k; begin i := i + j + k + l end; (will execute as i := i + 2 + 5 + (x+6))
  • 33. ALGOL Successes and Failures  Programming computers – Partial Success  Core language is strong, no I/O is a serious shortcoming  Publication of algorithms – Very Successful  Stimulus to compiler design – Success with a seed of corruption  It only stimulated compiler design because it was difficult  Stimulated formal language research – Success  Not the goal of the ALGOL effort  Description of ALGOL 60 – Failure  Difficult to understand for the uninitiated reader  Needs an informal explanation
  • 34. Conclusion  General purpose algorithmic language with a clean consistent and unambiguous syntax.  Comprehensive fully-checked type-system covering structures, unions, pointers, arrays and procedures.  Procedures may be nested inside procedures and can deliver values of any type without you having to worry about where the storage is coming from.  User-defined operators including user-defined operator symbols.  Powerful control structures can deliver values of any type.
  • 35. Conclusion (Continued)  Dynamic sized arrays know their current bounds.  Array and structure displays can be used in any context.  Parallel programming with semaphores.  Complex arithmetic.  Declarations can be interleaved with statements.  Clear distinction between value semantics and reference semantics.  No distinction between compile-time constants and run- time values.
  • 36. References  Lindsey, C.H., “A History of ALGOL 68.” History of Programming Languages, ACM Press. 1993. 97-132  Naur, Peter, “Successes and failures of the ALGOL effort”, ALGOL Bulletin #28, Computer History Museum. 1986. 58-62  Thomson, C.M., “Algol 68 as a Living Language”, ALGOL Bulletin #47, Computer History Museum. 1981. 21-24  Perlis, Alan, “The American side of the development of Algol”, The first ACM SIGPLAN conference on History of programming languages, ACM Press. 1978. 3-14  Naur, Peter. “The European side of the last phase of the development of ALGOL 60”, The first ACM SIGPLAN conference on History of programming languages, ACM Press. 1978. 15-44