Sheng Liang Paul Hudak Mark Jonest Yale University Department Of

Total Page:16

File Type:pdf, Size:1020Kb

Sheng Liang Paul Hudak Mark Jonest Yale University Department Of Monad Transformers and Modular Interpreters* Sheng Liang Paul Hudak Mark Jonest Yale University Department of Computer Science New Haven, CT 06520-8285 {li-ang, hudak, j ones -mark}@cs. yale. edu Abstract a specific feature. The interpreter writer is able to specify the set of incorporated features at a very high level. We show howa set of building blocks can be used to construct The motivation for building modular interpreters is to programming language interpreters, and present implemen- isolate the semantics of individual programming language tations of such building blocks capable of supporting many features for the purpose of better understanding, simplifying, commonly known features, including simple expressions, and implementing the features and their interactions. The three different function call mechanisms (call-by-name, call- lack of separability of traditional denotational semantics [19] by-value and lazy evaluation), references and assignment, has long been recognized. Algebraic approaches such as nondeterminism, first-class continuations, and program trac- Mosses’ action semantics [16], and related efforts by Lee ing. [131, Wand [231, Appel & Jim [11, Kelsey & Hudak [111, and The underlying mechanism of our system is monad frans- others, attempt to solve parts of this problem, but fall short fonners, a simple form of abstraction for introducing a wide in several crucial ways} range of computational behaviors, such as state, 1/0, con- A ground-b~aking attempt to better solve the overall tinuations, and exceptions. problem began with Moggi’s [151 proposal to use monads to Our work is significant in the following respects. First, structtue denotational semantics. Wadler [211 popularized we have succeeded in designing a fully modular interpreter Moggi’s ideas in the functional programming community based on monad transformers that includes features miss- by showing that many type constructors (such as List) were ing from Steele’s, Espinosa’s, and Wadler’s earlier efforts. monads and how monads could be used in a variety of Second, we have found new ways to lift monad operations settings, many with an “imperative” feel (such as in Peyton through monad transformers, in particular difficult cases not Jones & Wadler [17]). Wadler’s interpreter design, however, achieved in Moggi’s original work. Third, we have demon- treats the interpreter monad as a monolithic structure which strated that interactions between features are reflected in has to be reconstructed every time a new feature is added. liftings and that semantics can be changed by reordering More recently Steele [181 proposed pseudomonadesas a way monad transformers. Finally, we have implemented our to compose monads and thus build up an interpreter from interpreter in Gofer, whose constructor classes provide just smaller parts, but he failed to properly incorporate important the added power over Haskell’s type classes to allow precise features such as an environment and store, and struggled and convenient expression of our ideas. This implementa- with restrictions in the Haskell [71 type system when trying tion includes a method for constructing extensible unions to implement his ideas. In fact, pseudomonades are really and a form of subtyping that is interesting in its own right. just a special kind of monad transformer, first suggested by Moggi [15] as a potential way to leave a “hole” in a monad 1 Introduction and Related Work for further extension. Returning to Moggi’s original ideas, Espinosa [4] nicely This paper discusses how to construct programming lan- formulated in Scheme a system called Semantic Lego — the guage interpreters out of modular components. We will first modular interpreter based on monad transformers — show how an interpreter for a language with many features and laid out the issues in lifting. Espinosa’s work reminded can be composed from building blocks, each implementing the programming language community (including us) — who had become distracted by the use of monads — that ●This work was supported by the Advanced ResearchProject Agency Moggi himself, responsible in many ways for the interest in and the Oi%ce of Naval Research under Arpa Order 8888, Contract monadic programming, had actually focussed more on the NOO014-92-C-0153. TCurrent addresa: Department of Computer science, uIIiVWSity Of importance of monad transformers. Nottingham, University Park, Nottingham NG7 2RD, England. Email: We begin by realizing the limitations of Moggi’s frame- mpj@cs. nott .ac. uk. work and Espinosa’s implementation, in particular the diffi- culty in dealing with complicated operations such as callcc, Permission to copy without fee all or part of this materfal is and investigate how common programming language fea- granted provided that the copies are not made or distributed for direct commercial advantage, the ACM copyrigM notice and the lVery recently, CartWright and Felleisen [31have independently proposed title of the publication and its date appear, and notice is given a modular semantics emphasizing a di?ectsemantics approach, which seems that oopying is by permission of the Association of CompW”ng somewhat more complex than ours; the pxecise dationship between the Machinery. To copy otherwise, or to republish, requires a fee appm=hes is, however, not yet clear. and/or specific permission. POPL ’951/95 San Francisco CA USA 0 1995 ACM 0-89791 -692-1/95/0001 ....$3.50 333 type Term = OR TermA -- arithmetic type lnterpM = StateT Store - - memory cells ( OR TermF -- functions ( EnvT Env - - environment ( OR TwmR -- assignment ( ConfT Answer -- continuations ( OR TermL -- lazy evaluation ( StateT String J - trace output ( OR TermT -- tracing ( ErrorT ( OR TermC -- callcc List ll~~i~~~~& TermN -- nondeterminism )))) ))))) type Value = OR Int (OR Fun ()) I Figure 1: A modular interpreter tures interact with each other. In so doing we are able to expressions, etc. T~e constructors such as SfateT and ConfT express more modularity and more language features than in are monad fransfor m$rs; they add features, and are used to previous work, solving several open problems that arose not transform the mona Listinto the monad InterpM used by only in Moggi’s work, but in Steele’s and Espinosa’s as well. the interpreter, 1 Our work also shares results with Jones and Duponcheel’s To see how Term, alue, and InterpM constitute to modular [101 work on composing monads. interpreters, in the rext section we will walk through some Independently Espinosa [51 has continued working on simple examples. monad transformers, and has also recognized the limitations of earlier approaches and proposed a solution quite different 2 An Example from ours. His new approach relies on a notion of “higher- order” monads (called situated monads) to relate different A conventional inte preter maps, say a term, environment, layers of monad transformers, and he has investigated the and store, to an ansI er. In contrast, a monadic interpreter semantic implications of the order of monad transformer such as ours maps t~rms to computations, where the details composition. It is not yet clear how his new approach relates of the environment, tore, etc. are “hidden”. Specifically: to ours. We use Gofer [81 syntax, which is very similar to Haskell’s, interp :; Term + nferpM Value throughout the paper. We choose Gofer over Haskellbecause where “hzterpM Vu /ue” is the interpreter monad of final of its extended type system, and we choose a functional answers. language over mathematical syntax for three reasons: (1) What makes ou interpreter modular is that all three it is just about as concise as mathematical syntax,2 (2) components above —1 the term type, the value type, and the it emphasizes the fact that our ideas are implementable monad — are config rable. To illustrate, if we initially wish (and thus have been debugged!), and (3) it shows how the to have an interpret r for a small arithmetic language, we I relatively new idea of constructor ckzsses [9] can be used can fill in the definitions as follows: to represent some rather complex typing relationships. Of /3RInt () course, monads can be expressed in a variety of other type Value = (higher-order) programming languages, in particular SML type T~m ermA rrorT Id [141, whose type system is equally capable of expressing type InterpM z some of our ideas. The system could also be expressed The first line declar i s the answer domain to be the union in Scheme, but of course we would then lose the benefits of integers and the ~nit type (used as the base type). The of strong static type-checking. Our Gofer source code is second line defines 4erms as TermA, the abstract syntax for available via anonymous ftp from nebuZa.cs.yaZe.eduin the arithmetic operation . The final line defines the interpreter directory pub/yak- fi/modular-inferpre fer. monad as a transfo ation of the identify monad Id. The To appreciate the extent of our results, Figure 1 gives the monad transformer ErrorT accounts for the possibility of high-level definition of an interpreter, which is constructed errors; in this case, a~ “thmetic exceptions. in a modular way, and supports arithmetic, three different At this point the interpreter behaves like a calculator: 3 kinds of functions (call-by-name, call-by-value, and lazy), references and assignment, nondeterminism, first-class con- > ((1+4)*8) tinuations, and tracing. The rest of the paper will provide 40 the details of how the type declarations expand into a full > (3/0) interpreter and how each component is built. For now just ERROR: divide by O note that OR is equivalent to the domain sum operator, and Now if we wish o add function calls, we can extend the Term, Value and InterpM denote the source-level terms, run- value domain with 1 nction types, add the abstract syntax time values, and supporting features (which can be regarded for function calls to the term type, and apply the monad as the run-time system), respectively.
Recommended publications
  • The Power of Higher-Order Composition Languages in System Design
    The Power of Higher-Order Composition Languages in System Design James Adam Cataldo Electrical Engineering and Computer Sciences University of California at Berkeley Technical Report No. UCB/EECS-2006-189 http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-189.html December 18, 2006 Copyright © 2006, by the author(s). All rights reserved. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission. The Power of Higher-Order Composition Languages in System Design by James Adam Cataldo B.S. (Washington University in St. Louis) 2001 M.S. (University of California, Berkeley) 2003 A dissertation submitted in partial satisfaction of the requirements for the degree of Doctor of Philosophy in Electrical Engineering in the GRADUATE DIVISION of the UNIVERSITY OF CALIFORNIA, BERKELEY Committee in charge: Professor Edward Lee, Chair Professor Alberto Sangiovanni-Vincentelli Professor Raja Sengupta Fall 2006 The dissertation of James Adam Cataldo is approved: Chair Date Date Date University of California, Berkeley Fall 2006 The Power of Higher-Order Composition Languages in System Design Copyright 2006 by James Adam Cataldo 1 Abstract The Power of Higher-Order Composition Languages in System Design by James Adam Cataldo Doctor of Philosophy in Electrical Engineering University of California, Berkeley Professor Edward Lee, Chair This dissertation shows the power of higher-order composition languages in system design.
    [Show full text]
  • Notes on Functional Programming with Haskell
    Notes on Functional Programming with Haskell H. Conrad Cunningham [email protected] Multiparadigm Software Architecture Group Department of Computer and Information Science University of Mississippi 201 Weir Hall University, Mississippi 38677 USA Fall Semester 2014 Copyright c 1994, 1995, 1997, 2003, 2007, 2010, 2014 by H. Conrad Cunningham Permission to copy and use this document for educational or research purposes of a non-commercial nature is hereby granted provided that this copyright notice is retained on all copies. All other rights are reserved by the author. H. Conrad Cunningham, D.Sc. Professor and Chair Department of Computer and Information Science University of Mississippi 201 Weir Hall University, Mississippi 38677 USA [email protected] PREFACE TO 1995 EDITION I wrote this set of lecture notes for use in the course Functional Programming (CSCI 555) that I teach in the Department of Computer and Information Science at the Uni- versity of Mississippi. The course is open to advanced undergraduates and beginning graduate students. The first version of these notes were written as a part of my preparation for the fall semester 1993 offering of the course. This version reflects some restructuring and revision done for the fall 1994 offering of the course|or after completion of the class. For these classes, I used the following resources: Textbook { Richard Bird and Philip Wadler. Introduction to Functional Program- ming, Prentice Hall International, 1988 [2]. These notes more or less cover the material from chapters 1 through 6 plus selected material from chapters 7 through 9. Software { Gofer interpreter version 2.30 (2.28 in 1993) written by Mark P.
    [Show full text]
  • The Haskell School of Expression: Learning Functional Programming Through Multimedia
    The Haskell School of Expression: Learning Functional Programming through Multimedia The Haskell School of Expression: Learning Functional Programming through Multimedia - 2000 - Cambridge University Press, 2000 - 1107268656, 9781107268654 - Paul Hudak Functional programming is a style of programming that emphasizes the use of functions (in contrast to object-oriented programming, which emphasizes the use of objects). It has become popular in recent years because of its simplicity, conciseness, and clarity. This book teaches functional programming as a way of thinking and problem solving, using Haskell, the most popular purely functional language. Rather than using the conventional (boring) mathematical examples commonly found in other programming language textbooks, the author uses examples drawn from multimedia applications, including graphics, animation, and computer music, thus rewarding the reader with working programs for inherently more interesting applications. Aimed at both beginning and advanced programmers, this tutorial begins with a gentle introduction to functional programming and moves rapidly on to more advanced topics. Details about progamming in Haskell are presented in boxes throughout the text so they can be easily found and referred to. DOWNLOAD FILE HERE: http://resourceid.org/2fjqbSK.pdf Practical Aspects of Declarative Languages - Paul Hudak, David S. Warren - 10th International Symposium, PADL 2008, San Francisco, CA, USA, January 7-8, 2008, Proceedings - This book, complete with online files and updates, covers a hugely important area of study in computing. It constitutes the refereed proceedings of the 10th International - ISBN:9783540774419 - Computers - Dec 18, 2007 - 342 pages DOWNLOAD FILE HERE: http://resourceid.org/2fjj64I.pdf Advanced Functional Programming - First International Spring School on Advanced Functional Programming Techniques, Bastad, Sweden, May 24 - 30, 1995.
    [Show full text]
  • Modeling User Interfaces in a Functional Language
    Abstract Modeling User Interfaces in a Functional Language Antony Alexander Courtney 2004 It is widely recognized that programs with Graphical User Interfaces (GUIs) are difficult to design and implement. One possible reason for this difficulty is the lack of any clear formal basis for GUI programming. GUI toolkit libraries are typically described only informally, in terms of implementation artifacts such as objects, imperative state and I/O systems. In this thesis, we develop Fruit, a Functional Reactive User Interface Toolkit. Fruit is based on Yampa, an adaptation of Functional Reactive Programming (FRP) to the Arrows computational framework. Yampa has a clear, simple formal se- mantics based on a synchronous dataflow model of computation. GUIs in Fruit are defined compositionally using only the Yampa model and formally tractable mouse, keyboard and picture types. Fruit and Yampa have been implemented as libraries for Haskell, a purely functional programming language. This thesis presents the semantics and implementations of Yampa and Fruit, and shows how they can be used to write concise executable specifications of com- mon GUI programming idioms and complete GUI programs. Modeling User Interfaces in a Functional Language A Dissertation Presented to the Faculty of the Graduate School of Yale University in Candidacy for the Degree of Doctor of Philosophy by Antony Alexander Courtney Dissertation Director: Professor Paul Hudak May 2004 Copyright c 2004 by Antony Alexander Courtney All rights reserved. ii Contents Acknowledgments ix 1 Introduction 1 1.1 Background and Motivation . ...................... 1 1.2 Dissertation Overview . ...................... 4 I Foundations 5 2 Yampa: A Synchronous Dataflow Language Embedded in Haskell 6 2.1 Concepts .
    [Show full text]
  • Haskell Communities and Activities Report
    Haskell Communities and Activities Report http://www.haskell.org/communities/ Sixteenth Edition — May 2009 Janis Voigtländer (ed.) Peter Achten Andy Adams-Moran Lloyd Allison Tiago Miguel Laureano Alves Krasimir Angelov Heinrich Apfelmus Emil Axelsson Arthur Baars Justin Bailey Alistair Bayley Jean-Philippe Bernardy Clifford Beshers Gwern Branwen Joachim Breitner Niklas Broberg Björn Buckwalter Denis Bueno Andrew Butterfield Roman Cheplyaka Olaf Chitil Jan Christiansen Sterling Clover Alberto Gómez Corona Duncan Coutts Jácome Cunha Nils Anders Danielsson Atze Dijkstra Robert Dockins Chris Eidhof Conal Elliott Henrique Ferreiro García Marc Fontaine Nicolas Frisby Peter Gavin Patai Gergely Brett G. Giles Andy Gill George Giorgidze Dimitry Golubovsky Daniel Gorin Jurriaan Hage Bastiaan Heeren Claude Heiland-Allen Aycan Irican Judah Jacobson Jan Martin Jansen Wolfgang Jeltsch Florian Haftmann Kevin Hammond Enzo Haussecker Christopher Lane Hinson Guillaume Hoffmann Martin Hofmann Creighton Hogg Csaba Hruska Liyang HU Paul Hudak Graham Hutton Farid Karimipour Garrin Kimmell Oleg Kiselyov Lennart Kolmodin Slawomir Kolodynski Michal Konečný Eric Kow Stephen Lavelle Sean Leather Huiqing Li Bas Lijnse Ben Lippmeier Andres Löh Rita Loogen Ian Lynagh John MacFarlane Christian Maeder José Pedro Magalhães Ketil Malde Blažević Mario Simon Marlow Michael Marte Bart Massey Simon Michael Arie Middelkoop Ivan Lazar Miljenovic Neil Mitchell Maarten de Mol Dino Morelli Matthew Naylor Rishiyur Nikhil Thomas van Noort Johan Nordlander Jeremy O’Donoghue Patrick O.
    [Show full text]
  • A Case for Generative Programming and Dsls in Performance Critical Systems
    Go Meta! A Case for Generative Programming and DSLs in Performance Critical Systems Tiark Rompf1, Kevin J. Brown2, HyoukJoong Lee2, Arvind K. Sujeeth2, Manohar Jonnalagedda4, Nada Amin4, Georg Ofenbeck5, Alen Stojanov5, Yannis Klonatos3, Mohammad Dashti3, Christoph Koch3, Markus Püschel5, and Kunle Olukotun2 1 Purdue University, USA {first}@purdue.edu 2 Stanford University, USA {kjbrown,hyouklee,asujeeth,kunle}@stanford.edu 3 EPFL DATA, Switzerland {first.last}@epfl.ch 4 EPFL LAMP, Switzerland {first.last}@epfl.ch 5 ETH Zurich, Switzerland {ofgeorg,astojanov,pueschel}@inf.ethz.ch Abstract Most performance critical software is developed using very low-level techniques. We argue that this needs to change, and that generative programming is an effective avenue to enable the use of high-level languages and programming techniques in many such circumstances. 1998 ACM Subject Classification D.1 Programming Techniques Keywords and phrases Performance, Generative Programming, Staging, DSLs Digital Object Identifier 10.4230/LIPIcs.xxx.yyy.p 1 The Cost of Performance Performance critical software is almost always developed in C and sometimes even in assem- bly. While implementations of high-level languages have come a long way, programmers do not trust them to deliver the same reliable performance. This is bad, because low-level code in unsafe languages attracts security vulnerabilities and development is far less agile and productive. It also means that PL advances are mostly lost on programmers operating un- der tight performance constraints. Furthermore, in the age of heterogeneous architectures, “big data” workloads and cloud computing, a single hand-optimized C codebase no longer provides the best, or even good, performance across different target platforms with diverse programming models (multi-core, clusters, NUMA, GPU, ...).
    [Show full text]
  • Philip Wadler
    Philip Wadler School of Informatics, University of Edinburgh 10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND [email protected] http://homepages.inf.ed.ac.uk/wadler/ +44 131 650 5174 (W), +44 7976 507 543 (M) Citizen of United States and United Kingdom. Born: 1956 Father of Adam and Leora Wadler. Separated from Catherine Lyons. 1 Education 1984. Ph.D., Computer Science, Carnegie-Mellon University. Dissertation title: Listlessness is Better than Laziness. Supervisor: Nico Habermann. Committee: James Morris, Guy Steele, Bill Scherlis. 1979. M.S., Computer Science, Carnegie-Mellon University. 1977. B.S., Mathematics, with honors, Phi Beta Kappa, Stanford University. Awards National Science Foundation Fellow, three year graduate fellowship. 1975 ACM Forsythe Student Paper Competition, first place. 2 Employment 2003{present. Edinburgh University. Professor of Theoretical Computer Science. 2017{present. IOHK. Senior Research Fellow, Area Leader Programming Languages. 1999{2003. Avaya Labs. Member of Technical Staff. 1996{1999. Bell Labs, Lucent Technologies. Member of Technical Staff. 1987{1996. University of Glasgow. Lecturer, 1987{90; Reader, 1990{93; Professor, 1993{96. 1983{1987. Programming Research Group and St. Cross College, Oxford. Visiting Research Fellow and ICL Research Fellow. Awards Most Influential POPL Paper Award 2003 (for 1993) for Imperative Functional Programming by Simon Peyton Jones and Philip Wadler. Royal Society Wolfson Research Merit Award, 2004{2009. Fellow, Royal Society of Edinburgh, 2005{. Fellow, Association for Computing Machinery, 2007{. EUSA Teaching Awards, Overall High Performer, runner up, 2009. 1 3 Research overview Hybrid trees yield the most robust fruit. My research in programming languages spans theory and practice, using each to fertilize the other.
    [Show full text]
  • Course Information
    CS 591/491 Advanced Programming Techniques, Spring 2009 1 Preliminary version of 20 January Course Information Meetings Tuesdays and Thursdays, 2:00–3:15, in FEC345. Instructor Darko Stefanovic, office hours Tuesdays and Thursdays, 3:20–4:00 in ECE 236C. Course topics and format A seminar with readings and presentations on selected topics in typeful functional programming. Read- ings range from classics to current research, but emphasis is on tutorial articles on programming tech- niques, principally from the summer schools on advanced functional programming. Reading List / Lecture Plan This is a preliminary list of topics, which will be adjusted to reflect the interests of course participants. The pace will be adjusted as well; we may take more than one class period per paper if the discussion shows this is necessary. The sequence proposed below allows dropping the tail. I expect, however, that we will definitely cover topics 1–15. Any dropped topics will be covered in a seminar next year. Presenter name shown in italics. Week 1-2: Introduction 1 organizational; Haskell in brief [IFPH, Ch1-5; H9] Stefanovic 2 functional programming [H4] [T1] Stefanovic 3 trees with folds, binary heap trees, rose trees [IFPH, Ch6] Stefanovic Week 3: Efficiency 4 lazy evaluation, accumulating parameters, tupling [IFPH, Ch7] 5 fusion and deforestation [IFPH, Ch7] Week 4-6: Data structures 6 amortization; queues and splay heaps [O1] 7 red-black trees [O6] 8 more heap trees [O7] 9 tree traversal [O3] 10 tree access [H1] CS 591/491 Advanced Programming Techniques,
    [Show full text]
  • Haskell Communities and Activities Report
    Haskell Communities and Activities Report http://tinyurl.com/haskcar Twenty-Third Edition — November 2012 Janis Voigtländer (ed.) Andreas Abel Heinrich Apfelmus Emil Axelsson Doug Beardsley Jean-Philippe Bernardy Jeroen Bransen Gwern Branwen Joachim Breitner Björn Buckwalter Erik de Castro Lopo Olaf Chitil Duncan Coutts Jason Dagit Nils Anders Danielsson Romain Demeyer Daniel Díaz Atze Dijkstra Adam Drake Sebastian Erdweg Ben Gamari Andy Georges Patai Gergely Brett G. Giles Andy Gill George Giorgidze Torsten Grust Jurriaan Hage Bastiaan Heeren Mike Izbicki PÁLI Gábor János Guillaume Hoffmann Csaba Hruska Paul Hudak Oleg Kiselyov Michal Konečný Eric Kow Ben Lippmeier Andres Löh Hans-Wolfgang Loidl Rita Loogen Ian Lynagh Christian Maeder José Pedro Magalhães Ketil Malde Antonio Mamani Simon Marlow Dino Morelli JP Moresmau Ben Moseley Takayuki Muranushi Jürgen Nicklisch-Franken Tom Nielsen Rishiyur Nikhil Jens Petersen David Sabel Uwe Schmidt Martijn Schrage Tom Schrijvers Andrew G. Seniuk Jeremy Shaw Christian Höner zu Siederdissen Michael Snoyman Doaitse Swierstra Henning Thielemann Sergei Trofimovich Bernhard Urban Marcos Viera Janis Voigtländer Daniel Wagner Greg Weber Kazu Yamamoto Edward Z. Yang Brent Yorgey Preface This is the 23rd edition of the Haskell Communities and Activities Report. As usual, fresh entries are formatted using a blue background, while updated entries have a header with a blue background. Entries for which I received a liveness ping, but which have seen no essential update for a while, have been replaced with online pointers to previous versions. Other entries on which no new activity has been reported for a year or longer have been dropped completely. Please do revive such entries next time if you do have news on them.
    [Show full text]
  • Synthesizing Functional Reactive Programs
    Synthesizing Functional Reactive Programs Bernd Finkbeiner Felix Klein Saarland University Saarland University Germany Germany Ruzica Piskac Mark Santolucito Yale University Yale University CT, USA CT, USA Abstract 1 Introduction Functional Reactive Programming (FRP) is a paradigm that Reactive programs implement a broad class of computer has simplified the construction of reactive programs. There systems whose defining element is the continued interaction are many libraries that implement incarnations of FRP, us- between the system and its environment. Their importance ing abstractions such as Applicative, Monads, and Arrows. can be seen through the wide range of applications, such as However, finding a good control flow, that correctly manages embedded devices [Helbling and Guyer 2016], games [Perez state and switches behaviors at the right times, still poses a 2017], robotics [Jing et al. 2016], hardware circuits [Khalimov major challenge to developers. et al. 2014], GUIs [Czaplicki and Chong 2013], and interactive An attractive alternative is specifying the behavior instead multimedia [Santolucito et al. 2015]. of programming it, as made possible by the recently devel- Functional Reactive Programming (FRP) [Courtney et al. oped logic: Temporal Stream Logic (TSL). However, it has 2003; Elliott and Hudak 1997] is a paradigm for writing pro- not been explored so far how Control Flow Models (CFMs), grams for reactive systems. The fundamental idea of FRP resulting from TSL synthesis, are turned into executable code is to extend the classic building blocks of functional pro- that is compatible with libraries building on FRP. We bridge gramming with the abstraction of a siдnal to describe values this gap, by showing that CFMs are a suitable formalism to varying over time.
    [Show full text]
  • Specifying and Verifying Hardware-Based Security Enforcement Mechanisms Thomas Letan
    Specifying and Verifying Hardware-based Security Enforcement Mechanisms Thomas Letan To cite this version: Thomas Letan. Specifying and Verifying Hardware-based Security Enforcement Mechanisms. Hard- ware Architecture [cs.AR]. CentraleSupélec, 2018. English. NNT : 2018CSUP0002. tel-01989940v2 HAL Id: tel-01989940 https://hal.inria.fr/tel-01989940v2 Submitted on 27 May 2020 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. THESE DE DOCTORAT DE CENTRALESUPELEC RENNES COMUE UNIVERSITE BRETAGNE LOIRE ECOLE DOCTORALE N° 601 Mathématiques et Sciences et Technologies de l'Information et de la Communication Spécialité : Informatique Par Thomas Letan Specifying and Verifying Hardware-based Security Enforcement Mechanisms Thèse présentée et soutenue à Paris, le 25 octobre 2018 Unité de recherche : CIDRE Thèse N° : 2018-06-TH Rapporteurs avant soutenance : Composition du Jury : Gilles Barthe Professor, IMDEA Software Institute Présidente Laurence Pierre Professeur, Université Grenoble Alpes Emmanuelle Encrenaz Maître de conférences, Sorbonne Université Membres Gilles Barthe Professor, IMDEA Software Institute Laurence Pierre Professeur, Université Grenoble Alpes Pierre Chifflier Chef de laboratoire, ANSSI Guilaume Hiet Maître de conférences, CentraleSupélec Rennes Directeur de thèse Ludovic Mé Professeur, Inria Rennes Invité Alastair Reid Researcher, ARM Ltd. ii Abstract In this thesis, we consider a class of security enforcement mechanisms we called Hardware-based Security Enforcement (HSE).
    [Show full text]
  • Imperative Functional Programming
    Imp erative functional programming Simon L Peyton Jones Philip Wadler Dept of Computing Science University of Glasgow Email simonpjwadlerdcsglagsowacuk Octob er This paper appears in ACM Symposium on Principles Of Programming Languages POPL Charleston Jan pp This copy corrects a few minor typographical errors in the published version Abstract IO are constructed by gluing together smaller pro grams that do so Section Combined with higher We present a new mo del based on monads for p erform order functions and lazy evaluation this gives a ing inputoutput in a nonstrict purely functional lan highly expressive medium in which to express IO guage It is comp osable extensible ecient requires no p erforming computations Section quite the extensions to the type system and extends smo othly to reverse of the sentiment with which we b egan this incorp orate mixedlanguage working and inplace array section up dates We compare the monadic approach to IO with other standard approaches dialogues and continuations Section and eect systems and linear types Sec Introduction tion Inputoutput has always app eared to b e one of the less It is easily extensible The key to our implementation satisfactory features of purely functional languages t is to extend Haskell with a single form that allows one ting action into the functional paradigm feels like tting to call an any pro cedure written in the programming a square blo ck into a round hole Closely related dicul language C Kernighan Ritchie without ties are asso ciated with p erforming inplace
    [Show full text]