Difference between revisions of "SAPL"

From Clean
Jump to navigationJump to search
Line 9: Line 9:
  
 
SAPL infrastructure consists of a few main parts built around the [[SAPL Language]].
 
SAPL infrastructure consists of a few main parts built around the [[SAPL Language]].
# '''Source filters'''. Convert the source language to the SAPL language. Currently we have source filters for Clean and Haskell/GHC. For Clean, the filter is integrated into the compiler. As for Haskell/GHC, a separate compiler is provided based on the original one.
+
=== Source filters === Source filters convert the source language to the SAPL language. Currently we have source filters for Clean and Haskell/GHC. For Clean, the filter is integrated into the compiler. As for Haskell/GHC, a separate compiler is provided based on the original one.
 
# '''SAPL linker'''. It collects and combine, starting with some root expressions, the necessary functions recursively into one SAPL file. This helps with minimizing the size of the output code.
 
# '''SAPL linker'''. It collects and combine, starting with some root expressions, the necessary functions recursively into one SAPL file. This helps with minimizing the size of the output code.
 
# '''Flavours'''. A flavour is a kind of configuration file used by the target compilers. It provides information about how to compile the built-in functions of a given source language to a given target language.
 
# '''Flavours'''. A flavour is a kind of configuration file used by the target compilers. It provides information about how to compile the built-in functions of a given source language to a given target language.

Revision as of 17:11, 16 January 2014

SAPL

SAPL is a purely functional, intermediate language and related infrastructure for supporting cross-compilation of lazy functional languages to different target platforms. It currently supports Clean and Haskell/GHC as source languages and provides JavaScript as target platform, however a DART target is under development. SAPL is extensively used in the ITasks project, furthermore various GHC based projects are experimenting with SAPL.

Overview

SAPL infrastructure consists of a few main parts built around the SAPL Language. === Source filters === Source filters convert the source language to the SAPL language. Currently we have source filters for Clean and Haskell/GHC. For Clean, the filter is integrated into the compiler. As for Haskell/GHC, a separate compiler is provided based on the original one.

  1. SAPL linker. It collects and combine, starting with some root expressions, the necessary functions recursively into one SAPL file. This helps with minimizing the size of the output code.
  2. Flavours. A flavour is a kind of configuration file used by the target compilers. It provides information about how to compile the built-in functions of a given source language to a given target language.
  3. Target compilers. A target compiler transforms SAPL code into a given target language. The compilation must be aided by a flavour for the correct compilation of the built-in functions.
  4. Target run-time. Run-time functions are necessary to execute the target code. Some of these are independent of the source language and cope with e.g. lazy evaluation, while some are dependent of the source language and must be in sync with the source filter and the supporting flavour.

Getting started

So far, no official version of the SAPL compiler infrastructure is released. The current development version can be checked out from https://svn.cs.ru.nl/repos/clean-sapl. Build instructions can be found at SAPL/Build

GHC

Clean

Tutorial (GHC)

Before you engage in following this tutorial, please make sure you successfully installed the SAPL system as it is written at SAPL/Build.

TODO

News

  • January 2 2014: The first draft version of the SAPL wiki is added