This document provides an overview of CS 415: Programming Languages taught in the fall of 2005. It discusses the history of early computing devices like scales, abacuses and Stonehenge. It then covers why programming languages are studied, reasons for many languages existing, different programming domains and paradigms. The document also outlines the compilation process including scanning, parsing, semantic analysis, code generation and improvement stages.
This Slide will clear all the Question Regarding compiler development and will also help to understand how a compiler works and how the phases are connected to each one
This Slide will clear all the Question Regarding compiler development and will also help to understand how a compiler works and how the phases are connected to each one
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
2. The first computers
Scales – computed relative weight of two items
Computed if the first item’s weight was less than, equal to, or
greater than the second item’s weight
Abacus – performed mathematical computations
Primarily thought of as Chinese, but also Japanese, Mayan,
Russian, and Roman versions
Can do square roots and cube roots
5. Why study programming
languages?
Become a better software engineer
Understand how to use language features
Appreciate implementation issues
Better background for language selection
Familiar with range of languages
Understand issues / advantages / disadvantages
Better able to learn languages
You might need to know a lot
6. Why study programming
languages?
Better understanding of implementation issues
How is “this feature” implemented?
Why does “this part” run so slowly?
Better able to design languages
Those who ignore history are bound to repeat it…
7. Why are there so many
programming languages?
There are thousands!
Evolution
Structured languages -> OO programming
Special purposes
Lisp for symbols; Snobol for strings; C for systems;
Prolog for relationships
Personal preference
Programmers have their own personal tastes
Expressive power
Some features allow you to express your ideas better
8. Why are there so many
programming languages?
Easy to use
Especially for teaching / learning tasks
Ease of implementation
Easy to write a compiler / interpreter for
Good compilers
Fortran in the 50’s and 60’s
Economics, patronage
Cobol and Ada, for example
9. Programming domains
Scientific applications
Using the computer as a large calculator
Fortran and friends, some Algol, APL
Using the computer for symbol manipulation
Mathematica
Business applications
Data processing and business procedures
Cobol, some PL/1, RPG, spreadsheets
Systems programming
Building operating systems and utilities
C, PL/S, ESPOL, Bliss, some Algol and derivitaves
10. Programming domains
Parallel programming
Parallel and distributed systems
Ada, CSP, Modula, DP, Mentat/Legion
Artificial intelligence
Uses symbolic rather than numeric computations
Lists as main data structure
Flexibility (code = data)
Lisp in 1959, Prolog in the 1970s
Scripting languages
A list of commands to be executed
UNIX shell programming, awk, tcl, Perl
11. Programming domains
Education
Languages designed to facilitate teaching
Pascal, BASIC, Logo
Special purpose
Other than the above…
Simulation
Specialized equipment control
String processing
Visual languages
12. Programming paradigms
You have already seen assembly language
We will study five language paradigms:
Top-down (Algol 60 and Fortran)
Functional (Scheme and/or OCaml)
Logic (Prolog)
Object oriented (Smalltalk)
Aspect oriented (AspectJ)
14. Compilation vs. Translation
Translation: does a ‘mechanical’ translation of the source
code
No deep analysis of the syntax/semantics of the code
Compilation: does a thorough understanding and
translation of the code
A compiler/translator changes a program from one
language into another
C compiler: from C into assembly
An assembler then translates it into machine language
Java compiler: from Java code to Java bytecode
The Java interpreter then runs the bytecode
15. Compilation stages
Scanner
Parser
Semantic analysis
Intermediate code generation
Machine-independent code improvement (optional)
Target code generation
Machine-specific code improvement (optional)
For many compilers, the result is assembly
Which then has to be run through an assembler
These stages are machine-independent!
The generate “intermediate code”
16. Compilation: Scanner
Recognizes the ‘tokens’ of a program
Example tokens: ( 75 main int { return ; foo
Lexical errors are detected here
More on this in a future lecture
17. Compilation: Parser
Puts the tokens together into a pattern
void main ( int argc , char ** argv ) {
This line has 11 tokens
It is the beginning of a method
Syntatic errors are detected here
When the tokens are not in the correct order:
int int foo ;
This line has 4 tokens
After the type (int), the parser expects a variable
name
Not another type
18. Compilation: Semantic analysis
Checks for semantic correctness
A semantic error:
foo = 5;
int foo;
In C (and most languages), a variable has to be
declared before it is used
Note that this is syntactically correct
As both lines are valid lines as far as the parser is concerned
19. Compilation: Intermediate code
generation (and improvement)
Almost all compilers generate intermediate code
This allows part of the compiler to be machine-
independent
That code can then be optimized
Optimize for speed, memory usage, or program
footprint
20. Compilation: Target code
generation (and improvement)
The intermediate code is then translated into the
target code
For most compilers, the target code is assembly
For Java, the target code is Java bytecode
That code can then be further optimized
Optimize for speed, memory usage, or program
footprint