************ Introduction ************ ================= 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. ========== Evaluation ========== Allotment of points ~~~~~~~~~~~~~~~~~~~~~~ * Weelky assignments: 20points * Mid-term paper and presentation in class: 40points * End-of-term exam: 40points 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 ====================== A Fundamental Question ====================== Why do we have so many programming languages? * `List of programming languages - Wikipedia `_ * New languages such as Go, Swift, and Rust has been developed recently. * These languages are different from each other, but how different? .. _definition_of_language: ======================== 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. * :index:`syntax` --- how you write a program. * :index:`semantics` --- what will happen when executiing a program ===================== Differences in syntax ===================== Character ~~~~~~~~~ * Unique symbols (cf. `APL `_ ) * Japanese characters (cf. `Mind `_ ) * Graphics instead of characters (cf. `ToonTalk `_ , `Viscuit `_ ) Grammar ~~~~~~~ There are languages called `Esoteric progarmming language `_. * `Whitespace `_ * `Befunge `_ ======================== 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. ======================================= 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 =================================================== 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.