Delight

Aug 2009, Thomas Leonard

Warning: This code is in the early stages of development. The examples given in these pages should all work (though possibly only with the GIT version), but many things are still missing.

Getting the Delight Compiler

These instructions have been tested on Ubuntu/Hardy. They should work with minor modifications on other (x86 and x86_64) Linux distributions. For other platforms, you'll need to compile from source.

The easiest way to get the Delight compiler is using Zero Install:

$ sudo apt-get install zeroinstall-injector
$ 0alias delic http://delight.sourceforge.net/feed/Delight.xml

This will automatically pull in the core compiler and the standard library.

You will also need the standard C library developer package libc6-dev:

$ sudo apt-get install libc6-dev

Compiling Delight Programs

You can then compile myprog.dlt to a myprog executable like this:

$ delic -o myprog myprog.dlt

The compiler is based on GCC, and mostly accepts the same arguments.

Delight programs require the libdlt.so shared library to be available. Run delic without arguments and it will tell you where to find it (for testing). For a real program, you would add the dependency to the program's feed, e.g.

<?xml version="1.0" ?>
<interface
  xmlns="http://zero-install.sourceforge.net/2004/injector/interface">
  <name>MyProg</name>
  <summary>a test program</summary>
  <description>
    This program does lots of interesting things.
  </description>

  <group>
    <implementation
      id="."
      main="myprog"
      version="1.0"/>
    <requires
      interface="http://delight.sourceforge.net/feed/Delight-stdlib.xml">
      <environment insert="lib" mode="prepend" name="LD_LIBRARY_PATH"/>
    </requires>
  </group>
</interface>

Compiling the Compiler

To compile the compiler itself, you can use 0compile. You can get that like this:

$ 0alias 0compile http://0install.net/2006/interfaces/0compile.xml

Then to download and compile the source code:

$ 0compile setup http://delight.sourceforge.net/feed/Delight-gcc.xml
$ cd Delight-gcc

Next (because gcc likes to write to its source directory while building):

$ 0compile copy-src

On x86_64 platforms, you needs to set CFLAGS:

$ CFLAGS=-m64 0compile build

Otherwise, just do:

$ 0compile build

See the 0compile page for full details.

Compiling the Standard Library

The standard library can be compiled in a similar way:

$ 0compile setup http://delight.sourceforge.net/feed/Delight-stdlib.xml
$ cd Delight-stdlib
$ 0compile build

Cloning the GIT repository

If you're planning to modify the code, it's best to clone the GIT repository:

$ git clone git://repo.or.cz/delight.git
$ cd delight
$ git submodule init
$ git submodule update

If you want to see the changelogs, look in the Core and DltLib sub-modules.