Chapter 2 Flashcards
(16 cards)
Make an educated guess as to the most common syntax error in LISP
programs.
Because of the simple syntax of LISP, few syntax errors occur in LISP programs.
Unmatched parentheses is the most common mistake.
LISP began as a pure functional language but gradually acquired more
and more imperative features. Why?
The main reason why imperative features were put in LISP was to increase its
execution efficiency.
Describe in detail the three most important reasons, in your opinion,
why ALGOL 60 did not become a very widely used language.
Lack of Standardized I/O – ALGOL 60 did not define standard input/output operations, making it impractical for many real-world applications compared to languages like Fortran, which had built-in I/O handling.
Complex Syntax & Recursion – While innovative, its syntax and recursive function support were complex for early computers, limiting adoption in performance-critical environments.
Limited Industry Adoption – It was mainly used in academia and lacked strong backing from industry players, leading to fewer compilers and less commercial usage compared to Fortran and COBOL.
Why, in your opinion, did COBOL allow long identifiers when Fortran
and ALGOL did not?
COBOL allowed long identifiers because it was designed for business applications, where readability and self-documentation were priorities. Business users and analysts, who were not necessarily programmers, needed code that resembled natural language. In contrast, Fortran was developed for scientific computing, where concise mathematical expressions were preferred, and ALGOL focused on structured programming and formal notation, prioritizing clarity in algorithms over verbosity. COBOL’s long identifiers made programs more understandable for non-technical users, aligning with its goal of improving maintainability in large-scale business applications.
Outline the major motivation of IBM in developing PL/I.
The main motivation for the development of PL/I was to provide a single tool for
computer centers that must support both scientific and commercial applications. IBM
believed that the needs of the two classes of applications were merging, at least to some
degree. They felt that the simplest solution for a provider of systems, both hardware and
software, was to furnish a single hardware system running a single programming
language that served both scientific and commercial applications.
Describe, in your own words, the concept of orthogonality in program
ming language design.
Orthogonality in programming language design refers to the principle that features should operate independently without unexpected interactions. When a language is highly orthogonal, combining different features (such as data types, control structures, and functions) leads to predictable and consistent behavior. This makes the language easier to learn, use, and debug because there are fewer special cases or exceptions.
For example, in a highly orthogonal language, a function should work the same way whether it’s applied to an integer, a float, or a user-defined type, as long as they follow the same rules. Conversely, a low orthogonality language has many restrictions and irregular behaviors, making it harder to predict how different features will interact.
Was IBM’s assumption, on which it based its decision to develop PL/I,
correct, given the history of computers and language developments since
1964?
IBM was, for the most part, incorrect in its view of the future of the uses of
computers, at least as far as languages are concerned. Commercial applications are
nearly all done in languages that are specifically designed for them. Likewise for
scientific applications. On the other hand, the IBM design of the 360 line of computers
was a great success–it still dominates the area of computers between supercomputers and
minicomputers. Furthermore, 360 series computers and their descendants have been
widely used for both scientific and commercial applications. These applications have
been done, in large part, in Fortran and COBOL.
What is the primary reason why PL/I became more widely used than
ALGOL 68?
The primary reason PL/I became more widely used than ALGOL 68 was its practicality and industry adoption. PL/I was designed to support both business and scientific computing, making it appealing to a broader range of users, whereas ALGOL 68 was more academically focused and had a complex syntax that made compiler implementation difficult. PL/I was also backed by IBM, ensuring strong industry support, while ALGOL 68 struggled with adoption due to its controversial design and delayed standardization. As a result, PL/I gained traction in commercial environments, whereas ALGOL 68 remained mostly in academic circles.
What are the arguments both for and against the idea of a typeless
language?
The argument for typeless languages is their great flexibility for the programmer.
Literally any storage location can be used to store any type value. This is useful for very
low-level languages used for systems programming. The drawback is that type checking
is impossible, so that it is entirely the programmer’s responsibility to insure that
expressions and assignments are correct.
What is your opinion of the argument that languages that are too com
plex are too dangerous to use, and we should therefore keep all languages
small and simple?
Keeping languages small and simple can improve readability, maintainability, and reliability, reducing the risk of bugs and security vulnerabilities. However, overly simple languages may lack the expressiveness and flexibility needed for complex applications, leading to workarounds that introduce even more errors.
While highly complex languages (e.g., ALGOL 68, C++) can be dangerous due to steep learning curves and subtle pitfalls, a well-designed language balances power and simplicity. Instead of making all languages small, the focus should be on clear design, consistency, and strong tooling (e.g., compilers, linters, type systems) to manage complexity safely.
Do you think language design by committee is a good idea? Support
your opinion.
Language design by committee has advantages, such as diverse input, standardization, and thorough review, making the language more robust and widely accepted. However, it can also lead to slow decision-making, feature bloat, and a lack of innovation due to compromises. While committees ensure stability, they often struggle with agility and simplicity. A better approach is a small, focused team making core decisions with community feedback to balance efficiency, practicality, and innovation.
Languages continually evolve. What sort of restrictions do you think
are appropriate for changes in programming languages? Compare your
answers with the evolution of Fortran.
A good deal of restraint must be used in revising programming languages. The
greatest danger is that the revision process will continually add new features, so that the
language grows more and more complex. Compounding the problem is the reluctance,
because of existing software, to remove obsolete features.
Explain two reasons why pure interpretation is an acceptable implemen
tation method for several recent scripting languages.
One situation in which pure interpretation is acceptable for scripting languages is
when the amount of computation is small, for which the processing time will be negligible. Another situation is when the amount of computation is relatively small and it
is done in an interactive environment, where the processor is often idle because of the
slow speed of human interactions.
Perl 6, when it arrives, will likely be a significantly enlarged language.
Make an educated guess as to whether a language like Lua will also grow
continuously over its lifetime. Support your answer.
Lua is unlikely to grow continuously like Perl 6 because it follows a design philosophy of simplicity and minimalism. Unlike Perl, which aims to include extensive built-in features for diverse tasks, Lua is designed as a lightweight, embeddable scripting language, primarily used in game development and embedded systems. Its small core and reliance on external libraries allow it to remain efficient and flexible without unnecessary complexity. While Lua may evolve with optimizations and new features, it is unlikely to undergo significant expansion, as that would contradict its core principles of performance and portability.
Why, in your opinion, do new scripting languages appear more fre
quently than new compiled languages?
New scripting languages may appear more frequently than new compiled languages
because they are often smaller and simpler and focused on more narrow applications,
which means their libraries need not be nearly as large.
Give a brief general description of a markup/programming hybrid
language.
A markup/programming hybrid language combines markup for structuring content and programming features for dynamic behavior. These languages allow developers to define both the appearance and logic of a document or application.