23 November 2007RCEAS 2007, Budapest1 Embedded Functional Programming Gergely Patai Budapest University of Technology and Economics Department.

Slides:



Advertisements
Similar presentations
Sml2java a source to source translator Justin Koser, Haakon Larsen, Jeffrey Vaughan PLI 2003 DP-COOL.
Advertisements

15 February 2007IASTED Software Engineering 2007, Innsbruck1 Embedded Functional Programming in Hume Gergely Patai Péter Hanák
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
P ROGRAMMING L ANGUAGES : C ONTROL 1. S LIDES R EFERENCES Kenneth C. Louden, Control I: Expressions and Statements: Principles and Practice. 2.
INF 212 ANALYSIS OF PROG. LANGS Type Systems Instructors: Crista Lopes Copyright © Instructors.
CS 355 – Programming Languages
Functional Design and Programming Lecture 1: Functional modeling, design and programming.
High-Level Programming Languages
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
Review of “Embedded Software” by E.A. Lee Katherine Barrow Vladimir Jakobac.
Memory Management 2010.
Chapter 8 High-Level Programming Languages Nell Dale John Lewis.
Programming Language Theory Leif Grönqvist The national Graduate School of Language Technology (GSLT) MSI.
Communication in Distributed Systems –Part 2
Chapter 9 Introduction to Procedures Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering İstanbul -
A Mystery Esterel –small no type inference, subtyping, … no recursion, functions, … no pointers, malloc, GC, … no complex data structures, libraries,
Interlude: Functional Programming CSE 331 Section 2 James Daly.
Overview. Copyright © 2006 The McGraw-Hill Companies, Inc. Chapter 1 Overview A good programming language is a conceptual universe for thinking about.
Computer Architecture Computational Models Ola Flygt V ä xj ö University
G Programming Languages T he main themes of programming language design and use: –Model of computation –Expressiveness types and their operations.
ICOM 5995: Performance Instrumentation and Visualization for High Performance Computer Systems Lecture 7 October 16, 2002 Nayda G. Santiago.
Speaking Bluntly about SharpHDL: Some Old Stuff and Some Other Proposed Future Extensions Gordon J. Pace & Christine Vella Synchron’05 Malta, November.
CS 363 Comparative Programming Languages
Types for Programs and Proofs Lecture 1. What are types? int, float, char, …, arrays types of procedures, functions, references, records, objects,...
CS533 Concepts of Operating Systems Jonathan Walpole.
Putting it all together: LINQ as an Example. The Problem: SQL in Code Programs often connect to database servers. Database servers only “speak” SQL. Programs.
1 Functional Programming In Text: Chapter Chapter 2: Evolution of the Major Programming Languages Outline Functional programming (FP) basics A bit.
Functional Programming a (very) short introduction Ben Couste 06/10/2010.
1 Efficient Type and Memory Safety for Tiny Embedded Systems John Regehr Nathan Cooprider Will Archer Eric Eide University of Utah School of Computing.
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Functional Programming Think Differently!! Functional languages are expressive, accomplishing tasks using short, succinct and readable code. Functional.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Compiling Functional Programs Mooly Sagiv Chapter 7
CS 345: Programming Language Paradigms Chris Brooks HR 510 MWF 11:00-12:05.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
TIVDM2Functional Programming Language Concepts 1 Concepts from Functional Programming Languages Peter Gorm Larsen.
COMP313A Functional Programming (1)
1 Alex Proctor and Brian Lee for CSCI 431 at UNCA, Fall 2002 ML (Meta Language) a brief introduction Alex Proctor and Brian Lee For CSCI 431 at the University.
Chapter 8 High-Level Programming Languages. 2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Xiong Junjie Node-level debugging based on finite state machine in wireless sensor networks.
Gedae, Inc. Gedae: Auto Coding to a Virtual Machine Authors: William I. Lundgren, Kerry B. Barnes, James W. Steed HPEC 2004.
1-1 An Introduction to Functional Programming Sept
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
Functional Programming IN NON-FUNCTIONAL LANGUAGES.
C H A P T E R T H R E E Type Systems and Semantics Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Haskell Introduction CSCE 314 Spring CSCE 314 – Programming Studio Historical Background 1930s: Alonzo Church develops the lambda calculus, a simple.
Copyright © 2009 Elsevier Chapter 6:: Control Flow Programming Language Pragmatics Michael L. Scott.
Programming Language Theory 2014, 1 Chapter 1 :: Introduction Origin : Michael L. Scott School of Computer & Information Engineering,
© Kenneth C. Louden, Chapter 7 - Control I: Expressions and Statements Programming Languages: Principles and Practice, 2nd Ed. Kenneth C. Louden.
Language Paradigms CS655.
Programming Languages 2nd edition Tucker and Noonan
Functional Programming
COSC 5V90 Functional Programming and Interactive Theorem Proving
Types for Programs and Proofs
“Language Mechanism for Synchronization”
Functional Programming
New trends in parallel computing
Introduction to Functional Programming Course Summary and Future
Control Flow Chapter 6.
Programming Languages
Programming Languages 2nd edition Tucker and Noonan
강의 내용 및 방법 접근방법 리포트 시험 Lambda Calculus, Proof of Correctness
School of Computer & Information Engineering,
Functional Programming and Haskell
Presentation transcript:

