1. Introduction¶
1.1. About this course¶
Advanced subjects – for 3rd or 4th year students.
Aim: Theoretical understanding of programming languages.
Prerequisite: knowledge about two or more programming languages.
1.2. Evaluation¶
1.2.1. Allotment of points¶
Weelky assignments: 20points
Mid-term paper and presentation in class: 40points
End-of-term exam: 40points
1.2.2. Distribution in the past years¶
year 2021 — S:6, A:1, B:2, C:2, D:2
year 2022 — S:13, A:16, B:5, C:3, D:13
1.3. A Fundamental Question¶
Why do we have so many programming languages?
New languages such as Go, Swift, and Rust has been developed recently.
These languages are different from each other, but how different?
1.4. Definition of a language¶
When you want to define a new language, it is important that the definition is simple, rigorous and understandable.
Scheme gives a mathematically precise definition which is hard to understand.
BASIC and C had no rigid definitions at first. As a result, we had several slightly different language processors.
We need two things to define a language.
syntax — how you write a program.
semantics — what will happen when executiing a program
1.5. Differences in syntax¶
1.5.1. Character¶
1.5.2. Grammar¶
There are languages called Esoteric progarmming language.
1.6. Differences in semantics¶
Philosophically speaking, programming paradigm means “What is computation?”.
- Imperative (Procedural)
Computation is a sequence of changing state.
- Functional
Computation is a reduction of expression.
- Logical
Computation is a proof of proposition.
1.7. Criteria for good programming languages¶
Readablility and writability are not compatible in general.
Efficiency
fast execution
fast compilation
fast development process
Reliability
Strong typing, forcing execption handling, etc. (However, some people don’t like them)
Other points
low learning cost
low development cost of language processors
abundant libraries
1.8. Reasons to study the theory of programming language¶
You can select a language suitable for a task in your hand. — There is a saying ‘If all you have is a hammer, everything looks like a nail’.
You can learn a new language easily. — You must continue to learn since progress of IT is very fast.
It is an important base of the computer science.