[go: up one dir, main page]

0% found this document useful (0 votes)
12 views6 pages

PL Reviewer Merged

The document outlines the evaluation criteria for programming languages, focusing on readability, writability, reliability, and cost. It distinguishes between natural and programming languages, explains the significance of studying programming languages, and discusses various programming domains such as scientific and business applications. Additionally, it covers the evolution of programming methodologies and paradigms, highlighting the impact of computer architecture on language design.

Uploaded by

HarshLyrics
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views6 pages

PL Reviewer Merged

The document outlines the evaluation criteria for programming languages, focusing on readability, writability, reliability, and cost. It distinguishes between natural and programming languages, explains the significance of studying programming languages, and discusses various programming domains such as scientific and business applications. Additionally, it covers the evolution of programming methodologies and paradigms, highlighting the impact of computer architecture on language design.

Uploaded by

HarshLyrics
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

PRELIM – LECTURE 1 Language Evaluation Criteria

- Readability: the ease with which programs can be read and


CSP108- Programming Languages understood
- Writability: the ease with which a language can be used to
Lesson Outline create programs
1. Natural Language vs Programming Language - Reliability: conformance to specifications (i.e., performs to its
2. Reasons for studying concepts of Programming Language specifications)
3. Programming Domains - Cost: the ultimate total cost
4. Language Evaluation Criteria
More about Readability
Intended Learning Outcomes - Code easy/fast - to read and understand
- List the differences of Natural Language and Programming - Language factors that affect readability:
Language 1. Overall language simplicity
- Explain the reasons of studying PLs. 2. Control statements built-in
- Assess the significance of implementing different PLs. 3. Data types & structures built-in
- Describe the programming domains 4. Syntax considerations – closeness to natural language
- List the evaluation criteria in PL. and/or mathematics
- Explore the different programming domains by studying
examples of systems created using a PL. Example of Multiplicity:
- Use the language evaluation criteria when examining -x=x+1
programming tasks. - x++
- x += 1
Assessment Tasks
- Library Activity/ Assignment Syntax Design
- Seatwork - Syntax of a PL has an effect on the readability of programs
Syntactic Design Choices:
Natural Language vs Programming Language - Identifier Forms: Restricting identifiers to very short lengths
- Special Words: Program appearance and readability are
What is Natural Language? influenced by the forms of a language’s special words
- is any language which arises in an unplanned fashion as the - Form and Meaning: Designing statements indicates their
result of the facility for language possessed by the human purpose aid to readability
intellect. - Semantics or meaning should follow directly from syntax or
- A natural language is typically used for communication, and form
may be spoken, signed, or written.
- Natural language is distinguished from constructed languages More about Writability
and formal languages such as computer-programming - Ease/speed - to create programs solving problems in a specific
languages or the "languages" used in the study of formal logic, problem domain
especially mathematical logic. Language factors that affect writability:
1. Simplicity
What is Programming Language? 2. Support for abstraction
- is an artificial language designed to express computations that 3. Expressive power (the ability to express different types of
can be performed by a machine, particularly a computer. knowledge in terms of constraints and rules of the language)
- Programming languages can be used to create programs that - Cryptic (puzzling) vs. wordy syntax
control the behavior of a machine, to express algorithms
precisely, or as a mode of human communication. More about Writability
- Concise syntax reduces the amount of code required to
Reasons for studying concepts of Programming Language achieve a particular result, making the code easier to read and
- Increased ability to express ideas maintain.
- Improved background for choosing appropriate languages - Similarly, easy-to-remember keywords and constructs make it
- Increased ability to learn new languages easier for developers to write code without having to
- Better understanding of significance of implementation constantly refer to documentation or other resources.
- Overall advancement of computing (Increase ability to design
new languages) Simplicity Improves Read/Writability
- A large language takes more time to learn
Programming Domains - Programmers might learn only a subset
- Scientific applications: Large number of floating point - Feature multiplicity (having more than one way to perform a
computations (FORTRAN) particular operation) is often confusing
- Business applications: Produce reports, use decimal numbers - For example, in C++ or Java you can decrement a variable in
and characters (COBOL) four different ways: x = x – 1; x -= 1; x--; --x
- Artificial intelligence: Symbols rather than numbers - Operator overloading (a single operator symbol has more
manipulated (LISP) than one meaning) can lead to confusion
- Systems programming: Need efficiency because of continuous - Some languages (e.g., assembly languages), can be "too
use (C, ALGOL, UNIX) simple" – too low level. 2, 3, 4, 5 or more statements needed to
- Web Software: Varied collection of languages: Markup (e.g., have the effect of 1 statement in a high-level language
XHTML), scripting (e.g., PHP), general-purpose (e.g., Java)
Supports for Abstraction
Programming languages are essential tools for developers in Types of abstraction:
creating software applications. However, not all programming - Process abstraction
languages are created equal. - Data abstraction

When choosing a programming language for a project, Abstractions


