《程序设计语言》的原文摘录

  • Excellent Compilers. Fortran owes much of its success to extremely good compilers. In part this is a matter of historical accident. Fortran has been around longer than anything else, and companies have invested huge amounts of time and money in making compilers that generate very fast code. It is also a matter of language design, however: Fortran dialects prior to Fortran 90 lack recursion and pointers, features that greatly complicate the task of generating fast code (at least for programs that can be written in a reasonable fashion without them!). In a similar vein, some languages (e.g., Common Lisp) are successful in part because they have compilers and supporting tools that do an unusually good job of helping the programmer manage very lage projects. (查看原文)
    IUSR 2011-08-13 13:19:01
    —— 引自第9页
  • Economics, Patronage, and Inertia. Finally, there are factors other than technical merit that greatly influence success. The backing of a powerful sponsor is one. PL/I, at least to first approximation, owes its life to IBM. Cobol and, more recently, Ada owe their life to the U.S. Department of Defense: Ada contains a wealth of excellent features and ideas, but the sheer complexity of implementation would likely have killed it if not for the DoD backing. Similarly, C#, despite its technical merits, would probably not have received the attention it has without the backing of Microsoft. At the other end of the life cycle, some languages remain widely used long after "better" alternatives are available because of a huge base of installed software and programmer expertise, which would cost to... (查看原文)
    IUSR 2011-08-13 14:00:48
    —— 引自第9页
  • Declarative languages are in some sense "higher level"; they are more in tune with the programmers point of view, and less with the implementor's point of view. Imperative languages predominate, however, mainly for performance reasons. (查看原文)
    IUSR 2011-08-13 14:08:13
    —— 引自第10页
  • There is a tension in the design of declarative languages between the desire to get away from "irrelevant" implementation details, and the need to remain close enough to the details to at least control the outline of an algorithm. The design of efficient algorithms, after all, is what much of computer science is about. It is not yet clear to what extent, and in what problem domains, we can expect compilers to discover good algorithms for problems stated at a very high level of abstraction. In any domain in which the compiler cannot find a good algorithm, the programmer needs to be able to specify one explicitly. (查看原文)
    IUSR 2011-08-13 16:25:45
    —— 引自第10页
  • Logic- or constraint-based languages take their inspiration from predicate logic. They model computation as an attempt to find values that satisfy certain specified relationships, using gaol-directed search through a list of logical rules. Prolog is the best-known logic language. The term is also sometimes applied to the SQL database language, the XSLT scripting language, and programmable aspects of spreadsheets such as Excel and its predecessors. (查看原文)
    IUSR 2011-08-13 22:52:01
    —— 引自第11页
  • The von Neumann languages are the most familiar and successful. They include Fortran, Ada 83, C, and all of the others in which the basic means of computation is the modification of variables. Whereas functional languages are based on expressions that have values, von Neumann languages are based on statements (assignments in particular) that influence subsequent computation via the side effect of changing the value of memory. (查看原文)
    IUSR 2011-08-13 23:21:10
    —— 引自第11页
  • We have seen several examples already of higher-order functions: call/cc (sec continuations), for-each (Example 10.19), compose (Example 10.20), and apply (page 535). (查看原文)
    [已注销] 2012-10-16 15:22:47
    —— 引自第545页
  • First, much of the power of first-class functions depends on the ability to create new functions on the fly, and for that we need a function constructor: something like Scheme’s lambda or ML’s fn. (查看原文)
    [已注销] 2012-10-16 15:24:58
    —— 引自第547页
  • In effect, coroutines are execution contexts that exist concurrently but exe- cute one at a time, and that transfer control to each other explicitly, by name. Coroutines can be used to implement iterators (Section 6.5.3) and threads (查看原文)
    [已注销] 2012-10-16 15:57:00
    —— 引自第453页
  • Donald Knuth has suggested that programming be regarded as the art of telling another human being what one wants the computer to do [Knu84]. (查看原文)
    t君 2013-01-13 10:55:39
    —— 引自第10页