CS 143 Lecture02: Language Design and Instruction of Cool
Topics:
- Why are there new languages?
- Good-language criteria
History of ideas:
- Abstract(抽象)
- Types(类型)
- Reuse(复用)
History of Ideas
-
Abstract
Abstraction = Ignorance of some details
Abstract is necessary to build a complex system, and the key is information hiding - only expose the essential
Modes:
- Via language
- Via function / subroutine (LISP?)
- Via module (ECMAScript)
- Via class or abstract data types (Rust)
-
Types
- Originally, few(no) types
- But types helps on building abstractions / compile time check.
- Experiments with various forms of parameterization(a.k.a. generic types,也就是所谓“泛型”).
- Best developed in functional programming(a.k.a. FP).
-
Reuse
It’s many common patterns while programming, but they’re hard to reuse.
Tow popular approaches:
- Type parameterization(泛型,
List<int>
、List<double>
) - Classes and inheritance
- (Where is Traits? 🤣
- Type parameterization(泛型,