In Scala, val declares immutable variables and var declares mutable variables. The value of a val cannot be changed after declaration, while the value of a var can be reassigned.
Object-oriented programming (OOP) uses classes and objects to organize code and data. One key feature of OOP is inheritance, which allows a child class to inherit attributes and behaviors from a parent class. The paper discusses inheritance and its types, including single, multiple, multilevel, hierarchical, and hybrid inheritance. It explains that inheritance allows code reuse and makes programs more reliable, efficient, and easier to develop by reducing duplicate code.
This document provides an overview of the basics of Python programming. It discusses that Python is a simple, easy to learn, high-level, interpreted, object-oriented, extensible and portable programming language. It has an extensive standard library and is free and open source. The document also provides a brief history of Python, describing its creation and key releases over time. It outlines some basic Python concepts like variables, data types, operators, expressions and input/output.
C# introduction document covers the following topics:
- Hello World demo shows a basic C# console application.
- The .NET Framework overview describes its common language runtime, base class library and language interoperability.
- Design goals of C# emphasize it being the first component-oriented C-family language and unifying all data types as objects.
- Language features covered include program structure, type system, predefined types, classes, structs, interfaces, enums and delegates.
ZENUS INFOTECH is best Python Training institute in Roorkee and an ISO 9001:2008 Certified Engineers Training Company in Roorkee & provides training to the B.E./B.TECH/DIPLOMA/MCA/BCA and related field students in 35+ cutting-edge technologies like AutoCAD, Solid-Works, CATIA, REVIT, Pro-E, UG-NX .NET, JAVA, PHP, GST Tally and Wireless & Telecommunication and many more.
The document discusses challenges in cross-language word alignment. It outlines topics including word alignment concepts and applications, state of the art, and limitations due to phenomena like multiword units. Guidelines are presented for annotating alignments between English, French, Portuguese and Spanish, including challenges like prepositional dependencies, multiword units, and contractions. The goal is to create linguistically informed gold standard alignment sets to help machine translation tasks.
The document discusses planetary geodesy, which involves determining properties of planetary bodies like size, shape, rotation, and gravity fields. It provides a history of planetary mapping starting in the 17th century with Galileo's drawings of the Moon. Planetary mapping differs from Earth mapping in tools used. Science goals include defining reference systems and rotation parameters. Control points on other planets are often crater centers defined by rims. Planetary geodesy has developed innovative techniques and contributes to understanding Solar System objects.
The Ring programming language version 1.8 book - Part 93 of 202Mahmoud Samir Fayed
油
Ring is designed to be a simple yet powerful programming language. It uses lists, strings, numbers, and objects as its core data types. Lists can represent arrays, dictionaries, and trees. Numbers can represent integers, floats, and Booleans. Strings can represent various data types. The goals of Ring's design are to keep the core concepts small and flexible while also being extensible through object-oriented programming. Some key features of Ring discussed in the document include its support for functional programming without closures, defining custom domain-specific languages, breaking multiple loops, and using natural language-inspired keywords.
The Ring programming language version 1.5.2 book - Part 174 of 181Mahmoud Samir Fayed
油
The document contains responses to frequently asked questions about the Ring programming language. Some key points:
- Ring allows users to define their own domain-specific languages for writing natural statements without needing to learn parsing syntax.
- Features like breaking multiple loops are included to support both small and large programs, while preventing errors without reducing flexibility.
- The design of Ring aims to keep the basic language constructs small and simple while enabling flexibility and extensibility through object-oriented programming.
- Data types in Ring are kept minimal (number, string, list, object) for simplicity, but can represent various values and be extended as needed through classes and operator overloading.
The document provides logistics information for a class including details about laptops, restrooms, breaks, and cell phone signals. It then introduces the instructor, Dr. Jey Veerasamy, and provides details about his background, education, experience, and employment history. Finally, it lists the sign-in sheet policy and welcomes students to bring friends.
This document provides an introduction to C++ programming. It discusses the basic elements of a C++ program including variables, input/output, comments, and memory. It then explains how a simple C++ program is compiled, showing the compilation process and different compiler options. Finally, it provides an overview of how C++ compilation works, outlining the steps of preprocessing, compilation, and linking.
This document provides an introduction to C++ programming. It discusses the basic elements of a C++ program including variables, input/output, comments, and memory. It then explains how a simple C++ program is compiled and executed. The document also provides a brief overview of programming and how C++ programs are compiled, involving preprocessing, compilation, and linking. Key concepts introduced include variables, data types, and the use of streams for input/output.
This document provides information about a programming languages concepts course, including details about the course code, title, lecturer, and description. The course aims to describe the evolution of programming languages and understand different computation models or paradigms like imperative, functional, logic and object-oriented programming. It will cover topics like syntax, semantics, data types, expressions and control structures over 13 weeks. Students will complete an assignment on MATLAB/Octave and two term exams. The course objectives are listed as understanding different programming language paradigms and concepts to select the proper language to solve problems.
The Ring programming language version 1.5.4 book - Part 178 of 185Mahmoud Samir Fayed
油
The document contains responses to questions about the Ring programming language. Some key points:
- Ring allows defining custom languages using classes, making statements without parsing.
- Breaking multiple loops from subfunctions can be useful for small programs, though not always best practice. Flexibility is provided but not encouraged.
- Keywords like "See", "Give", "But", and "Ok" were chosen for quick writing and understandability over tradition. Alternatives are also supported.
- Ring keeps data types simple with Numbers, Strings, Lists, and Objects, allowing flexibility through operator overloading and OOP to represent different domains. This balances simplicity with power.
The document discusses the F# programming language and how it is well-suited for parallel and concurrent programming on multi-core systems. It provides a brief history of F#, describes its current capabilities, and looks ahead to its future roadmap and co-evolution with other Microsoft languages. The document also discusses how functional programming concepts in F# can help address challenges of parallel and concurrent programming.
This document provides an overview and introduction to a course on principles of compiler design. It discusses the motivation for studying compilers, as language processing is important for many software applications. It outlines what will be covered in the course, including the theoretical foundations and practical techniques for developing lexical analyzers, parsers, type checkers, code generators, and more. The document also describes the organization of the course with lectures, programming assignments, and exams.
Here is a presentation I created quite a few years back when giving a presentation to students on programming languages. I have updated it with some recent trends.
This document provides an overview of C and C++, including:
- Five reasons to learn C/C++, such as industry usage and useful for other modules.
- The history of C and C++, from the creation of C at Bell Labs in the 1970s to the development of C++ in the 1980s.
- The aims of C, such as ability to write low-level code and efficiency, versus the aims of C++ which grew from C while keeping some similar aims.
- The differences between procedural and object-oriented languages, and how C++ allows both paradigms while C is purely procedural.
- The similarities and differences between C and C++ in
This workshop was given at FITC Toronto 2012. Most of the details were shared by browsing code and talking together, so there isn't very much "content" in the slides themselves.
LESSON 3B. FOCUS: FOR LOOPS, NESTED LOOPS, TASKS AND CHALLENGES.
Introduction to, with examples, For loops. Challenges and tasks included with solutions (predict the output). Compare while and for loops. Use the break statement and explore how it works in different scenarios. Learn about Nested Loops. Learn about the need for initialisation (set starting value). Create your own for loops. Create the beginnings of an arithmetic quiz using a random function and for loops. Big ideas discussion: Is the universe digital. A program? Introducing Gottfried Leibniz and Konrad Zuse. Includes a suggested videos, Big ideas discussion, and HW/research projects section.
This document provides an overview and summary of an introduction to programming course using C# that will be taught by G端len Demir旦z. The course will cover object oriented programming concepts and developing programs using the C# language on the .NET platform. Students will learn about classes, methods, control statements, inheritance and more. The course will be taught on Thursdays and Saturdays and include exams, homework assignments, and lectures notes available online.
vod do programov叩n鱈 3 (to be continued)Karel Minarik
油
The document provides an introduction to programming concepts in Czech language including basic data types, operations, loops, and conditions. It discusses different programming paradigms such as procedural, object-oriented, and functional programming. It also presents short histories and examples of popular programming languages like Perl, Java, PHP, and Ruby.
This document provides an introduction to computer programming concepts including:
- A programming language is a set of rules that allows communication between humans and computers to perform operations. Different languages have evolved for different types of programs and problem domains.
- Programs are written in high-level languages then compiled or interpreted into machine-readable code. Common language types include procedural, object-oriented, functional, and declarative languages.
- The programming process involves understanding the problem, designing an algorithm, writing source code, compiling for errors, debugging, and executing the program. Flowcharts can help design the program logic.
This document discusses syntactic editor services including formatting, syntax coloring, and syntactic completion. It describes how syntactic completion can be provided generically based on a syntax definition. The document also discusses how context-free grammars can be extended with templates to specify formatting layout when pretty-printing abstract syntax trees to text. Templates are used to insert whitespace, line breaks, and indentation to produce readable output.
More Related Content
Similar to Ti1220 Lecture 1: Programming Linguistics (20)
The Ring programming language version 1.8 book - Part 93 of 202Mahmoud Samir Fayed
油
Ring is designed to be a simple yet powerful programming language. It uses lists, strings, numbers, and objects as its core data types. Lists can represent arrays, dictionaries, and trees. Numbers can represent integers, floats, and Booleans. Strings can represent various data types. The goals of Ring's design are to keep the core concepts small and flexible while also being extensible through object-oriented programming. Some key features of Ring discussed in the document include its support for functional programming without closures, defining custom domain-specific languages, breaking multiple loops, and using natural language-inspired keywords.
The Ring programming language version 1.5.2 book - Part 174 of 181Mahmoud Samir Fayed
油
The document contains responses to frequently asked questions about the Ring programming language. Some key points:
- Ring allows users to define their own domain-specific languages for writing natural statements without needing to learn parsing syntax.
- Features like breaking multiple loops are included to support both small and large programs, while preventing errors without reducing flexibility.
- The design of Ring aims to keep the basic language constructs small and simple while enabling flexibility and extensibility through object-oriented programming.
- Data types in Ring are kept minimal (number, string, list, object) for simplicity, but can represent various values and be extended as needed through classes and operator overloading.
The document provides logistics information for a class including details about laptops, restrooms, breaks, and cell phone signals. It then introduces the instructor, Dr. Jey Veerasamy, and provides details about his background, education, experience, and employment history. Finally, it lists the sign-in sheet policy and welcomes students to bring friends.
This document provides an introduction to C++ programming. It discusses the basic elements of a C++ program including variables, input/output, comments, and memory. It then explains how a simple C++ program is compiled, showing the compilation process and different compiler options. Finally, it provides an overview of how C++ compilation works, outlining the steps of preprocessing, compilation, and linking.
This document provides an introduction to C++ programming. It discusses the basic elements of a C++ program including variables, input/output, comments, and memory. It then explains how a simple C++ program is compiled and executed. The document also provides a brief overview of programming and how C++ programs are compiled, involving preprocessing, compilation, and linking. Key concepts introduced include variables, data types, and the use of streams for input/output.
This document provides information about a programming languages concepts course, including details about the course code, title, lecturer, and description. The course aims to describe the evolution of programming languages and understand different computation models or paradigms like imperative, functional, logic and object-oriented programming. It will cover topics like syntax, semantics, data types, expressions and control structures over 13 weeks. Students will complete an assignment on MATLAB/Octave and two term exams. The course objectives are listed as understanding different programming language paradigms and concepts to select the proper language to solve problems.
The Ring programming language version 1.5.4 book - Part 178 of 185Mahmoud Samir Fayed
油
The document contains responses to questions about the Ring programming language. Some key points:
- Ring allows defining custom languages using classes, making statements without parsing.
- Breaking multiple loops from subfunctions can be useful for small programs, though not always best practice. Flexibility is provided but not encouraged.
- Keywords like "See", "Give", "But", and "Ok" were chosen for quick writing and understandability over tradition. Alternatives are also supported.
- Ring keeps data types simple with Numbers, Strings, Lists, and Objects, allowing flexibility through operator overloading and OOP to represent different domains. This balances simplicity with power.
The document discusses the F# programming language and how it is well-suited for parallel and concurrent programming on multi-core systems. It provides a brief history of F#, describes its current capabilities, and looks ahead to its future roadmap and co-evolution with other Microsoft languages. The document also discusses how functional programming concepts in F# can help address challenges of parallel and concurrent programming.
This document provides an overview and introduction to a course on principles of compiler design. It discusses the motivation for studying compilers, as language processing is important for many software applications. It outlines what will be covered in the course, including the theoretical foundations and practical techniques for developing lexical analyzers, parsers, type checkers, code generators, and more. The document also describes the organization of the course with lectures, programming assignments, and exams.
Here is a presentation I created quite a few years back when giving a presentation to students on programming languages. I have updated it with some recent trends.
This document provides an overview of C and C++, including:
- Five reasons to learn C/C++, such as industry usage and useful for other modules.
- The history of C and C++, from the creation of C at Bell Labs in the 1970s to the development of C++ in the 1980s.
- The aims of C, such as ability to write low-level code and efficiency, versus the aims of C++ which grew from C while keeping some similar aims.
- The differences between procedural and object-oriented languages, and how C++ allows both paradigms while C is purely procedural.
- The similarities and differences between C and C++ in
This workshop was given at FITC Toronto 2012. Most of the details were shared by browsing code and talking together, so there isn't very much "content" in the slides themselves.
LESSON 3B. FOCUS: FOR LOOPS, NESTED LOOPS, TASKS AND CHALLENGES.
Introduction to, with examples, For loops. Challenges and tasks included with solutions (predict the output). Compare while and for loops. Use the break statement and explore how it works in different scenarios. Learn about Nested Loops. Learn about the need for initialisation (set starting value). Create your own for loops. Create the beginnings of an arithmetic quiz using a random function and for loops. Big ideas discussion: Is the universe digital. A program? Introducing Gottfried Leibniz and Konrad Zuse. Includes a suggested videos, Big ideas discussion, and HW/research projects section.
This document provides an overview and summary of an introduction to programming course using C# that will be taught by G端len Demir旦z. The course will cover object oriented programming concepts and developing programs using the C# language on the .NET platform. Students will learn about classes, methods, control statements, inheritance and more. The course will be taught on Thursdays and Saturdays and include exams, homework assignments, and lectures notes available online.
vod do programov叩n鱈 3 (to be continued)Karel Minarik
油
The document provides an introduction to programming concepts in Czech language including basic data types, operations, loops, and conditions. It discusses different programming paradigms such as procedural, object-oriented, and functional programming. It also presents short histories and examples of popular programming languages like Perl, Java, PHP, and Ruby.
This document provides an introduction to computer programming concepts including:
- A programming language is a set of rules that allows communication between humans and computers to perform operations. Different languages have evolved for different types of programs and problem domains.
- Programs are written in high-level languages then compiled or interpreted into machine-readable code. Common language types include procedural, object-oriented, functional, and declarative languages.
- The programming process involves understanding the problem, designing an algorithm, writing source code, compiling for errors, debugging, and executing the program. Flowcharts can help design the program logic.
This document discusses syntactic editor services including formatting, syntax coloring, and syntactic completion. It describes how syntactic completion can be provided generically based on a syntax definition. The document also discusses how context-free grammars can be extended with templates to specify formatting layout when pretty-printing abstract syntax trees to text. Templates are used to insert whitespace, line breaks, and indentation to produce readable output.
This document provides an overview of parsing in compiler construction. It discusses context-free grammars and how they are used to generate sentences and parse trees through derivations. It also covers ambiguity that can arise from grammars and various grammar transformations used to eliminate ambiguity, including defining associativity and priority. The dangling else problem is presented as an example of an ambiguous grammar.
This document provides an overview of the Lecture 2 on Declarative Syntax Definition for the CS4200 Compiler Construction course. The lecture covers the specification of syntax definition from which parsers can be derived, the perspective on declarative syntax definition using SDF, and reading material on the SDF3 syntax definition formalism and papers on testing syntax definitions and declarative syntax. It also discusses what syntax is, both in linguistics and programming languages, and how programs can be described in terms of syntactic categories and language constructs. An example Tiger program for solving the n-queens problem is presented to illustrate syntactic categories in Tiger.
This document provides an overview of the CS4200 Compiler Construction course at TU Delft. It discusses the course organization, structure, and assessment. The course is split into two parts - CS4200-A which covers concepts and techniques through lectures, papers, and homework assignments, and CS4200-B which involves building a compiler for a subset of Java as a semester-long project. Students will use the Spoofax language workbench to implement their compiler and will submit assignments through a private GitLab repository.
A Direct Semantics of Declarative Disambiguation RulesEelco Visser
油
This document discusses research into providing a direct semantics for declarative disambiguation of expression grammars. It aims to define what disambiguation rules mean, ensure they are safe and complete, and provide an effective implementation strategy. The document outlines key research questions around the meaning, safety, completeness and coverage of disambiguation rules. It also presents contributions around using subtree exclusion patterns to define safe and complete disambiguation for classes of expression grammars, and implementing this in SDF3.
Declarative Type System Specification with StatixEelco Visser
油
In this talk I present the design of Statix, a new constraint-based language for the executable specification of type systems. Statix specifications consist of predicates that define the well-formedness of language constructs in terms of built-in and user-defined constraints. Statix has a declarative semantics that defines whether a model satisfies a constraint. The operational semantics of Statix is defined as a sound constraint solving algorithm that searches for a solution for a constraint. The aim of the design is that Statix users can ignore the execution order of constraint solving and think in terms of the declarative semantics.
A distinctive feature of Statix is its use of scope graphs, a language parametric framework for the representation and querying of the name binding facts in programs. Since types depend on name resolution and name resolution may depend on types, it is typically not possible to construct the entire scope graph of a program before type constraint resolution. In (algorithmic) type system specifications this leads to explicit staging of the construction and querying of the type environment (class table, symbol table). Statix automatically stages the construction of the scope graph of a program such that queries are never executed when their answers may be affected by future scope graph extension. In the talk, I will explain the design of Statix by means of examples.
https://eelcovisser.org/post/309/declarative-type-system-specification-with-statix
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionEelco Visser
油
Compiler construction techniques are applied beyond general-purpose languages through domain-specific languages (DSLs). The document discusses several DSLs developed using Spoofax including:
- WebDSL for web programming with sub-languages for entities, queries, templates, and access control.
- IceDust for modeling information systems with derived values computed on-demand, incrementally, or eventually consistently.
- PixieDust for client-side web programming with views as derived values updated incrementally.
- PIE for defining software build pipelines as tasks with dynamic dependencies computed incrementally.
The document also outlines several research challenges in compiler construction like high-level declarative language definition, verification of
Domain Specific Languages for Parallel Graph AnalytiX (PGX)Eelco Visser
油
This document discusses domain-specific languages (DSLs) for parallel graph analytics using PGX. It describes how DSLs allow users to implement graph algorithms and queries using high-level languages that are then compiled and optimized to run efficiently on PGX. Examples of DSL optimizations like multi-source breadth-first search are provided. The document also outlines the extensible compiler architecture used for DSLs, which can generate code for different backends like shared memory or distributed memory.
Compiler Construction | Lecture 15 | Memory ManagementEelco Visser
油
The document discusses different memory management techniques:
1. Reference counting counts the number of pointers to each record and deallocates records with a count of 0.
2. Mark and sweep marks all reachable records from program roots and sweeps unmarked records, adding them to a free list.
3. Copying collection copies reachable records to a "to" space, allowing the original "from" space to be freed without fragmentation.
4. Generational collection focuses collection on younger object generations more frequently to improve efficiency.
Compiler Construction | Lecture 14 | InterpretersEelco Visser
油
This document summarizes a lecture on interpreters for programming languages. It discusses how operational semantics can be used to define the meaning of a program through state transitions in an interpreter. It provides examples of defining the semantics of a simple language using DynSem, a domain-specific language for specifying operational semantics. DynSem specifications can be compiled to interpreters that execute programs in the defined language.
Compiler Construction | Lecture 13 | Code GenerationEelco Visser
油
The document discusses code generation and optimization techniques, describing compilation schemas that define how language constructs are translated to target code patterns, and covers topics like ensuring correctness of generated code through type checking and verification of static constraints on the target format. It also provides examples of compilation schemas for Tiger language constructs like arithmetic expressions and control flow and discusses generating nested functions.
Compiler Construction | Lecture 12 | Virtual MachinesEelco Visser
油
The document discusses the architecture of the Java Virtual Machine (JVM). It describes how the JVM uses threads, a stack, heap, and method area. It explains JVM control flow through bytecode instructions like goto, and how the operand stack is used to perform operations and hold method arguments and return values.
Compiler Construction | Lecture 9 | Constraint ResolutionEelco Visser
油
This document provides an overview of constraint resolution in the context of a compiler construction lecture. It discusses unification, which is the basis for many type inference and constraint solving approaches. It also describes separating type checking into constraint generation and constraint solving, and introduces a constraint language that integrates name resolution into constraint resolution through scope graph constraints. Finally, it discusses papers on further developments with this approach, including addressing expressiveness and staging issues in type systems through the Statix DSL for defining type systems.
Compiler Construction | Lecture 8 | Type ConstraintsEelco Visser
油
This lecture covers type checking with constraints. It introduces the NaBL2 meta-language for writing type specifications as constraint generators that map a program to constraints. The constraints are then solved to determine if a program is well-typed. NaBL2 supports defining name binding and type structures through scope graphs and constraints over names, types, and scopes. Examples show type checking patterns in NaBL2 including variables, functions, records, and name spaces.
Compiler Construction | Lecture 7 | Type CheckingEelco Visser
油
This document summarizes a lecture on type checking. It discusses using constraints to separate the language-specific type checking rules from the language-independent solving algorithm. Constraint-based type checking collects constraints as it traverses the AST, then solves the constraints in any order. This allows type information to be learned gradually and avoids issues with computation order.
Compiler Construction | Lecture 6 | Introduction to Static AnalysisEelco Visser
油
Lecture introducing the need for static analysis in addition to parsing, the complications caused by names, and an introduction to name resolution with scope graphs
5. I will not use electronic devices such as
laptops, phones, or tablets during lectures.
Experimental exception: laptop for taking notes at last row
6. I will not enter the lecture hall
once the lecture has started.
7. My answers to assignments and exams will
be my own work (except for assignments
that explicitly permit collaboration).
http://en.wikipedia.org/wiki/File:Plagiarism_vs_Copyright_Infringement.png
8. I will not make solutions to assignments and
exams available to anyone else. This includes
both solutions written by me, as well as any
official solutions provided by the course staff.
http://ucblibraries.colorado.edu/about/images/Xerox5135.jpg
9. I will not engage in any other activities that
will dishonestly improve my results or
dishonestly improve/hurt the results of
others.
11. Course Grade
Your 鍖nal grade G for the course will be
computed as follows:
G = (E * 0.6) + (GA * 0.4)
where E is your grade for the exam an GA is
your grade for the graded assignments.
12. Graded Assignments
There will be four Graded Assignments.
For each you need to get at least a 4.0 to pass.
GA is the average of the four grades.
13. Exams
You can pass the exam in two ways:
Pass the midterm Q3 exam on April 9 with at least a
6.0 and then pass the Q4 exam on June 26 also with a
6.0. E is the average of two exams.
Pass the Q3+Q4 exam on June 26 with at least a 6.0
Pass the August resit with at least a 6.0
14. All assignments for this course are provided
via WebLab and should be submitted via
WebLab, including the exams.
15. Exam/Lab Grades from 2011-2012
Partial result from 2011-2012?
Discuss with me of鍖ine
(but not today)
16. Warning!
This course moves from 鍖rst year to
second year in new curriculum
TI1220 will not be taught in
2013-2014
Lab & exams will be repeated,
no lectures
My advice: pass the course this year!
18. Course Staff
Instructors
Eelco Visser Assistants
Jeff Smits
Vlad Vergu
Victor Spiridon
Tim de Jong
Bastiaan Reijm
http://eelcovisser.org/wiki/about/of鍖cehours
27. Turing Machines
Turing/Church Thesis: Every effective
computation can be carried out by a Turing
machine (IN2505)
Corollary: All (Turing Complete) programming
languages can express all effective computations
Why bother with new programming languages?
28. History of Programming Languages
History of Programming Languages
1954 1960 1965 1970 1975 1980 1985 1990 1995 2000 2001 2002 2003 2004
1986 1990 1990 1991 1991 1993 1994 1995 1996 1996 1997 1997 2000 2001 2001 2003 2003 2004
For more than half of the fifty years computer programmers have been This timeline includes fifty of the more than 2500 documented
writing code, OReilly has provided developers with comprehensive, programming languages. It is based on an original diagram created
www.oreilly.com
in-depth technical information. Weve kept pace with rapidly changing by ric L辿v辿nez (www.levenez.com), augmented with suggestions
technologies as new languages have emerged, developed, and from OReilly authors, friends, and conference attendees.
matured. Whether you want to learn something new or need
For information and discussion on this poster,
answers to tough technical questions, youll find what you need
go to www.oreilly.com/go/languageposter.
in OReilly books and on the OReilly Network.
息2004 OReilly Media, Inc. OReilly logo is a registered trademark of OReilly Media, Inc. All other trademarks are property of their respective owners. part#30417
This timeline includes 50 of the more than 2500 documented programming languages.
29. Programming Languages in TI @ TUD
TI1200: Object-Oriented Programming
Java
TI1400: Computer Systems
Assembly
TI1500: Web- and Database Technology
HTML, PHP, SQL, JavaScript
TI1600: Multi-Agent Systems
Prolog, GOAL
30. A programming language is low level when its
programs require attention to the irrelevant
Alan J. Perlis. Epigrams on Programming. SIGPLAN Notices, 17(9):7-13, 1982.
31. From Instructions to Expressions
mov &a, &c c = a
add &b, &c c += b
mov &a, &t1 t1 = a c = (a + b) & (a - b)
sub &b, &t1 t1 -= b
and &t1,&c c &= t1
Source: http://sites.google.com/site/arch1utep/home/course_outline/translating-complex-expressions-into-assembly-language-using-expression-trees
32. From Calling Conventions to Procedures
calc:
push eBP ; save old frame pointer
mov eBP,eSP ; get new frame pointer
sub eSP,localsize ; reserve place for locals
.
. ; perform calculations, leave result in AX
.
mov eSP,eBP ; free space for locals
pop eBP ; restore old frame pointer
ret paramsize ; free parameter space and return
push eAX ; pass some register result
push byte[eBP+20] ; pass some memory variable (FASM/TASM syntax)
push 3 ; pass some constant
call calc ; the returned result is now in eAX
http://en.wikipedia.org/wiki/Calling_convention
def f(x)={ ... } f(e1)
function de鍖nition and call in Scala
33. From Malloc to Garbage Collection
/* Allocate space for an array with ten elements of type int. */
int *ptr = (int*)malloc(10 * sizeof (int));
if (ptr == NULL) {
/* Memory could not be allocated, the program
should handle the error here as appropriate. */
} else {
/* Allocation succeeded. Do something. */
free(ptr); /* We are done with the int objects,
and free the associated pointer. */
ptr = NULL; /* The pointer must not be used again,
unless re-assigned to using malloc again. */
}
http://en.wikipedia.org/wiki/Malloc
int [] = new int[10];
/* use it; gc will clean up (hopefully) */
34. Linguistic Abstraction
design abstraction
language A language B
use new abstraction
identify pattern
35. Domains of Computation
Application domains
Systems programming
Embedded software
Web programming
Enterprise software
Database programming
...
36. Why So Many Programming Languages?
Linguistic abstraction: better
understanding of the general domain of
computation
Specialization to domain: different
requirements from different application
domains
37. Why Study Programming Languages?
Language shapes thought: understand the
languages that you are using
Choosing the right language for the job
Learning to learn new languages
Understanding implementation: whats
under the hood?
38. Topics in this Course
Syntax and Semantics
Names, Bindings, and Scopes
Storage
Data Types
Functional Programming
Type Systems 1: Polymorphism
Type Systems 2: Type Parameterization
Parsing and Interpretation
Control Abstraction
Data Abstraction / Modular Programming
Functional Programming Redux
Concurrency
Concurrent Programming
Domain-Speci鍖c Languages
41. Syntax
syntax |sintaks|
noun
the arrangement of words and phrases to create well-formed sentences in
a language: the syntax of English.
a set of rules for or an analysis of this: generative syntax.
the branch of linguistics that deals with this.
ORIGIN late 16th cent.: from French syntaxe, or via late Latin from
Greek suntaxis, from sun- together + tassein arrange.
42. Syntax
The syntax of a programming language is
the form of its expressions, statements,
and program units.
Sebesta Ch3
43. Lexical vs Context-free Syntax
lexical syntax
words made from letters
structure not relevant
regular expressions
context-free syntax
sentences made from words
structure relevant
context-free grammars
Backus-Naur Form
Extended Backus-Naur Form
44. Lexemes & Tokens
Lexemes are the words that make a sentences
Tokens are the categories of lexemes
52. Syntax in this Course
You should be able to determine whether a
program is syntactically correct according to a
context-free grammar (BNF, railroad diagram)
(There will be exercises on WebLab)
57. Semantics
semantics |smantiks|
pluralnoun [ usu. treated as sing. ]
the branch of linguistics and logic concerned with meaning. There are a
number of branches and subbranches of semantics, including formal
semantics, which studies the logical aspects of meaning, such as sense,
reference, implication, and logical form, lexical semantics, which studies
word meanings and word relations, and conceptual semantics, which
studies the cognitive structure of meaning.
the meaning of a word, phrase, sentence, or text: such quibbling over
semantics may seem petty stuff.
DERIVATIVES
semantician |smantiSHn|noun,
semanticist noun
58. Semantics
The semantics of a programming language
is the meaning of its expressions,
statements, and program units.
Sebesta Ch3
59. Static vs Dynamic Semantics
Static Semantics: (context-senstive)
restriction of the set of valid programs
Dynamic Semantics: run-time
behaviour of a program
60. Operational Semantics
Operational semantics: describe the
meaning of a statement or program by
specifying the effects of running it on a
machine
In second part of course (Q4): write
interpreter for small functional language
61. Denotational Semantics
a denotational semantics de鍖nes a mapping
from the syntactic domain to a semantic
domain of mathematical objects
<bin> -> 0 | 1 | <bin> 0 | <bin> 1
M(0) = 0
M(1) = 1
M(<bin> 0) = 2 * M(<bin>)
M(<bin> 1) = 2 * M(<bin>) + 1
63. Semantics in this Course
Informal operational semantics:
Reasoning about the operational behavior of
programs
Comparative/translational semantics:
Explaining the semantics of construct/concept
by translating it to another language
64. Reading & Programming in Week 1
Reading: Sebesta
Chapter 1: Preliminaries
Chapter 2: Evolution of the major
programming languages (read)
Chapter 3: Describing Syntax and
Semantics
WebLab: Scala Tutorial
Week 2: Names, Bindings, and Scope (Chapter 5)