23 November 2007RCEAS 2007, Budapest1 Embedded Functional Programming Gergely Patai Budapest University of Technology and Economics Department of Control Engineering and Information Technology

23 November 2007RCEAS 2007, Budapest2 Outline  Functional programming in a nutshell  Motivation: desirable properties  Reasons of neglect  Real-life examples in embedded systems development  Further directions

23 November 2007RCEAS 2007, Budapest3 Functional programming  Declarative programming paradigm  Programs defined as series of equations  Typical characteristics:  Lack of side effects (a.k.a. ‘purity’)  Strong, static typing and type inference  Succinctness  Some languages: Haskell, ML family, Scheme, Clean, F#

23 November 2007RCEAS 2007, Budapest4 FP properties: purity  Referential transparency  Function return values depend only on the explicit arguments, not the context  Context-free expressions: easier testing and debugging, richer static analysis possible  No variables  Comparatively little state space  Safe concurrency  Loops expressed with recursion  I/O clearly separated from logic

23 November 2007RCEAS 2007, Budapest5 FP properties: type system  Strong typing  Protection against misinterpreting data  Type inference  Types don’t need to be specified explicitly  Every subexpression has a well-defined type  Inconsistencies detected at compile time

23 November 2007RCEAS 2007, Budapest6 FP properties: succinctness  Typically little boilerplate  Code/structure reuse possible at a small level of granularity  Loops are often abstracted away  In general shorter by a factor of two to ten

23 November 2007RCEAS 2007, Budapest7 Why is it not widely used?  FP originates around 1960 with LISP  Too resource intensive for that time (garbage collection, reflection…)  Imperative languages pervaded the industry  Programmers got used to thinking imperatively

23 November 2007RCEAS 2007, Budapest8 Is it really not used?  Modern languages keep adopting features of functional languages  Managed memory  Type inference  Lambda expressions (unnamed functions)  Why not adopt the whole paradigm?

23 November 2007RCEAS 2007, Budapest9 Example: Lava  Haskell library to aid hardware design  Generating VHDL code from functional description  Mary Sheeran: Hardware Design and Functional Programming: a Perfect Match

23 November 2007RCEAS 2007, Budapest10 Example: Erlang  Concurrent functional language  Asynchronous IPC (message passing)  Fault tolerance mechanism  Hotswap support 

23 November 2007RCEAS 2007, Budapest11 Example: Lustre  Synchronous dataflow language, a declarative relative of Esterel  Used in commercial safety critical products (mostly avionics) since 1993 

23 November 2007RCEAS 2007, Budapest12 Example: Hume  Experimental language, still developing  Programs: boxes connected with wires  Wires: persistent state, one input and one output each  Boxes: buffered combination networks  Compile-time resource limit guarantees  Execution: VM, native code (C), FPGA  

23 November 2007RCEAS 2007, Budapest13 Where to go from here?  Functional languages viable in a wide range of applications  An underrated (or just unknown) paradigm  Our ongoing experiments:  Hume on embedded platforms (Tmote Sky, Mindstorms NXT, mitmót)  Haskell on the desktop for remote controlling robots  What about you?

23 November 2007RCEAS 2007, Budapest14 Thank you for your attention!