AAA One Minute Madness

Total Page:16

File Type:pdf, Size:1020Kb

AAA One Minute Madness One Minute Madness PLMW 2014 Alexander Bakst Data Structure Verification via Refinement Types function append(x1, x2) { if (x1 != null){ var n = x1.next; x1.next = append(n, x2); return x1; } else { return x2; } } Alexander Bakst University of California, San Diego Andrew Bedford Benjamin Greenman Conditional Inheritance class List<T> extends Eq<List<T>> given T extends Eq<T> 0Ben Greenman, Cornell University 1/1 Cole Schlesinger tomorrow at 3:15pm come see CAROLYN ANDERSON present NetKAT an algebraic presentation of network packet processing and verifcation Cyrus Omar Type-Oriented Foundations for Safely Extensible Programming Systems Cyrus Omar, CMU client compatibility G+R R G,#P,#Q,#R features G G (syntax, type system, implementation G+P G+Q C+A P Q strategy, editor service) (a) Separate Languages (b) Extensible Language language library Denis Bogdanas K I I I K I I I I I I Diego Gomez Ajhuacho Elias Castegren Elizabeth Davis Modeling Steganography with Linear Epistemic Logic Elizabeth Davis Advisor: Frank Pfenning Bit ops + normalization Innocuous cover Embedded steganographic message message Epistemic logic : reason about information gained from extracting encoded message Linear logic : reason about consumption and generation of resources in changing state Linear Epistemic logic : reason about actions based on changing information state (DeYoung & Pfenning, 2009) – K says A : linear affirmation – K has A : linear knowledge – K knows A : persistent knowledge Eric Mullen Eric Seidel Refinement'Types'with'LiquidHaskell' data$Text$=$Text$ $${$arr$::$Array $$,$off$::${v:Nat$|$v$$$$$$$<=$alen$arr} $$,$len$::${v:Nat$|$v$+$off$<=$alen$arr}$ $$}$ type$Nat$=${v:Int$|$v$>=$0} measure$alen$::$Array$A>$Nat Eric'Seidel';;'UC'San'Diego' Erick Lavoie Erick Lavoie, PhD @ McGill University Why? Allow scientists and engineers to run MATLAB code in the browser, fast! static dynamic (JIT) How? MATLAB JSON AST JavaScript McLab Compiler new MATLAB VM in JS •Find the fastest JS subset for num. computation Impact? •Design techniques for dynamic compilation to JS •Characterize the performance behaviour of complex VMs •Understand optimization across multiple VM layers Ethel Bardsley • Verify kernels • Atomics make this harder • Refined abstraction Evgeny Roubinchtein (Re)Implementing MetaOCaml: a multi-stage programming system Multi-stage programming? I A generalization of RE.compile() I A(typed)eval() I A partial evaluation you can repeat again (and again, and again. ) Is this stu↵new? I Native compiler has been done for OCaml 3 I Bytecode compiler has been done for OCaml 4 I (As far as I know) native compiler hasn’t yet been done for OCaml 4 Me Evgeny Roubinchtein, University of British Columbia, advised by Ron Garcia Ezgi Cicek Bound A Type System for Incremental Computational Complexity Ezgi Cicek, MPI-SWS Tuesday, January 21, 14 Fabian Muehlboeck Fabian Muehlboeck Gradual Typing for OO languages List<T> SnocS<T>(IEnumerable<T> startS, T endS) { var elemsS = startS.ToList(); elemsS.Add(endS); return elemsS; } dynamic SnocD(dynamic startD, dynamic endS) { var elemsD = startD.ToList(); elemsD.Add(endD); return elemsD; } Felipe Banados Gradual'Type,and,Effect'Systems' Felipe'Bañados'–'University'of'Chile' Filip Niksic FILIP NIKSIC MPI-SWS void thread() { // Non-critical section synchronized(lock) { // Critical section } } 1 Hannah Gommerstadt Vulnerability Distribution on the Android (~10,000 analyzed applications) Cryptographic 4% Issues 8% CRLF Injection 10% Information 44% Leakage Time and State 28% Cross Side Scripting (XSS) Heather Miller Language and compiler support for distributed programming for Scala Generally, type-systems Generic programming Concretely, distributable functions efficient & extensible serialization concurrent/dataflow abstractions Heather Miller heather.miller@epfl.ch James Wilcox Jason Gross Some of my time The rest of my time Cartoon from xkcd, adapted by Alan Huang Compiler ∀�, list � ≤ list[� + 1] Efficient Math program Image from “The Three Projections of Doctor Futamura” on A Neighborhood of Infinity Jonathan Frankle Laure Thompson Using Epistemic Temporal Logic for Dynamic Security Policies ó Security: An observing agent learns no more than the combination of their previous knowledge and the knowledge allowed by the current policy ó Knowledge: Is formed from the agent’s trace of past remembered observations ó Policy: The set of initial values an agent may learn ó Connection: Knowledge ≡ set of initial states that the agent knows to be possible ó This possibilistic view corresponds to epistemic logic: L� := In some possible world an agent knows � Luke Maurer I Common CBV and CBN ⇡-calculus encodings are closely related to CPS. Term (λx. xx)(λy. y) CBV ⇡ ⌫k (⌫f (k f !f (x, h). x x, h ) k(v). h i| h i | ⌫k (⌫g (k g !g(y, h). h y ) k(w). v w, k )) h i| h i | h 0i CBV CPS λk. k(λ(x, h). x(x, h)) λv. (λk. k(λ(y, h). hy))(λw. v(w, k0)) I Have ⇡-calculus encoding for call-by-need: CBNd ⇡ ⌫k (⌫f (k f !f (x, h). ⌫k0 (x k0 k0(v). v x, h )) k(v). h i| h i| h i | ⌫x (v x, k x(k0). ⌫k (⌫g (k g !g(y, h). y h ) h 0i| h i| h i | k(w). (!x(k). k w k w )))) h i| 0h i I We introduce a corresponding CPS transform: CBNd CPS λk. k(λ(x, h). x(λ1v. v(x, h))) λ1v. ⌫x. x :=1 (λ1k0. (λk. k(λ(y, h). yh))(λ1w. x := λk. kw in k0w)) in v(x, k0) Luke Maurer [email protected] CPS, ⇡, and Call-By-Need Mario Alvarez Mario Alvarez (Princeton) – Senior thesis ● VST (Appel et al, Princeton) ● MirrorShard (G. Malecha, Harvard) – Reflective solver for separation-logic entailments – Can solve entailments we currently can't automatically ● Goal: improve automation in VST – Make system easier/practical for more applications, ultimately – Learn about integrating external solvers with VST (eventually, maybe SMT or others) Matt Le Deterministic Parallel Programming Nondeterminism makes parallel programming difficult Purely functional parallel languages are inherently deterministic Unfortunately, mutable state can improve efficiency Add restricted forms of mutable state Extend runtime system to preserve determinism. Formalize semantics of the language with these new features and prove determinism. 1 http://www.cs.rit.edu/~mtf/manticore/index.html Matt Le (RIT) PLMW14 January 21, 2014 1 / 1 Matthew Loring PLMW 2014 Security-Typed Programming Languages Goal: Develop languages that help programmers reason about the security of their programs Jif extends Java with direct support from the type system for programming with the Decentralized Label Model Every type is annotated with labels specifying integrity and confidentiality policies Matthew Loring Cornell University Matthew Milano Network Verification Matthew Milano Cornell University Goal: Verify formal properties of network configurations automatically Idea: Encode NetKAT semantics using an SMT solver, and f ::= switch | inport ... ! automatically answer queries v ::= 0 | 1 | 2 | ... ! a,b,c ::= true! about path properties | false! | f = v! | a1 and a2! | a1 or a2 ! Challenge: Obvious direct | not a! p,q,r ::= filter a! encodings generate infinite | f := v! | p1 | p2! models, which aren’t handled | p1 ; p2! | p* ! well by current solvers | dup Mike Izbicki http://github.com/mikeizbicki/hlearn k-fold cross-validation Features k-fold cross-validation - purely functional (Haskell) standard cv -veryfast run time -parametersatthetypelevel monoid cv - design based on abstract algebra 100 200 300 400 500 600 700 800 900 1000 number of folds algebraic structure what we get “for free” monoid online algorithms monoid parallel algorithms monoid fast cross-validation abelian group subtract data points abelian group more fast cross-validation R-module data points weighted by the ring R functor (simple) transfer learning via fast data pre-processing monad (complex) transfer learning via fast pre-processing Mike Shah Java$Cri(cal$Sec(ons$ [email protected]$ Mohsen Lesani Nathalie Oostvogels Type Systems for JavaScript for distributed web applications web applications Nathalie Oostvogels - Vrije Universiteit Brussel (Belgium) Nicholas Braga Target'Tes)ng:! Automated!test!case!discovery!technique!using!inferred!models! Nicholas!Braga !!!!!Yuriy!Brun! University!of!Massachuse;s!Amherst! Nicholas Vanderweit Leveraging Symbolic Execution to Violate Object Invariants Backwards-symbolic p ¬p Library execution Synthesis Unsafe class Nicholas Vanderweit University of Colorado Boulder Pavel Panchekha Peng Wang Compositional Compilation ! (Horizontally) Can link with other modules ! (Vertically) Can compose compiler passes ! (Higher-order) Coder pointers ! Mechanized proof Peng (Perry) Wang MIT Phil Nguyen • Contracts enforce invariants dynamically delay error discovery introduce overheads are hard to verify due to expressiveness • Verification uses abstract reduction semantics scales to many language features 1 Philip Johnson-Freyd Extending the Classical Sequent Calculus Syntax Semantics Commands: c ::= v e È || Í µ–.c E = c E/– V µ˜x.c = c V /x Terms: v ::= µ–.c x case[call(x,–).c] pair(v, v) È || Í { }È|| Í { } | | | Co-Terms: e ::= µ˜x.c – call(v, e) case[pair(x, y).c] case[call(x,–).c] call(v, e) = v µ˜x. µ–.c e Simple Types | | | È || Í È || È || ÍÍ Plus rule for pairs (and what ever other types we add), ÷,...V and E determine evaluation order Γ, x : A x : A ∆ Γ – : A – : A, ∆ „ | | „ c :(Γ, x : A – : B, ∆) Γ v1 : A ∆Γv2 : B∆ c :(Γ – : A, ∆) c :(Γ, x : A ∆) „ „ | „ „ „ Γ case[call(x,–).c]:A B ∆ Γ pair(v1, v2):A B ∆ Γ µ–.c : A ∆ Γ µ˜x.c : A ∆ „ æ | „ ¢ | „ | | „ Γ v : A ∆Γe : B ∆ c :(Γ, x : A, y : B ∆) Γ v : A ∆Γe : A ∆ „ | | „ „ „ | | „ Γ call(v, e):A B ∆ Γ case[pair(x, y).c]:A B ∆ v e :(Γ ∆) | æ „ | ¢ „ È || Í „ Problem with Polymorphism “Natural” second order quantification rules = not type safe when implicit µ–. ((⁄x.x), (⁄f .µ (f ,⁄ ()) – )) – case[(f , g). f “bam” µ˜ g (⁄x.x + 1) — ] È È . È . || Í || Í|| È || · . È || · ÍÍ Í ML value restriction doesn’t dualize well Philip Johnson-Freyd High Level? Low Level? Functional? OOP? Shayak Sen We can prove protocols secure.
Recommended publications
  • Programming Language
    Programming language A programming language is a formal language, which comprises a set of instructions that produce various kinds of output. Programming languages are used in computer programming to implement algorithms. Most programming languages consist of instructions for computers. There are programmable machines that use a set of specific instructions, rather than general programming languages. Early ones preceded the invention of the digital computer, the first probably being the automatic flute player described in the 9th century by the brothers Musa in Baghdad, during the Islamic Golden Age.[1] Since the early 1800s, programs have been used to direct the behavior of machines such as Jacquard looms, music boxes and player pianos.[2] The programs for these The source code for a simple computer program written in theC machines (such as a player piano's scrolls) did not programming language. When compiled and run, it will give the output "Hello, world!". produce different behavior in response to different inputs or conditions. Thousands of different programming languages have been created, and more are being created every year. Many programming languages are written in an imperative form (i.e., as a sequence of operations to perform) while other languages use the declarative form (i.e. the desired result is specified, not how to achieve it). The description of a programming language is usually split into the two components ofsyntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, theC programming language is specified by an ISO Standard) while other languages (such as Perl) have a dominant implementation that is treated as a reference.
    [Show full text]
  • Safe, Fast and Easy: Towards Scalable Scripting Languages
    Safe, Fast and Easy: Towards Scalable Scripting Languages by Pottayil Harisanker Menon A dissertation submitted to The Johns Hopkins University in conformity with the requirements for the degree of Doctor of Philosophy. Baltimore, Maryland Feb, 2017 ⃝c Pottayil Harisanker Menon 2017 All rights reserved Abstract Scripting languages are immensely popular in many domains. They are char- acterized by a number of features that make it easy to develop small applications quickly - flexible data structures, simple syntax and intuitive semantics. However they are less attractive at scale: scripting languages are harder to debug, difficult to refactor and suffers performance penalties. Many research projects have tackled the issue of safety and performance for existing scripting languages with mixed results: the considerable flexibility offered by their semantics also makes them significantly harder to analyze and optimize. Previous research from our lab has led to the design of a typed scripting language built specifically to be flexible without losing static analyzability. Inthis dissertation, we present a framework to exploit this analyzability, with the aim of producing a more efficient implementation Our approach centers around the concept of adaptive tags: specialized tags attached to values that represent how it is used in the current program. Our frame- work abstractly tracks the flow of deep structural types in the program, and thuscan ii ABSTRACT efficiently tag them at runtime. Adaptive tags allow us to tackle key issuesatthe heart of performance problems of scripting languages: the framework is capable of performing efficient dispatch in the presence of flexible structures. iii Acknowledgments At the very outset, I would like to express my gratitude and appreciation to my advisor Prof.
    [Show full text]
  • Dynamic Extension of Typed Functional Languages
    Dynamic Extension of Typed Functional Languages Don Stewart PhD Dissertation School of Computer Science and Engineering University of New South Wales 2010 Supervisor: Assoc. Prof. Manuel M. T. Chakravarty Co-supervisor: Dr. Gabriele Keller Abstract We present a solution to the problem of dynamic extension in statically typed functional languages with type erasure. The presented solution re- tains the benefits of static checking, including type safety, aggressive op- timizations, and native code compilation of components, while allowing extensibility of programs at runtime. Our approach is based on a framework for dynamic extension in a stat- ically typed setting, combining dynamic linking, runtime type checking, first class modules and code hot swapping. We show that this framework is sufficient to allow a broad class of dynamic extension capabilities in any statically typed functional language with type erasure semantics. Uniquely, we employ the full compile-time type system to perform run- time type checking of dynamic components, and emphasize the use of na- tive code extension to ensure that the performance benefits of static typing are retained in a dynamic environment. We also develop the concept of fully dynamic software architectures, where the static core is minimal and all code is hot swappable. Benefits of the approach include hot swappable code and sophisticated application extension via embedded domain specific languages. We instantiate the concepts of the framework via a full implementation in the Haskell programming language: providing rich mechanisms for dy- namic linking, loading, hot swapping, and runtime type checking in Haskell for the first time. We demonstrate the feasibility of this architecture through a number of novel applications: an extensible text editor; a plugin-based network chat bot; a simulator for polymer chemistry; and xmonad, an ex- tensible window manager.
    [Show full text]
  • The University of Chicago Reflective Techniques In
    THE UNIVERSITY OF CHICAGO REFLECTIVE TECHNIQUES IN EXTENSIBLE LANGUAGES A DISSERTATION SUBMITTED TO THE FACULTY OF THE DIVISION OF THE PHYSICAL SCIENCES IN CANDIDACY FOR THE DEGREE OF DOCTOR OF PHILOSOPHY DEPARTMENT OF COMPUTER SCIENCE BY JONATHAN RIEHL CHICAGO, ILLINOIS AUGUST 2008 To Leon Schram ABSTRACT An extensible programming language allows programmers to use the language to modify one or more of the language’s syntactic, static-semantic, and/or dynamic- semantic properties. This dissertation presents Mython, a variant of the Python lan- guage, which affords extensibility of all three language properties. Mython achieves extensibility through a synthesis of reflection, staging, and compile-time evaluation. This synthesis allows language embedding, language evolution, domain-specific opti- mization, and tool development to be performed in the Mython language. This work argues that using language-development tools from inside an extensible language is preferable to using external tools. The included case study shows that users of an embedded differential equation language are able to work with both the embedded language and embedded programs in an interactive fashion — simplifying their work flow, and the task of specifying the embedded language. iii ACKNOWLEDGMENTS In keeping with my dedication, I’d like to begin by thanking Leon Schram, my A.P. computer science teacher. Mr. Schram took a boy who liked to play with computers, and made him a young man that could apply reason to the decomposition and solution of problems. In turn, I’d like to thank Charlie Fly and Robin Friedrich for helping extend that reason to encompass large scale systems and language systems.
    [Show full text]
  • Castor: Programming with Extensible Generative Visitors
    Castor: Programming with Extensible Generative Visitors Weixin Zhanga,∗, Bruno C. d. S. Oliveiraa aThe University of Hong Kong, Hong Kong, China Abstract Much recent work on type-safe extensibility for Object-Oriented languages has focused on design patterns that require modest type system features. Examples of such design patterns include Object Algebras, Extensible Visitors, Finally Tagless interpreters, or Polymorphic Embeddings. Those techniques, which often use a functional style, can solve basic forms of the Expression Problem. However, they have important limitations. This paper presents Castor: a Scala framework for programming with extensible, generative visitors. Castor has several advantages over previous approaches. Firstly, Castor comes with support for (type-safe) pattern matching to complement its visitors with a concise notation to express operations. Secondly, Castor supports type-safe interpreters (à la Finally Tagless), but with additional support for pattern matching and a generally recursive style. Thirdly, Castor enables many operations to be defined using an imperative style, which is significantly more performant than a functional style (especially in the JVM platform). Finally, functional techniques usually only support tree structures well, but graph structures are poorly supported. Castor supports type-safe extensible programming on graph structures. The key to Castor’s usability is the use of annotations to automatically generate large amounts of boilerplate code to simplify programming with extensible visitors. To illustrate the applicability of Castor we present several applications and two case studies. The first case study compares the ability of Castor for modularizing the interpreters from the “Types and Programming Languages” book with previous modularization work. The second case study on UML activity diagrams illustrates the imperative aspects of Castor, as well as its support for hierarchical datatypes and graphs.
    [Show full text]
  • An Abstract, Reusable, and Extensible Programming Language Design Architecture⋆
    An Abstract, Reusable, and Extensible Programming Language Design Architecture⋆ Hassan A¨ıt-Kaci Universit´eClaude Bernard Lyon 1 Villeurbanne, France [email protected] Abstract. There are a few basic computational concepts that are at the core of all programming languages. The exact elements making out such a set of concepts determine (1) the specific nature of the computational services such a language is designed for, (2) for what users it is intended, and (3) on what devices and in what environment it is to be used. It is therefore possible to propose a set of basic build- ing blocks and operations thereon as combination procedures to enable program- ming software by specifying desired tasks using a tool-box of generic constructs and meta-operations. Syntax specified through LALR(k) grammar technology can be enhanced with greater recognizing power thanks to a simple augmentation of yacc technology. Upon this basis, a set of implementable formal operational semantics constructs may be simply designed and generated (syntax and seman- tics) `ala carte, by simple combination of its desired features. The work presented here, and the tools derived from it, may be viewed as a tool box for generating lan- guage implementations with a desired set of features. It eases the automatic prac- tical generation of programming language pioneered by Peter Landin’s SECD Machine. What is overviewed constitutes a practical computational algebra ex- tending the polymorphically typed λ-Calculus with object/classes and monoid comprehensions. This paper describes a few of the most salient parts of such a system, stressing most specifically any innovative features—formal syntax and semantics.
    [Show full text]
  • 201604261441 Merged2.Pdf
    Demystifying secure computation: Familiar abstractions for efficient protocols A dissertation Submitted to the department of Computer Science Of University of Virginia In fulfillment of the requirements For the degree of Doctor of Philosophy Samee Zahur April 2016 Abstract Over the past few years, secure multi-party computation (MPC) has been transformed from a research tool to a practical one with numerous interesting applications in practice. MPC is a cryptographic technique that allows two or more parties to collaboratively perform a computation without revealing their own private inputs to each other (other than what can be inferred from the output result). Example uses include private auctions where all the participants keep their bids private, private aggregation of corporate-internal data for economic analysis, and private set intersection. However, efficiency of MPC protocols have remained a persistent challenge for many applications. One particular issue that we examine in this dissertation is input-dependent memory accesses. It is difficult to efficiently access a memory location without revealing which element is being accessed, which in turn makes it very difficult to efficiently implement certain programs. This dissertation solves the problem by separately considering two different cases. First, we construct efficient circuit structures for cases where the access pattern is known to follow certain constraints, such as locality. The second case involves a new Oblivious RAM (ORAM) construction that provides general random access. The ORAM construction is slower than the specialized circuit structures, but faster than existing ORAM constructions for MPC for a large range of parameters. To help in implementing and evaluating these constructions, we also designed a new extensible programming language for MPC called Obliv-C, which we believe can be a useful contribution in its own right.
    [Show full text]
  • Genesis: an Extensible Java
    Genesis: An Extensible Java by Ian Lewis BComp Hons Submitted in fulfilment of the requirements for the Degree of Doctor of Philosophy University of Tasmania February 2005 This thesis contains no material which has been accepted for a degree or diploma by the University or any other institution, except by way of background information and duly acknowledged in the thesis, and to the best of the candidate’s knowledge and belief no material previously published or written by another person except where due acknowledgement is made in the text of the thesis. Ian Lewis • iii • This thesis may be made available for loan and limited copying in accordance with the Copyright Act 1968 . Ian Lewis • v • Abstract Extensible programming languages allow users to create fundamentally new syntax and translate this syntax into language primitives. The concept of compile-time meta- programming has been around for decades, but systems that provide such abilities generally disallow the creation of new syntactic forms, or have heavy restrictions on how, or where, this may be done. Genesis is an extension to Java that supports compile-time meta-programming by allowing users to create their own arbitrary syntax. This is achieved through macros that operate on a mix of both concrete and abstract syntax, and produce abstract syntax. Genesis attempts to provide a minimal design whilst maintaining, and extending, the expressive power of other similar macro systems. The core Genesis language definition lacks many of the desirable features found in other systems, such as quasi-quote, hygiene, and static expression-type dispatch, but is expressive enough to define these as syntax extensions.
    [Show full text]
  • Extensible Languages for Flexible and Principled Domain Abstraction
    Extensible Languages for Flexible and Principled Domain Abstraction Dissertation for the degree of Doctor of Natural Sciences Submitted by Sebastian Thore Erdweg, MSc born March 14, 1985 in Frankfurt/Main Department of Mathematics and Computer Science Philipps-Universität Marburg Referees: Prof. Dr. Klaus Ostermann Dr. Eelco Visser Prof. Dr. Ralf Lämmel Submitted November 28, 2012. Defended March 06, 2013. Marburg, 2013. Erdweg, Sebastian: Extensible Languages for Flexible and Principled Domain Abstraction Dissertation, Philipps-Universität Marburg (1180), 2013. Curriculum vitae 2007, Bachelor of Science, TU Darmstadt 2009, Master of Science, Aarhus University Cover photo by Tellerdreher Photography, 2012. Abstract Most programming languages are designed for general-purpose software deve- lopment in a one-size-fits-all fashion: They provide the same set of language features and constructs for all possible applications programmers ever may want to develop. As with shoes, the one-size-fits-all solution grants a good fit to few applications only. The trend toward domain-specific languages, model-driven development, and language-oriented programming counters general-purpose languages by promo- ting the use of domain abstractions that facilitate domain-specific language features and constructs tailored to certain application domains. In particular, domain abstraction avoids the need for encoding domain concepts with general- purpose language features and thus allows programmers to program at the same abstraction level as they think. Unfortunately, current approaches to domain abstraction cannot deliver on the promises of domain abstraction. On the one hand, approaches that target internal domain-specific languages lack flexibility regarding the syntax, static checking, and tool support of domain abstractions, which limits the level of actually achieved domain abstraction.
    [Show full text]
  • Where Are We? PL Category: Concatenative Pls Introduction to Forth
    Where Are We? PL Category: Concatenative PLs Introduction to Forth CS F331 Programming Languages CSCE A331 Programming Language Concepts Lecture Slides Monday, March 23, 2020 Glenn G. Chappell Department of Computer Science University of Alaska Fairbanks [email protected] © 2017–2020 Glenn G. Chappell Review 2020-03-23 CS F331 / CSCE A331 Spring 2020 2 Review Haskell: Data We made a Binary Tree type, with a data item in each node. Such a Binary Tree either has no nodes (it is empty) or it has a root node, which contains a data item and has left and right subtrees, each of which is a Binary Tree. The type is called the type BT. It has two constructors. § BTEmpty gives an empty Binary Tree. § BTNode, followed by an item of the value type, the left subtree, and the right subtree, constructs a nonempty tree. data BT vt = BTEmpty | BTNode vt (BT vt) (BT vt) The value type We implemented the Treesort algorithm in Haskell, using BT for the Binary Search Tree. See data.hs. 2020-03-23 CS F331 / CSCE A331 Spring 2020 3 Review PL Feature: Values & Variables [1/3] Remember: § A value has a lifetime: time from construction to destruction. § An identifier has a scope: where in code it is accessible. Because a bound variable involves both an identifier and a value, scope and lifetime are both applicable. 2020-03-23 CS F331 / CSCE A331 Spring 2020 4 Review PL Feature: Values & Variables [2/3] At runtime, a variable is typically implemented as a location in memory large enough to hold the internal representation of the variable’s value.
    [Show full text]
  • Effective Extensible Programming: Unleashing Julia on Gpus
    IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS 1 Effective Extensible Programming: Unleashing Julia on GPUs Tim Besard, Christophe Foket and Bjorn De Sutter, Member, IEEE Abstract—GPUs and other accelerators are popular devices for accelerating compute-intensive, parallelizable applications. However, programming these devices is a difficult task. Writing efficient device code is challenging, and is typically done in a low-level programming language. High-level languages are rarely supported, or do not integrate with the rest of the high-level language ecosystem. To overcome this, we propose compiler infrastructure to efficiently add support for new hardware or environments to an existing programming language. We evaluate our approach by adding support for NVIDIA GPUs to the Julia programming language. By integrating with the existing compiler, we significantly lower the cost to implement and maintain the new compiler, and facilitate reuse of existing application code. Moreover, use of the high-level Julia programming language enables new and dynamic approaches for GPU programming. This greatly improves programmer productivity, while maintaining application performance similar to that of the official NVIDIA CUDA toolkit. Index Terms—Graphics processors, very high-level languages, code generation F 1 INTRODUCTION the implementation but hinders long-term maintainability To satisfy ever higher computational demands, hardware when the host language gains features or changes semantics. vendors and software developers look at accelerators, spe- It also forces users to learn and deal with the inevitable cialized processors that are optimized for specific, typically divergence between individual language implementations. parallel workloads, and perform much better at them than This paper presents a vision in which the high-level general-purpose processors [1], [2], [3], [4], [5].
    [Show full text]
  • A Framework for Feature-Oriented Language Development
    Computer Languages, Systems & Structures 43 (2015) 1–40 Contents lists available at ScienceDirect Computer Languages, Systems & Structures journal homepage: www.elsevier.com/locate/cl Neverlang: A framework for feature-oriented language development Edoardo Vacchi, Walter Cazzola n Department of Computer Science, Università degli Studi di Milano, Italy article info abstract Article history: Reuse in programming language development is an open research problem. Many authors Received 6 October 2014 have proposed frameworks for modular language development. These frameworks focus Received in revised form on maximizing code reuse, providing primitives for componentizing language implemen- 7 February 2015 tations. There is also an open debate on combining feature-orientation with modular Accepted 11 February 2015 language development. Feature-oriented programming is a vision of computer program- Available online 20 February 2015 ming in which features can be implemented separately, and then combined to build a Keywords: variety of software products. However, even though feature-orientation and modular Domain specific languages programming are strongly connected, modular language development frameworks are not Language development usually meant primarily for feature-oriented language definition. In this paper we present Modularity a model of language development that puts feature implementation at the center, and describe its implementation in the Neverlang framework. The model has been evaluated through several languages implementations: in this paper, a state machine language is used as a means of comparison with other frameworks, and a JavaScript interpreter implementation is used to further illustrate the benefits that our model provides. & 2015 Elsevier Ltd. All rights reserved. 1. Introduction The problem of extending programming languages through new constructs has never lost interest in the industry and in the research community.
    [Show full text]