GPP, the Generic Preprocessor

Total Page:16

File Type:pdf, Size:1020Kb

GPP, the Generic Preprocessor GPP, the Generic Preprocessor Tristan Miller Austrian Research Institute for Artificial Intelligence Freyung 6/3, 1010 Vienna, Austria ORCID: 0000-0002-0749-1100 Denis Auroux Department of Mathematics, Harvard University 1 Oxford Street, Cambridge, MA 02138, USA Summary at providing even higher-level constructs, such as conditional loops and other control structures in In computer science, a preprocessor (or macro pro- FORTRAN (Meissner, 1975) and COBOL (Tri- cessor) is a tool that programatically alters its input, ance, 1980). The need for generalized, language- typically on the basis of inline annotations, to pro- independent tools was eventually recognized (McIl- duce data that serves as input for another program. roy, 1960), leading to the development of general- Preprocessors are used in software development and purpose preprocessors such as GPM (Strachey, 1965) document processing workflows to translate or ex- and ML/I (Brown, 1967). tend programming or markup languages, as well By the end of the 1960s, preprocessors had at- as for conditional or pattern-based generation of tracted a considerable amount of attention, by com- source code and text. Early preprocessors were rela- puting theorists and practitioners alike, and their tively simple string replacement tools that were tied use in software engineering had expanded beyond to specific programming languages and application the augmentation and adaptation of programming domains, and while these have since given rise to languages. A survey paper by Brown (1969) iden- more powerful, general-purpose tools, these often tified four broad application areas: language ex- require the user to learn and use complex macro tension, systematic searching and editing of source languages with their own syntactic conventions. In code, translation between programming languages, this paper, we present GPP, an extensible, general- and code generation (i.e., simplifying the writing of purpose preprocessor whose principal advantage is highly repetitive code, parameterizing a program by that its syntax and behaviour can be customized to substituting compile-time constants, or producing suit any given preprocessing task. This makes GPP variants of a program by conditionally including cer- of particular benefit to research applications, where tain statements or modules). While the first three of it can be easily adapted for use with novel markup, these application areas have largely been rendered programming, and control languages. obsolete by today's integrated development envi- arXiv:2008.00840v1 [cs.PL] 3 Aug 2020 ronments and expressive, feature-rich programming languages, implementing software variability with Background language-specific and general-purpose preprocessors remains commonplace (Apel et al., 2013; Kstner Preprocessors date back to the mid-1950s, when et al., 2012). they were used to extend individual assembly lan- Text processing became another main application guages with constructs that would later be found in area for preprocessors, in particular to generate doc- high-level programming languages (Layzell, 1985). uments on the basis of user-specified conditions or These languages, in turn, fostered the development patterns, and to convert between document markup of yet more special-purpose preprocessors aimed languages (Walden, 2014). The earliest such uses 1 This is a preprint of the following publication: Tristan Miller and Denis Auroux. GPP, the generic preprocessor. Journal of Open Source Software, 5(51), July 2020. ISSN 2475-9066. DOI: 10.21105/joss.02400 were ad-hoc repurposings of programming language{ and Weinberg, 2020). While GPP is less powerful specific preprocessors to operate on human-readable than m4 (Seindal et al., 2016), it is arguably more texts (Keese, 1964; Stallman and Weinberg, 2020); flexible, and supports all the basic operations ex- these were soon supplanted by text-specific macro pected of a modern, high-level preprocessing system, languages such as TRAC (Mooers and Deutsch, including conditional tests, arithmetic evaluation, 1965), which were positioned as tools for stenogra- and POSIX-style wildcard matching (\globbing"). phers and other writing professionals. More recently In addition to macros, GPP understands comments it has been common to use general-purpose prepro- and strings, whose syntax and behaviour can also cessors (Mailund, 2019; Pesch, 1992). be widely customized to fit any particular purpose. Statement of Need GPP in research Criticism of preprocessors commonly focuses on the GPP has already been integrated into a number of idiosyncratic languages they employ for their own third-party projects in basic and applied research. built-in directives and for users to define and in- These include the following: voke macros. The languages of early preprocessors were derided as \clumsy and restrictive" (Layzell, • The Waveform Definition Language (WDL) is 1985) and \hard to read" (Brown, 1969), and even Caltech Optical Observatories' C-like language modern preprocessors are sometimes attacked for for programming astronomical research cam- relying on \the clumsiness of a separate language eras. WDL uses GPP to preprocess configura- of limited expressiveness" (Ernst et al., 2002) or, tion files containing signals and parameters spe- at the other extreme, for being overly complicated, cific to the camera controllers, flags setting the quirky, opaque, or hard to learn, even for experi- devices' operating modes and image properties, enced programmers and markup users (Ernst et al., and timing rules. According to the develop- 2002; Paddon, 1993; Pesch, 1992). ers, GPP was chosen over the C Preprocessor Our general-purpose preprocessor, GPP, avoids \for added flexibility and to avoid some C-like these issues by providing a lightweight but flexible limitations" (Kaye et al., 2017). macro language whose syntax can be customized • XSB is a research-oriented, commercial-grade by the user. The tool's built-in presets allow its logic programming system and Prolog compiler. directives to be made to resemble those of many The developers chose to make GPP XSB's de- popular languages, including HTML and T X. This E fault preprocessor because it \maintains a high greatly reduces the learning curve for GPP when it is degree of compatibility with the C preproces- used with these languages, eliminates the cognitive sor, but is more suitable for processing Prolog burden of repeatedly \mode switching" between programs" (Swift et al., 2017). source and preprocessor syntax when reading or composing, and allows existing syntax highlighters • C-Control Pro is a family of electronic mi- and other tools to process GPP directives with little crocontrollers produced by Conrad Electronic; or no further configuration. Furthermore, users are they are specifically designed for industrial and not limited to using these presets, but can fully automotive applications. The official software define their own syntax for GPP directives and development kit includes a modified version of macros. This makes GPP particularly attractive for GPP for use with the products' BASIC and use in research and development, where its syntax Compact-C programming languages (Schirm can be readily adapted to match novel programming and Sprenger, 2007). and markup languages. GPP's independence from any one programming • SUS is a tool that allows system administrators or markup language makes it more versatile than to exercise fine-grained control over how users the C Preprocessor, which was formerly \abused" as can run commands with elevated privileges. It a general text processor and is still sometimes (inap- has a sophisticated control file syntax that is propriately) used for non-C applications (Stallman preprocessed with GPP (Gray, 2001). 2 Apart from these uses, GPP is occasionally cited as Dreiling, Alexander (July 2010). \Feature Mining: previous or related work in scholarly publications Semiautomatische Transition von (Alt-)Systemen on metaprogramming or compile-time variability of zu Software-Produktlinien". Diploma thesis. software (Apel et al., 2013; Baxter and Mehlich, Fakultt fr Informatik, Institut fr Technische 2001; Behringer, 2017; Blendinger, 2010; Dreiling, und Betriebliche Informationssysteme, Otto-von- 2010; Kstner et al., 2012; Lotoreychik and Shopyrin, Guericke-Universitt Magdeburg. 2006; Zmiry, 2016). Ernst, Michael D., Greg J. Badros, and David Notkin (Dec. 2002). An Empirical Analysis of C Preprocessor Use. IEEE Transactions on Software Acknowledgments Engineering 28(12):1146{1170. issn: 0098-5589. doi: 10.1109/TSE.2002.1158288. Tristan Miller is supported by the Austrian Science Gray, Peter D. (Dec. 2001). SUS An Object Ref- Fund (FWF) under project M 2625-N31. Denis erence Model for Distributing UNIX Super User Auroux is partially supported by NSF grant DMS- Privileges. Proceedings of the LISA 2001 15th Sys- 1937869 and by Simons Foundation grant #385573. tems Administration Conference. The USENIX The Austrian Research Institute for Artificial Intelli- Association, pp. 15{18. gence is supported by the Austrian Federal Ministry Kstner, Christian et al. (June 2012). Type Checking for Science, Research and Economy. Annotation-Based Product Lines. ACM Trans- actions on Software Engineering and Methodol- References ogy 21(3):14:1{14:39. doi: 10 . 1145 / 2211616 . 2211617. Apel, Sven et al. (Oct. 2013). Classic, Tool-Driven Kaye, Stephen et al. (2017). Waveform Definition Variability Mechanisms. Feature-Oriented Soft- Language. Tech. rep. Pasadena, CA: Caltech Op- ware Product Lines. Berlin/Heidelberg:
Recommended publications
  • A New Macro-Programming Paradigm in Data Collection Sensor Networks
    SpaceTime Oriented Programming: A New Macro-Programming Paradigm in Data Collection Sensor Networks Hiroshi Wada and Junichi Suzuki Department of Computer Science University of Massachusetts, Boston Program Insert This paper proposes a new programming paradigm for wireless sensor networks (WSNs). It is designed to significantly reduce the complexity of WSN programming by providing a new high- level programming abstraction to specify spatio-temporal data collections in a WSN from a global viewpoint as a whole rather than sensor nodes as individuals. Abstract SpaceTime Oriented Programming (STOP) is new macro-programming paradigm for wireless sensor networks (WSNs) in that it supports both spatial and temporal aspects of sensor data and it provides a high-level abstraction to express data collections from a global viewpoint for WSNs as a whole rather than sensor nodes as individuals. STOP treats space and time as first-class citizens and combines them as spacetime continuum. A spacetime is a three dimensional object that consists of a two special dimensions and a time playing the role of the third dimension. STOP allows application developers to program data collections to spacetime, and abstracts away the details in WSNs, such as how many nodes are deployed in a WSN, how nodes are connected with each other, and how to route data queries in a WSN. Moreover, STOP provides a uniform means to specify data collections for the past and future. Using the STOP application programming interfaces (APIs), application programs (STOP macro programs) can obtain a “snapshot” space at a given time in a given spatial resolutions (e.g., a space containing data on at least 60% of nodes in a give spacetime at 30 minutes ago.) and a discrete set of spaces that meet specified spatial and temporal resolutions.
    [Show full text]
  • Easyaccess: Enhanced SQL Command Line Interpreter for Astronomical Surveys
    easyaccess: Enhanced SQL command line interpreter for astronomical surveys Matias Carrasco Kind1, Alex Drlica-Wagner2, Audrey Koziol1, and Don Petravick1 1 National Center for Supercomputing Applications, University of Illinois at Urbana-Champaign. 1205 W Clark St, Urbana, IL USA 61801 2 Fermi National Accelerator Laboratory, P. O. Box 500, DOI: 00.00000/joss.00000 Batavia,IL 60510, USA Software • Review Summary • Repository • Archive easyaccess is an enhanced command line interpreter and Python package created to Submitted: 00 January 0000 facilitate access to astronomical catalogs stored in SQL Databases. It provides a custom Published: 00 January 0000 interface with custom commands and was specifically designed to access data from the License Dark Energy Survey Oracle database, although it can easily be extended to another survey Authors of papers retain copyright or SQL database. The package was completely written in Python and support customized and release the work under a Cre- addition of commands and functionalities. Visit https://github.com/mgckind/easyaccess ative Commons Attribution 4.0 In- to view installation instructions, tutorials, and the Python source code for easyaccess. ternational License (CC-BY). The Dark Energy Survey The Dark Energy Survey (DES) (DES Collaboration 2005; DES Collaboration 2016) is an international, collaborative effort of over 500 scientists from 26 institutions in seven countries. The primary goals of DES are reveal the nature of the mysterious dark energy and dark matter by mapping hundreds of millions of galaxies, detecting thousands of supernovae, and finding patterns in the large-scale structure of the Universe. Survey operations began on on August 31, 2013 and will conclude in early 2019.
    [Show full text]
  • Scribble As Preprocessor
    Scribble as Preprocessor Version 8.2.0.8 Matthew Flatt and Eli Barzilay September 25, 2021 The scribble/text and scribble/html languages act as “preprocessor” languages for generating text or HTML. These preprocessor languages use the same @ syntax as the main Scribble tool (see Scribble: The Racket Documentation Tool), but instead of working in terms of a document abstraction that can be rendered to text and HTML (and other formats), the preprocessor languages work in a way that is more specific to the target formats. 1 Contents 1 Text Generation 3 1.1 Writing Text Files . .3 1.2 Defining Functions and More . .7 1.3 Using Printouts . .9 1.4 Indentation in Preprocessed output . 11 1.5 Using External Files . 16 1.6 Text Generation Functions . 19 2 HTML Generation 23 2.1 Generating HTML Strings . 23 2.1.1 Other HTML elements . 30 2.2 Generating XML Strings . 32 2.3 HTML Resources . 36 Index 39 Index 39 2 1 Text Generation #lang scribble/text package: scribble-text-lib The scribble/text language provides everything from racket/base, racket/promise, racket/list, and racket/string, but with additions and a changed treatment of the module top level to make it suitable as for text generation or a preprocessor language: • The language uses read-syntax-inside to read the body of the module, similar to §6.7 “Document Reader”. This means that by default, all text is read in as Racket strings; and @-forms can be used to use Racket functions and expression escapes. • Values of expressions are printed with a custom output function.
    [Show full text]
  • SQL Processing with SAS® Tip Sheet
    SQL Processing with SAS® Tip Sheet This tip sheet is associated with the SAS® Certified Professional Prep Guide Advanced Programming Using SAS® 9.4. For more information, visit www.sas.com/certify Basic Queries ModifyingBasic Queries Columns PROC SQL <options>; SELECT col-name SELECT column-1 <, ...column-n> LABEL= LABEL=’column label’ FROM input-table <WHERE expression> SELECT col-name <GROUP BY col-name> FORMAT= FORMAT=format. <HAVING expression> <ORDER BY col-name> <DESC> <,...col-name>; Creating a SELECT col-name AS SQL Query Order of Execution: new column new-col-name Filtering Clause Description WHERE CALCULATED new columns new-col-name SELECT Retrieve data from a table FROM Choose and join tables Modifying Rows WHERE Filter the data GROUP BY Aggregate the data INSERT INTO table SET column-name=value HAVING Filter the aggregate data <, ...column-name=value>; ORDER BY Sort the final data Inserting rows INSERT INTO table <(column-list)> into tables VALUES (value<,...value>); INSERT INTO table <(column-list)> Managing Tables SELECT column-1<,...column-n> FROM input-table; CREATE TABLE table-name Eliminating SELECT DISTINCT CREATE TABLE (column-specification-1<, duplicate rows col-name<,...col-name> ...column-specification-n>); WHERE col-name IN DESCRIBE TABLE table-name-1 DESCRIBE TABLE (value1, value2, ...) <,...table-name-n>; WHERE col-name LIKE “_string%” DROP TABLE table-name-1 DROP TABLE WHERE col-name BETWEEN <,...table-name-n>; Filtering value AND value rows WHERE col-name IS NULL WHERE date-value Managing Views “<01JAN2019>”d WHERE time-value “<14:45:35>”t CREATE VIEW CREATE VIEW table-name AS query; WHERE datetime-value “<01JAN201914:45:35>”dt DESCRIBE VIEW view-name-1 DESCRIBE VIEW <,...view-name-n>; Remerging Summary Statistics DROP VIEW DROP VIEW view-name-1 <,...view-name-n>; SELECT col-name, summary function(argument) FROM input table; Copyright © 2019 SAS Institute Inc.
    [Show full text]
  • Section “Common Predefined Macros” in the C Preprocessor
    The C Preprocessor For gcc version 12.0.0 (pre-release) (GCC) Richard M. Stallman, Zachary Weinberg Copyright c 1987-2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation. A copy of the license is included in the section entitled \GNU Free Documentation License". This manual contains no Invariant Sections. The Front-Cover Texts are (a) (see below), and the Back-Cover Texts are (b) (see below). (a) The FSF's Front-Cover Text is: A GNU Manual (b) The FSF's Back-Cover Text is: You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development. i Table of Contents 1 Overview :::::::::::::::::::::::::::::::::::::::: 1 1.1 Character sets:::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.2 Initial processing ::::::::::::::::::::::::::::::::::::::::::::::: 2 1.3 Tokenization ::::::::::::::::::::::::::::::::::::::::::::::::::: 4 1.4 The preprocessing language :::::::::::::::::::::::::::::::::::: 6 2 Header Files::::::::::::::::::::::::::::::::::::: 7 2.1 Include Syntax ::::::::::::::::::::::::::::::::::::::::::::::::: 7 2.2 Include Operation :::::::::::::::::::::::::::::::::::::::::::::: 8 2.3 Search Path :::::::::::::::::::::::::::::::::::::::::::::::::::: 9 2.4 Once-Only Headers::::::::::::::::::::::::::::::::::::::::::::: 9 2.5 Alternatives to Wrapper #ifndef ::::::::::::::::::::::::::::::
    [Show full text]
  • Julia: a Fresh Approach to Numerical Computing
    RSDG @ UCL Julia: A Fresh Approach to Numerical Computing Mosè Giordano @giordano [email protected] Knowledge Quarter Codes Tech Social October 16, 2019 Julia’s Facts v1.0.0 released in 2018 at UCL • Development started in 2009 at MIT, first • public release in 2012 Julia co-creators won the 2019 James H. • Wilkinson Prize for Numerical Software Julia adoption is growing rapidly in • numerical optimisation, differential equations, machine learning, differentiable programming It is used and taught in several universities • (https://julialang.org/teaching/) Mosè Giordano (RSDG @ UCL) Julia: A Fresh Approach to Numerical Computing October 16, 2019 2 / 29 Julia on Nature Nature 572, 141-142 (2019). doi: 10.1038/d41586-019-02310-3 Mosè Giordano (RSDG @ UCL) Julia: A Fresh Approach to Numerical Computing October 16, 2019 3 / 29 Solving the Two-Language Problem: Julia Multiple dispatch • Dynamic type system • Good performance, approaching that of statically-compiled languages • JIT-compiled scripts • User-defined types are as fast and compact as built-ins • Lisp-like macros and other metaprogramming facilities • No need to vectorise: for loops are fast • Garbage collection: no manual memory management • Interactive shell (REPL) for exploratory work • Call C and Fortran functions directly: no wrappers or special APIs • Call Python functions: use the PyCall package • Designed for parallelism and distributed computation • Mosè Giordano (RSDG @ UCL) Julia: A Fresh Approach to Numerical Computing October 16, 2019 4 / 29 Multiple Dispatch using DifferentialEquations
    [Show full text]
  • A Command-Line Interface for Analysis of Molecular Dynamics Simulations
    taurenmd: A command-line interface for analysis of Molecular Dynamics simulations. João M.C. Teixeira1, 2 1 Previous, Biomolecular NMR Laboratory, Organic Chemistry Section, Inorganic and Organic Chemistry Department, University of Barcelona, Baldiri Reixac 10-12, Barcelona 08028, Spain 2 DOI: 10.21105/joss.02175 Current, Program in Molecular Medicine, Hospital for Sick Children, Toronto, Ontario M5G 0A4, Software Canada • Review Summary • Repository • Archive Molecular dynamics (MD) simulations of biological molecules have evolved drastically since its application was first demonstrated four decades ago (McCammon, Gelin, & Karplus, 1977) and, nowadays, simulation of systems comprising millions of atoms is possible due to the latest Editor: Richard Gowers advances in computation and data storage capacity – and the scientific community’s interest Reviewers: is growing (Hospital, Battistini, Soliva, Gelpí, & Orozco, 2019). Academic groups develop most of the MD methods and software for MD data handling and analysis. The MD analysis • @amritagos libraries developed solely for the latter scope nicely address the needs of manipulating raw data • @luthaf and calculating structural parameters, such as: MDAnalysis (Gowers et al., 2016; Michaud- Agrawal, Denning, Woolf, & Beckstein, 2011); (McGibbon et al., 2015); (Romo, Submitted: 03 March 2020 MDTraj LOOS Published: 02 June 2020 Leioatts, & Grossfield, 2014); and PyTraj (Hai Nguyen, 2016; Roe & Cheatham, 2013), each with its advantages and drawbacks inherent to their implementation strategies. This diversity License enriches the field with a panoply of strategies that the community can utilize. Authors of papers retain copyright and release the work The MD analysis software libraries widely distributed and adopted by the community share under a Creative Commons two main characteristics: 1) they are written in pure Python (Rossum, 1995), or provide a Attribution 4.0 International Python interface; and 2) they are libraries: highly versatile and powerful pieces of software that, License (CC BY 4.0).
    [Show full text]
  • Rexx to the Rescue!
    Session: G9 Rexx to the Rescue! Damon Anderson Anixter May 21, 2008 • 9:45 a.m. – 10:45 a.m. Platform: DB2 for z/OS Rexx is a powerful tool that can be used in your daily life as an z/OS DB2 Professional. This presentation will cover setup and execution for the novice. It will include Edit macro coding examples used by DBA staff to solve everyday tasks. DB2 data access techniques will be covered as will an example of calling a stored procedure. Examples of several homemade DBA tools built with Rexx will be provided. Damon Anderson is a Senior Technical DBA and Technical Architect at Anixter Inc. He has extensive experience in DB2 and IMS, data replication, ebusiness, Disaster Recovery, REXX, ISPF Dialog Manager, and related third-party tools and technologies. He is a certified DB2 Database Administrator. He has written articles for the IDUG Solutions Journal and presented at IDUG and regional user groups. Damon can be reached at [email protected] 1 Rexx to the Rescue! 5 Key Bullet Points: • Setting up and executing your first Rexx exec • Rexx execs versus edit macros • Edit macro capabilities and examples • Using Rexx with DB2 data • Examples to clone data, compare databases, generate utilities and more. 2 Agenda: • Overview of Anixter’s business, systems environment • The Rexx “Setup Problem” Knowing about Rexx but not knowing how to start using it. • Rexx execs versus Edit macros, including coding your first “script” macro. • The setup and syntax for accessing DB2 • Discuss examples for the purpose of providing tips for your Rexx execs • A few random tips along the way.
    [Show full text]
  • Ed 060 620 Author Title Institution Spons Agency Pub Date
    DOCUMENT RESUME ED 060 620 EM 009 626 AUTHOR Bork, Alfred M. TITLE Introduction to Computer Programming Languages. INSTITUTION California Univ., Irvine. Physics Computer Development Project. SPONS AGENCY National Science Foundation, Washington, D-C. PUB DATE Dec 71 NOTE 5p. JOURNAL CIT JCST; P 12-16 December 1971 EDRS PRICE MF-$0.65 HC-$3.29 DESCRIPTORS Computer Assisted Instruction; Computer Science Education; *Guides; *Programing; *Programing Languages ABSTRACT A brief introduction to computer programing explains the basic grammar of ccmputer language as well as fundamental computer techniques. What constitutes a computer program is made clear, then three simple kinds of statements basic to the computational computer are defined: assignment statements, input-output statements, and branching statements. A short description of several available computer languages is given along with an explanation of how the newcomer would make use of basic computer software. Finally, five different versions of a simple program (for solving the harmonic oscillator numerically) are given with comparison. (RB) 74.-E U.S. DEPARTMENT OF HEALTH. F749 EDUCATION & WELFARE erP\ e-"ri". "79' - A ott, Tritl OFFICE OF EDUCATION t,.4 taicta- THIS DOCUMENT HAS BEEN REPRO- DUCED EXACTLY AS RECEIVED FROM THE PERSON OR ORGANIZATION ORIG- '14r- C-1"?Fig ErtrIgf7t Or>re!9,1 2 INATING IT. POINTS OF VIEW OR OPIN- 616 ti LiS kC..".4 .2) szyj /ONS STATED DO NOT NECESSARILY cp-S.e REPRESENT OFFICIAL OFFICE OF EDU- CATION POSITION OR POLICY. By Affred M. Bork r,9 he digital computer is a powerful, calculating. andwhat the programmer wants it to do. For convenience, L logical device.
    [Show full text]
  • The Semantics of Syntax Applying Denotational Semantics to Hygienic Macro Systems
    The Semantics of Syntax Applying Denotational Semantics to Hygienic Macro Systems Neelakantan R. Krishnaswami University of Birmingham <[email protected]> 1. Introduction body of a macro definition do not interfere with names oc- Typically, when semanticists hear the words “Scheme” or curring in the macro’s arguments. Consider this definition of and “Lisp”, what comes to mind is “untyped lambda calculus a short-circuiting operator: plus higher-order state and first-class control”. Given our (define-syntax and typical concerns, this seems to be the essence of Scheme: it (syntax-rules () is a dynamically typed applied lambda calculus that sup- ((and e1 e2) (let ((tmp e1)) ports mutable data and exposes first-class continuations to (if tmp the programmer. These features expose a complete com- e2 putational substrate to programmers so elegant that it can tmp))))) even be characterized mathematically; every monadically- representable effect can be implemented with state and first- In this definition, even if the variable tmp occurs freely class control [4]. in e2, it will not be in the scope of the variable definition However, these days even mundane languages like Java in the body of the and macro. As a result, it is important to support higher-order functions and state. So from the point interpret the body of the macro not merely as a piece of raw of view of a working programmer, the most distinctive fea- syntax, but as an alpha-equivalence class. ture of Scheme is something quite different – its support for 2.2 Open Recursion macros. The intuitive explanation is that a macro is a way of defining rewrites on abstract syntax trees.
    [Show full text]
  • Concatenative Programming
    Concatenative Programming From Ivory to Metal Jon Purdy ● Why Concatenative Programming Matters (2012) ● Spaceport (2012–2013) Compiler engineering ● Facebook (2013–2014) Site integrity infrastructure (Haxl) ● There Is No Fork: An Abstraction for Efficient, Concurrent, and Concise Data Access (ICFP 2014) ● Xamarin/Microsoft (2014–2017) Mono runtime (performance, GC) What I Want in a ● Prioritize reading & modifying code over writing it Programming ● Be expressive—syntax closely Language mirroring high-level semantics ● Encourage “good” code (reusable, refactorable, testable, &c.) ● “Make me do what I want anyway” ● Have an “obvious” efficient mapping to real hardware (C) ● Be small—easy to understand & implement tools for ● Be a good citizen—FFI, embedding ● Don’t “assume you’re the world” ● Forth (1970) Notable Chuck Moore Concatenative ● PostScript (1982) Warnock, Geschke, & Paxton Programming ● Joy (2001) Languages Manfred von Thun ● Factor (2003) Slava Pestov &al. ● Cat (2006) Christopher Diggins ● Kitten (2011) Jon Purdy ● Popr (2012) Dustin DeWeese ● … History Three ● Lambda Calculus (1930s) Alonzo Church Formal Systems of ● Turing Machine (1930s) Computation Alan Turing ● Recursive Functions (1930s) Kurt Gödel Church’s Lambdas e ::= x Variables λx.x ≅ λy.y | λx. e Functions λx.(λy.x) ≅ λy.(λz.y) | e1 e2 Applications λx.M[x] ⇒ λy.M[y] α-conversion (λx.λy.λz.xz(yz))(λx.λy.x)(λx.λy.x) ≅ (λy.λz.(λx.λy.x)z(yz))(λx.λy.x) (λx.M)E ⇒ M[E/x] β-reduction ≅ λz.(λx.λy.x)z((λx.λy.x)z) ≅ λz.(λx.λy.x)z((λx.λy.x)z) ≅ λz.z Turing’s Machines ⟨ ⟩ M
    [Show full text]
  • A GTK+ Binding to Build Graphical User Interfaces in Fortran Vincent Magnin, James Tappin, Jens Hunger, Jerry De Lisle
    gtk-fortran: a GTK+ binding to build Graphical User Interfaces in Fortran Vincent Magnin, James Tappin, Jens Hunger, Jerry de Lisle To cite this version: Vincent Magnin, James Tappin, Jens Hunger, Jerry de Lisle. gtk-fortran: a GTK+ binding to build Graphical User Interfaces in Fortran. Journal of Open Source Software, Open Journals, 2019, 4 (34), pp.1109. 10.21105/joss.01109. hal-02113675 HAL Id: hal-02113675 https://hal.archives-ouvertes.fr/hal-02113675 Submitted on 29 Apr 2019 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. Distributed under a Creative Commons Attribution| 4.0 International License gtk-fortran: a GTK+ binding to build Graphical User Interfaces in Fortran Vincent MAGNIN1, James TAPPIN2, Jens HUNGER3, and Jerry DE LISLE4 1 Univ. Lille, CNRS, Centrale Lille, ISEN, Univ. Valenciennes, UMR 8520 - IEMN, F-59000 Lille, France 2 RAL Space, STFC Rutherford Appleton Laboratory, Harwell Campus ,Didcot,Oxfordshire OX11 0QX, United Kingdom 3 Technische Universität Dresden, Department of Chemistry and Food Chemistry, Dresden, Germany 4 GFortran Team, USA DOI: 10.21105/joss.01109 Software • Review Summary • Repository • Archive Fortran is still much used in research because it is suited by design to scientific computing Submitted: 11 October 2018 and there is a lot of legacy code written in this language.
    [Show full text]