Computer Programming

Total Page:16

File Type:pdf, Size:1020Kb

Computer Programming The future of (super) Computer Programming Bent Thomsen [email protected] Department of Computer Science Aalborg University 1 eScience: Simulation - The Third Pillar of Science • Traditional scientific and engineering paradigm: 1) Do theory or paper design. 2) Perform experiments or build system. • Limitations: - Too difficult -- build large wind tunnels. - Too expensive -- build a throw-away passenger jet. - Too slow -- wait for climate or galactic evolution. - Too dangerous -- weapons, drug design, climate experimentation. • Computational science paradigm: 3) Use high performance computer systems to simulate the phenomenon - Base on known physical laws and efficient numerical methods. 2 Exascale computing The United States has put aside $126 million for exascale computing beginning in 2012, in an attempt to overtake China's Tianhe-1A supercomputer as the fastest computing platform in the world. February 21, 2011 3 How to spend a billion dollars Exascale programme builds on the HPCS programme In Phase I (June 2002 – June 2003) Cray, IBM, SUN, HP, SGI, MITRE spent $250 million In Phase II (July 2003 – June 2006) Cray was awarded a $43.1 million IBM was awarded a $53.3 million SUN was awarded $49.7 million Phase III (July 2006 – December 2010) Cray has been awarded $250 million IBM has been awarded $244 million High Productivity Computing Systems -Program Overview- Create a new generation of economically viable computing systems (2010) and a procurement methodology (2007-2010) for the security/industrial community Half-Way Point Petascale/s Systems Full Scale Phase 2 Development Technology Vendors Assessment Validated Procurement Review Evaluation Methodology Advanced Test Evaluation Design & Framework Prototypes Concept New Evaluation Framework Study Phase 1 Phase 2 Phase 3 (2003-2005) (2006-2010) Petascale Computers • Roadrunner, built by IBM, • first computer to go petascale, May 25, 2008, performance of 1.026 petaflops. • XT5 "Jaguar", built by Cray, • Later in 2008. After an update in 2009, its performance reached 1.759 petaflops. • Nebulae built by Dawning, • third petascale computer and the first built by China, performance of 1.271 petaflops in 2010. • Tianhe-1A built by NUDT, • is the fastest supercomputer in the world, at 2.566 petaflops in 2010. 6 High Productivity Computing Systems Create a new generation of economically viable computing systems (2010) and a procurement methodology (2007-2010) for the security/industrial community Impact: Performance (time-to-solution): speedup critical national security applications by a factor of 10X to 40X Programmability (idea-to-first-solution): reduce cost and time of developing application solutions Portability (transparency): insulate research and operational application software from system Robustness (reliability): apply all known techniques to protect against outside attacks, hardware faults, & HPCS Program Focus Areas programming errors Applications: Intelligence/surveillance, reconnaissance, cryptanalysis, weapons analysis, airborne contaminant modeling and biotechnology Fill the Critical Technology and Capability Gap Today (late 80’s HPC technology)…..to…..Future (Quantum/Bio Computing) HPCS Program Goals Productivity Goals • HPCS overall productivity goals: – Execution (sustained performance) . 1 Petaflop/s . scalable to greater than 4 Petaflop/s – Development . 10X over today’s systems . Reference: Lone researcher and Enterprise workflows Development Lone Researcher Enterprise Execution Visualize Design Theory Port Legacy Software Researcher Enterprise Experiment Simulation 10x improvement in time to first solution! How to increase Programmer Productivity? 3 ways of increasing programmer productivity: 1. Process (software engineering) – Controlling programmers – Good process can yield up to 20% increase 2. Tools (verification, static analysis, program generation) – Good tools can yield up to 10% increase 3. Language design --- the center of the universe! – Core abstractions, mechanisms, services, guarantees – Affect how programmers approach a task (C vs. SML) – New languages can yield 700% increase 9 High Productivity Computing Systems Large Part of HPCS Program focused on Programming Language Development • X10 from IBM – Extended subset of Java based onNon-Uniform Computing Clusters (NUCCs) where different memory locations incur different cost • Chapel from CRAY – Built on HPF and ZPL (based on Modula-2, Pascal, Algol) • Fortress from SUN – Based on “Growwing a Language” philosophy 10 New Programming Languages Why should I bother? • Fortran has been with us since 1954 • C has been with us since 1971 • C++ has been with us from 1983 • Java has been with us since 1995 • C# has been with us since 2000 11 New Programming Languages Why should I bother? • Every generation improves: – Programmer productivity • Higher level of abstraction • Thus reduce time-to-market – Program reuse • Libraries, components, patterns – Program reliability • Thus fewer bugs make it through to product – But usually not performance • Usually lagging five years behind, but will catch-up 12 Programming Language Genealogy Lang History.htm Diagram by Peter Sestoft 13 But why do we need new (HPCS) languages now? • Until about 20 years ago there was a neat correspondence between the Fortran/C/C++/Java/C# programming model and the underlying machines • The only thing that (apparently) changed was that the processors got faster • Moore’s Law (misinterpreted): – The processor speed doubles every 18 months – Almost every measure of the capabilities of digital electronic devices is linked to Moore's Law: processing speed, memory capacity, … (source Wikipedia) 14 The Hardware world is changing! 15 Moore’s Law • Popular belief: – Moore’s Law stopped working in 2005! • Moore’s Law (misinterpreted): – The processor speed doubles every 18 months • Moore’s Law still going strong – the number of transistors per unit area on a chip doubles every 18 months • Instead of using more and more HW real-estate on cache memory it is now used for multiple cores 16 The IT industry wakeup call • The super computing community discovered the change in hardware first • The rest of the computing industry have started to worry “Multicore: This is the one which will have the biggest impact on us. We have never had a problem to solve like this. A breakthrough is needed in how applications are done on multicore devices.” – Bill Gates 17 What is the most expensive operation in this line of C code? • int x = (3.14 * r) + (x * y); 18 A programmer’s view of memory This model was pretty accurate in 1985. Processors (386, ARM, MIPS, SPARC) all ran at 1–10MHz clock speed and could access external memory in 1 cycle; and most instructions took 1 cycle. Indeed the C language was as expressively time-accurate as a language could be: almost all C operators took one or two cycles. But this model is no longer accurate! 19 A modern view of memory timings So what happened? On-chip computation (clock-speed) sped up faster (1985–2005) than off-chip communication (with memory) as feature sizes shrank. The gap was filled by spending transistor budget on caches which (statistically) filled the mismatch until 2005 or so. Techniques like caches, deep pipelining with bypasses, and superscalar instruction issue burned power to preserve our illusions. 2005 or so was crunch point as faster, hotter, single-CPU Pentiums were scrapped. These techniques had delayed the inevitable. 20 The Current Mainstream Processor Will scale to 2, 4 maybe 8 processors. But ultimately shared memory becomes the bottleneck (1024 processors?!?). 21 Angela C. Sodan, Jacob Machina, Arash Deshmeh, Kevin Macnaughton, Bryan Esbaugh, "Parallelism via Multithreaded and Multicore CPUs," Computer, pp. 24- 32, March, 2010 22 Angela C. Sodan, Jacob Machina, Arash Deshmeh, Kevin Macnaughton, Bryan Esbaugh, "Parallelism via Multithreaded and Multicore CPUs," Computer, pp. 24- 32, March, 2010 23 Hardware will change • Cell – Multi-core with 1 PPC + 8(6) SPE (SIMD) – 3 level memory hierarchy – broadcast communication •GPU – 256 SIMD HW treads – Data parallel memory • FPGA … (build your own hardware) 24 Super Computer Organisation 25 Locality and Parallelism Proc Proc Cache Cache L2 Cache L2 Cache interconnects potential L3 Cache L3 Cache Memory Memory • Large memories are slow, fast memories are small. • Storage hierarchies are large and fast on average. • Parallel processors, collectively, have large, fast memories -- the slow accesses to “remote” data we call “communication”. 26 • Algorithm should do most work on local data. Memory Hierarchy • Most programs have a high degree of locality in their accesses • spatial locality: accessing things nearby previous accesses • temporal locality: reusing an item that was previously accessed • Memory hierarchy tries to exploit locality processor control Second Main Secondary Tertiary level memory storage storage cache (Disk) datapath (SRAM) (DRAM) (Disk/Tape) on-chip registers cache Speed (ns): 1 10 100 10 ms 10 sec Size (bytes): 100s KB MB GB TB 27 Programming model(s) reflecting the new world are called for • Algorithm should do most work on local data !! • Programmers need to – make decisions on parallel execution – know what is local and what is not – need to deal with communication • But how can the poor programmer ensure this? • She/he has to exploit: – Data Parallelism and memory parallelism – Task parallelism and instruction parallelism • She/he needs programming language constructs to help her/him 28 Domain deposition 29 Domain
Recommended publications
  • Programming Paradigms & Object-Oriented
    4.3 (Programming Paradigms & Object-Oriented- Computer Science 9608 Programming) with Majid Tahir Syllabus Content: 4.3.1 Programming paradigms Show understanding of what is meant by a programming paradigm Show understanding of the characteristics of a number of programming paradigms (low- level, imperative (procedural), object-oriented, declarative) – low-level programming Demonstrate an ability to write low-level code that uses various address modes: o immediate, direct, indirect, indexed and relative (see Section 1.4.3 and Section 3.6.2) o imperative programming- see details in Section 2.3 (procedural programming) Object-oriented programming (OOP) o demonstrate an ability to solve a problem by designing appropriate classes o demonstrate an ability to write code that demonstrates the use of classes, inheritance, polymorphism and containment (aggregation) declarative programming o demonstrate an ability to solve a problem by writing appropriate facts and rules based on supplied information o demonstrate an ability to write code that can satisfy a goal using facts and rules Programming paradigms 1 4.3 (Programming Paradigms & Object-Oriented- Computer Science 9608 Programming) with Majid Tahir Programming paradigm: A programming paradigm is a set of programming concepts and is a fundamental style of programming. Each paradigm will support a different way of thinking and problem solving. Paradigms are supported by programming language features. Some programming languages support more than one paradigm. There are many different paradigms, not all mutually exclusive. Here are just a few different paradigms. Low-level programming paradigm The features of Low-level programming languages give us the ability to manipulate the contents of memory addresses and registers directly and exploit the architecture of a given processor.
    [Show full text]
  • Software Development Career Pathway
    Career Exploration Guide Software Development Career Pathway Information Technology Career Cluster For more information about NYC Career and Technical Education, visit: www.cte.nyc Summer 2018 Getting Started What is software? What Types of Software Can You Develop? Computers and other smart devices are made up of Software includes operating systems—like Windows, Web applications are websites that allow users to contact management system, and PeopleSoft, a hardware and software. Hardware includes all of the Apple, and Google Android—and the applications check email, share documents, and shop online, human resources information system. physical parts of a device, like the power supply, that run on them— like word processors and games. among other things. Users access them with a Mobile applications are programs that can be data storage, and microprocessors. Software contains Software applications can be run directly from a connection to the Internet through a web browser accessed directly through mobile devices like smart instructions that are stored and run by the hardware. device or through a connection to the Internet. like Firefox, Chrome, or Safari. Web browsers are phones and tablets. Many mobile applications have Other names for software are programs or applications. the platforms people use to find, retrieve, and web-based counterparts. display information online. Web browsers are applications too. Desktop applications are programs that are stored on and accessed from a computer or laptop, like Enterprise software are off-the-shelf applications What is Software Development? word processors and spreadsheets. that are customized to the needs of businesses. Popular examples include Salesforce, a customer Software development is the design and creation of Quality Testers test the application to make sure software and is usually done by a team of people.
    [Show full text]
  • Chapter 1 Introduction to Computers, Programs, and Java
    Chapter 1 Introduction to Computers, Programs, and Java 1.1 Introduction • The central theme of this book is to learn how to solve problems by writing a program . • This book teaches you how to create programs by using the Java programming languages . • Java is the Internet program language • Why Java? The answer is that Java enables user to deploy applications on the Internet for servers , desktop computers , and small hand-held devices . 1.2 What is a Computer? • A computer is an electronic device that stores and processes data. • A computer includes both hardware and software. o Hardware is the physical aspect of the computer that can be seen. o Software is the invisible instructions that control the hardware and make it work. • Computer programming consists of writing instructions for computers to perform. • A computer consists of the following hardware components o CPU (Central Processing Unit) o Memory (Main memory) o Storage Devices (hard disk, floppy disk, CDs) o Input/Output devices (monitor, printer, keyboard, mouse) o Communication devices (Modem, NIC (Network Interface Card)). Bus Storage Communication Input Output Memory CPU Devices Devices Devices Devices e.g., Disk, CD, e.g., Modem, e.g., Keyboard, e.g., Monitor, and Tape and NIC Mouse Printer FIGURE 1.1 A computer consists of a CPU, memory, Hard disk, floppy disk, monitor, printer, and communication devices. CMPS161 Class Notes (Chap 01) Page 1 / 15 Kuo-pao Yang 1.2.1 Central Processing Unit (CPU) • The central processing unit (CPU) is the brain of a computer. • It retrieves instructions from memory and executes them.
    [Show full text]
  • The Machine That Builds Itself: How the Strengths of Lisp Family
    Khomtchouk et al. OPINION NOTE The Machine that Builds Itself: How the Strengths of Lisp Family Languages Facilitate Building Complex and Flexible Bioinformatic Models Bohdan B. Khomtchouk1*, Edmund Weitz2 and Claes Wahlestedt1 *Correspondence: [email protected] Abstract 1Center for Therapeutic Innovation and Department of We address the need for expanding the presence of the Lisp family of Psychiatry and Behavioral programming languages in bioinformatics and computational biology research. Sciences, University of Miami Languages of this family, like Common Lisp, Scheme, or Clojure, facilitate the Miller School of Medicine, 1120 NW 14th ST, Miami, FL, USA creation of powerful and flexible software models that are required for complex 33136 and rapidly evolving domains like biology. We will point out several important key Full list of author information is features that distinguish languages of the Lisp family from other programming available at the end of the article languages and we will explain how these features can aid researchers in becoming more productive and creating better code. We will also show how these features make these languages ideal tools for artificial intelligence and machine learning applications. We will specifically stress the advantages of domain-specific languages (DSL): languages which are specialized to a particular area and thus not only facilitate easier research problem formulation, but also aid in the establishment of standards and best programming practices as applied to the specific research field at hand. DSLs are particularly easy to build in Common Lisp, the most comprehensive Lisp dialect, which is commonly referred to as the “programmable programming language.” We are convinced that Lisp grants programmers unprecedented power to build increasingly sophisticated artificial intelligence systems that may ultimately transform machine learning and AI research in bioinformatics and computational biology.
    [Show full text]
  • Functional and Imperative Object-Oriented Programming in Theory and Practice
    Uppsala universitet Inst. för informatik och media Functional and Imperative Object-Oriented Programming in Theory and Practice A Study of Online Discussions in the Programming Community Per Jernlund & Martin Stenberg Kurs: Examensarbete Nivå: C Termin: VT-19 Datum: 14-06-2019 Abstract Functional programming (FP) has progressively become more prevalent and techniques from the FP paradigm has been implemented in many different Imperative object-oriented programming (OOP) languages. However, there is no indication that OOP is going out of style. Nevertheless the increased popularity in FP has sparked new discussions across the Internet between the FP and OOP communities regarding a multitude of related aspects. These discussions could provide insights into the questions and challenges faced by programmers today. This thesis investigates these online discussions in a small and contemporary scale in order to identify the most discussed aspect of FP and OOP. Once identified the statements and claims made by various discussion participants were selected and compared to literature relating to the aspects and the theory behind the paradigms in order to determine whether there was any discrepancies between practitioners and theory. It was done in order to investigate whether the practitioners had different ideas in the form of best practices that could influence theories. The most discussed aspect within FP and OOP was immutability and state relating primarily to the aspects of concurrency and performance. ​ ​ ​ ​ ​ ​ This thesis presents a selection of representative quotes that illustrate the different points of view held by groups in the community and then addresses those claims by investigating what is said in literature.
    [Show full text]
  • Functional and Logic Programming - Wolfgang Schreiner
    COMPUTER SCIENCE AND ENGINEERING - Functional and Logic Programming - Wolfgang Schreiner FUNCTIONAL AND LOGIC PROGRAMMING Wolfgang Schreiner Research Institute for Symbolic Computation (RISC-Linz), Johannes Kepler University, A-4040 Linz, Austria, [email protected]. Keywords: declarative programming, mathematical functions, Haskell, ML, referential transparency, term reduction, strict evaluation, lazy evaluation, higher-order functions, program skeletons, program transformation, reasoning, polymorphism, functors, generic programming, parallel execution, logic formulas, Horn clauses, automated theorem proving, Prolog, SLD-resolution, unification, AND/OR tree, constraint solving, constraint logic programming, functional logic programming, natural language processing, databases, expert systems, computer algebra. Contents 1. Introduction 2. Functional Programming 2.1 Mathematical Foundations 2.2 Programming Model 2.3 Evaluation Strategies 2.4 Higher Order Functions 2.5 Parallel Execution 2.6 Type Systems 2.7 Implementation Issues 3. Logic Programming 3.1 Logical Foundations 3.2. Programming Model 3.3 Inference Strategy 3.4 Extra-Logical Features 3.5 Parallel Execution 4. Refinement and Convergence 4.1 Constraint Logic Programming 4.2 Functional Logic Programming 5. Impacts on Computer Science Glossary BibliographyUNESCO – EOLSS Summary SAMPLE CHAPTERS Most programming languages are models of the underlying machine, which has the advantage of a rather direct translation of a program statement to a sequence of machine instructions. Some languages, however, are based on models that are derived from mathematical theories, which has the advantages of a more concise description of a program and of a more natural form of reasoning and transformation. In functional languages, this basis is the concept of a mathematical function which maps a given argument values to some result value.
    [Show full text]
  • Introduction to High Performance Computing
    Introduction to High Performance Computing Shaohao Chen Research Computing Services (RCS) Boston University Outline • What is HPC? Why computer cluster? • Basic structure of a computer cluster • Computer performance and the top 500 list • HPC for scientific research and parallel computing • National-wide HPC resources: XSEDE • BU SCC and RCS tutorials What is HPC? • High Performance Computing (HPC) refers to the practice of aggregating computing power in order to solve large problems in science, engineering, or business. • Purpose of HPC: accelerates computer programs, and thus accelerates work process. • Computer cluster: A set of connected computers that work together. They can be viewed as a single system. • Similar terminologies: supercomputing, parallel computing. • Parallel computing: many computations are carried out simultaneously, typically computed on a computer cluster. • Related terminologies: grid computing, cloud computing. Computing power of a single CPU chip • Moore‘s law is the observation that the computing power of CPU doubles approximately every two years. • Nowadays the multi-core technique is the key to keep up with Moore's law. Why computer cluster? • Drawbacks of increasing CPU clock frequency: --- Electric power consumption is proportional to the cubic of CPU clock frequency (ν3). --- Generates more heat. • A drawback of increasing the number of cores within one CPU chip: --- Difficult for heat dissipation. • Computer cluster: connect many computers with high- speed networks. • Currently computer cluster is the best solution to scale up computer power. • Consequently software/programs need to be designed in the manner of parallel computing. Basic structure of a computer cluster • Cluster – a collection of many computers/nodes. • Rack – a closet to hold a bunch of nodes.
    [Show full text]
  • 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]
  • Logic Programming Logic Department of Informatics Informatics of Department Based on INF 3110 – 2016 2
    Logic Programming INF 3110 3110 INF Volker Stolz – 2016 [email protected] Department of Informatics – University of Oslo Based on slides by G. Schneider, A. Torjusen and Martin Giese, UiO. 1 Outline ◆ A bit of history ◆ Brief overview of the logical paradigm 3110 INF – ◆ Facts, rules, queries and unification 2016 ◆ Lists in Prolog ◆ Different views of a Prolog program 2 History of Logic Programming ◆ Origin in automated theorem proving ◆ Based on the syntax of first-order logic ◆ 1930s: “Computation as deduction” paradigm – K. Gödel 3110 INF & J. Herbrand – ◆ 1965: “A Machine-Oriented Logic Based on the Resolution 2016 Principle” – Robinson: Resolution, unification and a unification algorithm. • Possible to prove theorems of first-order logic ◆ Early seventies: Logic programs with a restricted form of resolution introduced by R. Kowalski • The proof process results in a satisfying substitution. • Certain logical formulas can be interpreted as programs 3 History of Logic Programming (cont.) ◆ Programming languages for natural language processing - A. Colmerauer & colleagues ◆ 1971–1973: Prolog - Kowalski and Colmerauer teams 3110 INF working together ◆ First implementation in Algol-W – Philippe Roussel – 2016 ◆ 1983: WAM, Warren Abstract Machine ◆ Influences of the paradigm: • Deductive databases (70’s) • Japanese Fifth Generation Project (1982-1991) • Constraint Logic Programming • Parts of Semantic Web reasoning • Inductive Logic Programming (machine learning) 4 Paradigms: Overview ◆ Procedural/imperative Programming • A program execution is regarded as a sequence of operations manipulating a set of registers (programmable calculator) 3110 INF ◆ Functional Programming • A program is regarded as a mathematical function – 2016 ◆ Object-Oriented Programming • A program execution is regarded as a physical model simulating a real or imaginary part of the world ◆ Constraint-Oriented/Declarative (Logic) Programming • A program is regarded as a set of equations ◆ Aspect-Oriented, Intensional, ..
    [Show full text]
  • Multi-Paradigm Declarative Languages*
    c Springer-Verlag In Proc. of the International Conference on Logic Programming, ICLP 2007. Springer LNCS 4670, pp. 45-75, 2007 Multi-paradigm Declarative Languages⋆ Michael Hanus Institut f¨ur Informatik, CAU Kiel, D-24098 Kiel, Germany. [email protected] Abstract. Declarative programming languages advocate a program- ming style expressing the properties of problems and their solutions rather than how to compute individual solutions. Depending on the un- derlying formalism to express such properties, one can distinguish differ- ent classes of declarative languages, like functional, logic, or constraint programming languages. This paper surveys approaches to combine these different classes into a single programming language. 1 Introduction Compared to traditional imperative languages, declarative programming lan- guages provide a higher and more abstract level of programming that leads to reliable and maintainable programs. This is mainly due to the fact that, in con- trast to imperative programming, one does not describe how to obtain a solution to a problem by performing a sequence of steps but what are the properties of the problem and the expected solutions. In order to define a concrete declarative language, one has to fix a base formalism that has a clear mathematical founda- tion as well as a reasonable execution model (since we consider a programming language rather than a specification language). Depending on such formalisms, the following important classes of declarative languages can be distinguished: – Functional languages: They are based on the lambda calculus and term rewriting. Programs consist of functions defined by equations that are used from left to right to evaluate expressions.
    [Show full text]
  • From JSON to JSEN Through Virtual Languages of the Creative Commons Attribution License (
    © 2021 by the authors; licensee RonPub, Lübeck, Germany. This article is an open access article distributed under the terms and conditions A.of Ceravola, the Creative F. Joublin:Commons From Attribution JSON to license JSEN through(http://c reativecommons.org/licenses/by/4Virtual Languages .0/). Open Access Open Journal of Web Technology (OJWT) Volume 8, Issue 1, 2021 www.ronpub.com/ojwt ISSN 2199-188X From JSON to JSEN through Virtual Languages Antonello Ceravola, Frank Joublin Honda Research Institute Europe GmbH, Carl Legien Str. 30, Offenbach/Main, Germany, {Antonello.Ceravola, Frank.Joublin}@honda-ri.de ABSTRACT In this paper we describe a data format suitable for storing and manipulating executable language statements that can be used for exchanging/storing programs, executing them concurrently and extending homoiconicity of the hosting language. We call it JSEN, JavaScript Executable Notation, which represents the counterpart of JSON, JavaScript Object Notation. JSON and JSEN complement each other. The former is a data format for storing and representing objects and data, while the latter has been created for exchanging/storing/executing and manipulating statements of programs. The two formats, JSON and JSEN, share some common properties, reviewed in this paper with a more extensive analysis on what the JSEN data format can provide. JSEN extends homoiconicity of the hosting language (in our case JavaScript), giving the possibility to manipulate programs in a finer grain manner than what is currently possible. This property makes definition of virtual languages (or DSL) simple and straightforward. Moreover, JSEN provides a base for implementing a type of concurrent multitasking for a single-threaded language like JavaScript.
    [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]