Open Access
Compiling Haskell to JavaScript through Clean's core
László Domoszlai,Rinus Plasmeijer +1 more
- 01 Jan 2012
Vol. 36, pp 117-142
TL;DR: This paper presents a program transformation technique to solve the same problem at another level by transforming STG, the core language of the flagship Haskell compiler GHC to SAPL, thecore language of Clean.
read more
Abstract: Crossing the borders of languages by letting them cooperate on source code level has enormous benefits as different languages have distinct language features and useful libraries to share. This is particularly true for the functional programming world, where languages are in constant development being the target of active research. There already exists a double-edged compiler frontend for the lazy functional languages Haskell and Clean, which enables the interoperation of features of both languages. This paper presents a program transformation technique to solve the same problem at another level by transforming STG, the core language of the flagship Haskell compiler GHC to SAPL, the core language of Clean. By this transformation (1) we have made a Haskell to JavaScript compiler with the advantage that Haskell applications can now be executed e.g. in a browser; (2) since there already existed a Clean to JavaScript compiler, under certain limitations, one can mix Clean and Haskell code because they are compiled to the same target code using the same run-time system and calling convention; (3) one can more easily compare the core code generated by the two compilers and measure their execution times.
read more
Chat with Paper
AI Agents for this Paper
Find similar papers on Google Scholar, PubMed and Arxiv
Write a critical review of this paper
Analyze citations of this paper to find unaddressed research gaps
Citations
Sunroof: A Monadic DSL for Generating JavaScript
Jan Bracker,Andy Gill +1 more
- 20 Jan 2014
TL;DR: This paper gives the design and implementation of Sunroof, a Haskell-hosted Domain Specific Language for generating JavaScript using monadic reification, and generates JavaScript from a deep embedding of the JavaScript monad.
21
Task Oriented Programming and the Internet of Things
Mart Lubbers,Pieter Koopman,Rinus Plasmeijer +2 more
- 05 Sep 2018
TL;DR: This paper shows how IoT tasks can be seemlessly integrated with a Task Oriented Programming (TOP) server such as iTasks, which allows the specification on a high level of abstraction of arbitrary collaborations between human beings, large systems, and now also IoT devices.
9
A Portable VM-based implementation Platform for non-strict Functional Programming Languages
Jan Martin Jansen,John van Groningen +1 more
- 31 Aug 2016
TL;DR: This paper introduces a Virtual Machine that is capable of efficient execution of bytecode generated by a compiler for a non-strict intermediate functional language and obtains a portable execution platform for non-Strict Functional languages with a better client-side performance than existing client- side execution platforms.
2
References
The essence of compiling with continuations
Cormac Flanagan,Amr Sabry,Bruce F. Duba,Matthias Felleisen +3 more
- 01 Jun 1993
TL;DR: The combined effect of the three phases is equivalent to a source-to-source transformation that simulates the compaction phase and fully developed CPS compilers do not need to employ the CPS transformation but can achieve the same results with a simple source-level transformation.
•Proceedings Article
Efficient Interpretation by Transforming Data Types and Patterns to Functions
Jan Martin Jansen,Pieter Koopman,Rinus Plasmeijer +2 more
- 01 Jan 2006
TL;DR: The stepwise construction of an efficient interpreter for lazy functional programming languages like Haskell and Clean is presented, which turns out to be very competitive in a comparison with other interpreters like Hugs, Helium, GHCi and Amanda for a number benchmarks.
34
The reduceron reconfigured
Matthew Naylor,Colin Runciman +1 more
- 27 Sep 2010
TL;DR: This paper presents a processor specially designed to perform graph-reduction, the Reduceron, which is implemented using off-the-shelf reconfigurable hardware and highlights the low-level parallelism present in sequential graph reduction.
Implementing a non-strict purely functional language in JavaScript
Eddy Bru,Jan Martin Jansen +1 more
- 01 Jan 2011
TL;DR: This paper describes an implementation of a non-strict purely functional language in JavaScript based on the translation of a high-level functional language such as Haskell or Clean into JavaScript via the intermediate functional language Sapl, which relies on the use of an evaluator function to emulate the non-Strict semantics of these languages.