implementation of programming languages€¦ · intro •implement a software artifact according to...
TRANSCRIPT
![Page 1: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/1.jpg)
Implementation of Programming Languages
Guido Salvaneschi
Jurgen Van Ham
![Page 2: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/2.jpg)
Outline
• Administrivia
• Intro
• Schedule
• Topics
![Page 3: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/3.jpg)
GENERAL INFORMATION
![Page 4: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/4.jpg)
Administrivia
• Guido Salvaneschi, Jurgen van Ham
– Find us by email
– Office A213 / A207
– Group of Prof. Mira Mezini (STG)
![Page 5: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/5.jpg)
Intro
• Implement a software artifact according to a given specification.
• General scope: programming languages:
– Extensions, code generators
– Tools, IDEs
– Analysis techniques
– Performance assessments
– Prototypes with innovative abstractions
![Page 6: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/6.jpg)
Timeline
• Periodic discussions/meetings.
• Presentation and delivery of the artifact and the documentation: end of the semester.
![Page 7: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/7.jpg)
Guidelines and Suggestions
• Depending on the goal of the project
• In general:
– Deliver RUNNING code
– Deliver some documentation
– Optional: final presentation / demo to discuss your work
• Teamworking is good!
– Organize a team even with people you don’t know (yet)
![Page 8: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/8.jpg)
Grades
• Depending on the project
• Some guidelines:
– How much of the specification was implemented?
– Is the code working (the answer is YESOFCOURSE)
– What is the overall quality of the code?• E.g. is it painful to modify/extend it ?
• Is it self-documenting ?
– What is the quality of the documentation ?
![Page 9: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/9.jpg)
Where to start
• Send me an email with your name and a list of 3 topics in order of preference.
• Or arrange an appointment:
– Ask clarifications if needed
– Discuss possible customizations
– Discuss the projects in more detail
– Consider your programming skills
• Topics will be assigned
• Discuss the project in detail with the instructor
![Page 10: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/10.jpg)
Getting Widespread…
• Reactive programming in JavaScript– Flapjax, Bacon.js, Reactive.js, React.js, …
• Microsoft reactive extensions (Rx)
• REScala– www.rescala-lang.com
• Principles of Reactive Programming– Martin Odersky, Erik Meijer and Roland Kuhn
– https://www.coursera.org/course/reactive
![Page 11: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/11.jpg)
RP in a Nutshell
• Reactivity in OO apps: Observer pattern
• In RP you can define constraints
– The framework enforces them for you
– Changes are automatically propagated
VIEWX Y Z
DATAX Y Z
val a = 3val b = 7val c := a + bval d := 2 * ca=4 println(c) // c==11 a b
c
d
![Page 12: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/12.jpg)
TOPICS
![Page 13: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/13.jpg)
Collection of examples for RP
• Create a suite of examples that cover the basics of reactive programming
• (Small!) Simulations
• Graphical interfaces
Enter a 3 character string:<input id="textField1"
style={! {borderColor: (extractValueB('textField1').length === 3 ? 'green' : 'red')}
!}/>
![Page 14: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/14.jpg)
Scala Interface for Distributed RP
• DREAM: Distributed REActive PrograMming
• Provide a Scala reactive interface for DREAM !
– Analysis of Signal expressions
– Binding with remote objects
val a = Signal{ a() + b() }
Remote<Int> a = new Remote(“a + b”) DREAM
RESCALA
![Page 15: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/15.jpg)
Case study for Join Languages
• Joins make concurrency easier!
– Wait for the second event
• Several proposals
– Polyphonic C# (Microsoft)
– Scala Joins
– JoCaml
• Evaluate this solution with a case study
![Page 16: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/16.jpg)
Case study on efficient reactive programming
• Example from Simulink/Labview
• Implement the example using RP
• Compare performance and expressivity
![Page 17: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/17.jpg)
RP in Java - DREAM
• Java 8 (finally!) has lambdas
• Extend Java to support signals and RP
– Polyglot/JustAdd extensible compilers
– Functional flavor + reactivity
Stream<Student> map = persons.stream().filter(p -> p.getAge() > 18).map(person -> new Student(person));
people.stream().
filter(p -> p.getGender() == Person.Gender.FEMALE).mapToInt(p -> p.getSalary()).
sum();
select sum(salary)from people
where gender = 'FEMALE'
SQL JAVA 8
![Page 18: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/18.jpg)
Twitter Client
• Develop a simple twitter client with reactive programming
– Simple GUI
– Reactive abstractions• XML parsing
• Network communication
• User interaction
• Evaluate the use of reactive abstractions in the project
• Just an example, other case studies are possible
![Page 19: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/19.jpg)
Session types in Scala
• Session types support static check of protocols correctness
• Steps
– Study session types
– Reuse existing library
– Small case study
![Page 20: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/20.jpg)
Reactive Programming and OO Languages
• Reactive programming has been developed in the functional programming community
– How reactive abstractions, e.g. signals, behaviors, …, interact with OO features ?
• Develop a set of small examples/studies that investigate reactive programming in the OO domain
– Encapsulation
– Inheritance
– Information hiding
– ..
![Page 21: Implementation of Programming Languages€¦ · Intro •Implement a software artifact according to a given specification. •General scope: programming languages: –Extensions,](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec97be90b155a264d70ee28/html5/thumbnails/21.jpg)
QUESTIONS?