developers must consider several criteria to ensure they select - Abstractions allow developers to express complex ideas in a
the right language for the job. Some of the most important simple and understandable way. This can be particularly
criteria include readability, writability, reliability, and cost. important for larger projects, where code can quickly become
complex and difficult to understand.
- By using powerful abstractions, developers can reduce the
amount of code required to achieve a particular result, making Short Information: Simula 67
the code more maintainable and easier to understand. - First object-oriented language.
- Defined by Kristen Nygard and Ole-Johan Dahl.
Example: - Supports event-based process modeling.
```c - Near complete superset of Algol-60, but only differs in
#include<stdio.h> parameter passing.
main()
{ Von Neumann Architecture Influence
printf(“Hello World”); - Most dominant because of von Neumann computers.
} - Data and programs stored in memory.
``` - Memory is separate from CPU.
- Instructions and data are piped from memory to CPU.
- Basis for imperative languages.
- Variables model memory cells.
- Assignment statements model piping.
- Iteration is efficient.

Programming Methodologies Influences


PRELIM – LECTURE 2 - Earlier programming languages were designed only for solving
simpler equations but later they began to be widely used for
CSP108- Programming Languages solving complex tasks.
- The major feature of all these programming languages was
Lesson Outline data abstraction.
- Influences on language design - The first language to support this feature was Simula 67.
- Computer Architecture - In the late 1980s began the trend of Object-oriented
- Programming methodologies programming, with features like inheritance and polymorphism.
- Programming Language Paradigms - This led to the development of languages like C++ and Java.
- Imperative
- Functional Programming Methodologies Influences Over Time
- Logical - 1950s and early 1960s: Simple applications; worry about
- Genealogy of PL machine efficiency.
- Late 1960s: People efficiency became important; readability,
Intended Learning Outcomes better control structures (structured programming).
- Recognize the factors that influence the designs of PLs. - Late 1970s: Process-oriented to data-oriented (data
- Analyze the PL paradigms abstraction).
- List the evolution of the PL. - Middle 1980s: Object-oriented programming (data
- Demonstrate the ability to assess different PL according to its abstraction + inheritance + polymorphism).
paradigm - Today: Web and networked environment (Distributed
computing).
Terminal ILO
- Explore the language design by examining the different PLs. Programming Paradigms
- A programming paradigm is a style of programming. Some
TLAs and ATs languages make it easy to write in some paradigms but not
- Interactive lecturing others.
- On the spot questioning - PL are often categorized into four:
- One-minute paper - Imperative
- Library Activity - Functional
- QUIZ - Logic
- Object-oriented
Influences on the language design
There are two major factors that affect the computer design: Programming Paradigms Explained
- Computer Architecture - Imperative: Control flow is an explicit sequence of commands.
- Languages are developed around the common computer Examples: C, C++, Java, Python.
architecture, known as the von Neumann architecture. - Functional: Computation proceeds by function calls that avoid
- The languages based on this architecture are called any global state. Examples: Erlang, Haskell, Lisp, Scala.
imperative languages. - Logic: Uses a set of rules and facts to describe constraints.
- In this architecture, both data and programs are stored in the Examples: Prolog, Datalog, ASP.
memory. - Object-oriented: Computation is effected by sending
- The CPU which executes the instructions is separated from messages to objects. Examples: C++, C#, Python, Swift, Ruby.
memory.
- Therefore, they have to be piped between memory and CPU. Other Activity/Assignment
- The central feature of all languages are variables which - Genealogy of PL
model the memory cells and assignment statements which act - Give 3 PLs for each category.
as a pipeline. - Give sample programs for LISP, PROLOG, COBOL, FORTRAN.

The von Neumann Architecture


