• 网志分类
  • » 查看所有日志 (36)
    » Database (7)
    » Notes (4)
    » My Heart (15)
    » Java Learning (3)
    » Others (6)
    » 被遗忘的角落 (1)
  • 站内搜索
  • 友情链接
  • » 我的歪酷
    » Rain's Blog

    订阅 RSS

    歪酷博客

    0004982

    « 上一篇: Notice: Keep Silent 下一篇: stanford的一个Oracle资料链接 »
    笑笑 @ 2005-06-14 16:09

    Programming Languages

    From Kurt and David

    Imperative PLs:
       1. Implicit state: variables
       2. State modification: through assignment (“side effecting”)
       3. Instruction sequencing (begin-end blocks, loops, . . . )
    Declarative PLs:
       1. No implicit state, no assignments
       2. Expression evaluation instead of instruction sequencing
       3. Recursion instead of loops

    Imperative PLs/First Generation Languages (1GL)
    Language of the first computer systems (1940s). Raw machine
    code, i.e. numeric (binary) values interpreted as commands by
    the processor.
    Example: 00011010 0011 0100 (3 + 4)

    Imperative PLs/Second Generation Languages (2GL)
    = Assembler language (early 1950s). Symbolic representation of
    machine code. The use of macros (placeholder for a sequence
    of commands) is common.
    Example: ADD 3,4

    Imperative PLs/Third Generation Languages (3GL)
    High level languages. Key characteristics:
    1. Easy to understand (compared to assembler)
    2. System independent (core functionality)
    3. Provides named variables
    4. Provides structure elements (loops, conditions)

    Every 3GL program must be translated into machine code prior
    to execution, either command by command during execution
    (interpreter) or as a whole before execution (compiler).
    The 3GL program is called source code, the resulting machine
    code object code.

    Every 3GL program must be translated into machine code prior
    to execution, either command by command during execution
    (interpreter) or as a whole before execution (compiler).
    The 3GL program is called source code, the resulting machine
    code object code.
    History
    1950: COBOL (COmmon Business Oriented Language)
    1955: FORTRAN (FORmula TRANslator)
    1960: BASIC (Beginners All-purpose Symbolic Instruction
    Code)
    1970: PASCAL, MODULA (Niklaus Wirth), C
    1980: C++, Objective Pascal

    Imperative PLs/Fourth Generation Languages (4GL)
    “Application specific” high-level languages, mostly built around
    database systems (late 1970s).
    Powerful set of functions/commands, but slower execution than
    3GL. Often vendor-dependent.
    Query languages for interactive data retrieval (e.g., SQL)
    Report generators
    Graphics languages (e.g., PostScript)
    Application generators, CASE tools (e.g., Delphi)
    Very high-level programming languages (e.g., MATLAB, SAS)

    Object-Oriented Programming Languages
    Objects model real-world entities. Each object is composed of
    data and code which are “encapsulated” from the other objects.
    An object is characterized through state and behavior.
    The behavior of an object is defined by its repertoire of methods
    (code).
    The state of an object is defined by its attributes (variables).
    Attributes are accessed through methods.
    Objects are instances of classes (object templates). Classes can
    be hierarchically organized through inheritance of both methods
    and attributes.

    Declarative PLs
    Functional Programming Languages
    Computation based on function evaluation.
    Ideally, no assignments (“side-effects”).
    Referential transparency: meaning of the whole is solely determined
    by the meaning of the parts.
    Functions are first-class objects (treated like values)
    Lazy evaluation: expressions are evaluated only when needed
    Examples: LISP, APL, S

    Logic Programming Languages
    based on rules of formal logic
    results are derived from rules
    base concept: unification
    Two terms to be unified are compared. Both constants: result
    is TRUE or FALSE. One constant, one variable: variable
    is bound to constant. Two expressions: unified recursively.
    Example: PROLOG (PROgramming with LOGic)

    Examples: 1,2,3,. . . ,10

    COBOL
    IDENTIFICATION DIVISION.
    PROGRAM-ID. DisplayNumbers.
    DATA DIVISION.
    WORKING-STORAGE SECTION.
    01 I PIC 99 VALUE 1.
    PROCEDURE DIVISION.
    Begin.
    PERFORM UNTIL I = 11
    DISPLAY I
    ADD 1 TO I
    END-PERFORM
    STOP RUN.

    FORTRAN
    PROGRAM DisplayNumbers
    INTEGER :: i
    DO 99 i = 1, 10
    PRINT *, i
    99 CONTINUE
    END PROGRAM

    BASIC
    10 FOR i = 1 TO 10
    20 PRINT i
    30 NEXT i
    PASCAL
    Program DisplayIntegers;
    Var i : Integer;
    Begin
    For i := 1 to 10 do
    WriteLn(i);
    End.

    C
    void main() {
    for (int i = 1; i < 10; i++)
    printf("%u\n",i);
    }
    LISP
    (dotimes (i 10)
    (print (+ 1 i))
    )
    S
    print(1:10)



    最新评论

    2005-06-15 12:42 网址: http://ganyu21.ycool.com/

    语言变化还是很快哦



    笑笑

    2005-06-16 16:06

    呵呵看参考资料的时候有好几个3GL,怎么也猜不出意思,这下就好了


    评论 / 个人网页 / 扔小纸条
    *昵称

    已经注册过? 请登录

    Email
    网址
    *评论