Difference between revisions of "SAPL"

From Clean
Jump to navigationJump to search
Line 20: Line 20:
 
The second step is to collect and combine, starting with some root expressions, the necessary functions recursively
 
The second step is to collect and combine, starting with some root expressions, the necessary functions recursively
 
into one SAPL file. Engaging on this linking step helps with reducing the final code size as much as possible.
 
into one SAPL file. Engaging on this linking step helps with reducing the final code size as much as possible.
The linking is done using the `sl` command. A simple example for its usage is as follows:
+
The linking is done using the ´sl´ command. A simple example for its usage is as follows:
  
 
<pre>
 
<pre>
$(SL) --expr=Main.main js/$*.sapl
+
sl --include-dir=build --expr=Main.main out.sapl
 
</pre>
 
</pre>
  
 
+
It links for the `main` function in the `Main` module and collects all the necessary functions into the `out.sapl` file.
  
 
|style="width:30%; vertical-align: top; padding-right: 20px;"|
 
|style="width:30%; vertical-align: top; padding-right: 20px;"|

Revision as of 11:46, 3 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.

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

Tools

Compiling Clean or Haskell to JavaScript consists of three easy steps. First, you need to compile the necessary source code modules to the SAPL language. The execution of this step depends on the source language you would like to use. Instructions for Clean and Haskell/GHC can be found at [[]] and [[]], respectively.

The second step is to collect and combine, starting with some root expressions, the necessary functions recursively into one SAPL file. Engaging on this linking step helps with reducing the final code size as much as possible. The linking is done using the ´sl´ command. A simple example for its usage is as follows:

sl --include-dir=build --expr=Main.main out.sapl

It links for the `main` function in the `Main` module and collects all the necessary functions into the `out.sapl` file.

News

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