- Programming Methodologies
- New software development methodologies led to new
programming paradigms and new programming languages.
- Earlier programming languages were designed only for
solving simpler equations but later they began to be widely
used for solving complex tasks.
- The major feature of all these programming languages was
data abstraction, and the first language to support this feature
was Simula 67.
Programming Language
What is Natural Language? Language Evaluation Criteria
●​ Any language developed naturally for human communication. Readability – How easy it is to read and understand code.
●​ Can be spoken, written, or signed. Factors affecting readability:
●​ Different from formal or constructed languages like programming ●​ Simplicity of language
languages. ●​ Built-in control statements
What is Programming Languages? ●​ Built-in data types & structures
●​ Artificial language designed for expressing computations. ●​ Syntax closeness to natural language
●​ Used to create programs that control machines, express Writability – How easy it is to write and implement code.
algorithms, or communicate human logic. Factors affecting writability:
Reasons for Studying Programming Languages ●​ Simplicity of syntax
1.​ Increased ability to express ideas ●​ Abstraction support
2.​ Improved background for choosing appropriate languages
●​ Expressivity (e.g., concise syntax like x++ instead of x=x+1)
3.​ Increased ability to learn new languages
Reliability – Whether the language ensures correct program
4.​ Better understanding of implementation significance
5.​ Advancement of computing through new language design
behavior under all conditions.
Programming Domains ●​ Type checking (e.g., catching type mismatches)
1.​ Scientific Applications – Uses floating-point computations (e.g., ●​ Exception handling (e.g., try-catch in Java)
FORTRAN) ●​ Readability and writability impact reliability
2.​ Business Applications – Produces reports, processes decimal Cost – The overall expense of using a programming language.
numbers (e.g., COBOL) ●​ Training programmers
3.​ Artificial Intelligence (AI) – Uses symbols rather than numbers ●​ Writing, compiling, and executing programs
(e.g., LISP) ●​ Language implementation system
4.​ Systems Programming – Requires efficiency for continuous use (e.g., ●​ Maintenance costs
C, ALGOL, UNIX)
●​ Cost of poor reliability (e.g., failures in critical systems)
5.​ Web Software – Includes markup, scripting, and general-purpose
languages (e.g., XHTML, PHP, Java)
Other Evaluation Factors 11.​ One of the language criteria that explains the ease with which a
●​ Portability - Ability to move programs across different language can be used to create programs. (Writability)
platform 12.​One of the language criteria that requires program instruction to
●​ Generality - Applicability to various domains perform its specifications under all conditions. (Reliability)
13.​Means that a language statement has more than one way to
●​ Well-definedness - Precision and completeness of language
perform a particular operation. (Feature Multiplicity)
definition
14.​Means that in a language statement, a single operator symbol has
●​ Computer Architecture Influence - Languages designed more than one meaning. (Operator Overloading)
based on hardware capabilities Influences on Language Architecture
●​ Programming Design Methodologies - Support for different 1. Computer Architecture Influence
coding approaches (e.g., OOP, functional programming) Von Neumann Architecture (1945 by John von Neumann)
Review Questions:
1.​ Name the first language used for BUSINESS applications. (COBOL) ●​ Common model for PL development.
2.​ Name a language used for System programming.(C, ALGOL, UNIX) ●​ Data and programs stored in memory.
3.​ The first language developed for Artificial Intelligence. (LISP) ●​ Memory is separate from CPU.
4.​ The first Programming Language was developed by (Ada Lovelace) ●​ CPU fetches and executes instructions.
5.​ A program that follows Compilation. (Compiled languages like C,
●​ Basis for Imperative Languages (e.g., C, Java, Python).
C++)
●​ Variables model memory cells; assignment statements model
6.​ Name an Object-Oriented Programming Language. (Java, Python,
data transfer.
C++)
7.​ The ability of a program to catch runtime errors and handle them ●​ Efficient iteration due to the architecture.
properly without terminating. (Exception handling)
Grace Hopper (1951):
8.​ During Compilation, the output after Syntax Analysis is
(Intermediate Representation (IR) or Parse Tree) ●​ Developed the first compiler (A-0) to translate
9.​ Acronym for FORTRAN. (Formula Translation)
human-readable code into machine code (0s and 1s).
10.​Name the first compiled High-Level Language. (FORTRAN)
2. Programming Methodologies Object-Oriented Paradigm (OOP)
Evolution of programming methodologies: ●​ Computation through object interactions (objects have state and
●​ 1950s-1960s: Focus on machine efficiency. behavior).
●​ Late 1960s: Focus on readability, control structures, and structured ●​ Example Languages: C++, C#, Python, Swift, Objective-C, Ruby, PHP
programming. Primary Components of a Computer
●​ Late 1970s: Shift from process-oriented to data-oriented ●​ Internal Memory:
programming (data abstraction). ○​ Stores programs and data.
●​ 1980s: Rise of object-oriented programming (inheritance, ○​ Essential for executing instructions and managing data
polymorphism). during program execution.
●​ Today: Web, networked environments, and distributed computing. ●​ Processor:
Simula 67: First object-oriented language, introduced data ○​ A collection of circuits that perform primitive operations
abstraction. (e.g., arithmetic, logic operations).
A programming paradigm is a way of writing and structuring code. Some ○​ Executes machine instructions to carry out program tasks.
languages support multiple paradigms. Implementation of Methods
Imperative Paradigm ●​ Compilation - Programs are translated into machine language
●​ Control flow: Explicit sequence of commands. ●​ Source Language - The high level language being translated
●​ Uses statements to change a program's state. ●​ Pure Interpretation - Programs are interpreted by another
●​ Example Languages: C, C++, Java, Python program known as an interpreter
Functional Paradigm ●​ Hybrid Implementation System - Combines compilation and
●​ Computation via function calls that avoid changing global states. interpretation. Source code is first translated into an intermediate
●​ Key concept: Treats computation as mathematical function form (e.g., bytecode), which is then interpreted or compiled further.
evaluation. Compilation Process - has several phases
●​ Example Languages: Erlang, Haskell, Lisp, Scala, Elixir 1. Lexical Analysis: converts 3. Semantic Analysis: generate
Logical Paradigm characters in the source program intermediate code(a lower-level
●​ Rule-based programming where facts and rules infer answers. into lexical units representation of program)
●​ Declarative approach to solving problems. 2. Syntax analysis: transforms lexical 4. Code Generation: machine
●​ Example Languages: Prolog, Datalog, ASP (Answer S units into parse trees code is generated
●​ et Programming) represent the syntactic structure of
program

You might also like