---
name: "d2c"
section: "1"
platform: "linux"
package: "gwydion-dylan-dev"
version: "2.3.8pre1-1"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/d2c"
---

# d2c(1)

A Dylan-to-C compiler

## NAME

d2c - A Dylan-to-C compiler

## SYNOPSIS

**d2c** \[ *option* \]... *lidfile*

## WARNING

This man page is intended to supplement the main Gwydion Dylan documentation at *http://www.gwydiondylan.org/*. It provides an incomplete reference of the available options. For a full reference or a tutorial, please see the web site.

## DESCRIPTION

**d2c** is an aggressively optimizing Dylan compiler which generates C code. Under normal cicumstances, it will then automatically invoke your C compiler to generate native executables.

**d2c** supports nearly all of the Dylan language, including the macro system. It can interface with C using [*melange*(1)](/melange/1.md) , and can compile code developed under the [*mindy*(1)](/mindy/1.md) Dylan interpreter.

## PROGRAM STRUCTURE

A Dylan program is made up out of one or more libraries. Each library contains one or more modules, each of which can be defined in one or more source files. **d2c** compiles an entire library at once and performs aggressive inter-file optimizations.

You describe a library by creating a **lid** (library interchange definition) file which lists the files to be compiled and any relevant options. You then feed this file through **d2c** to produce a static library or an executable (shared library support is being debugged at the moment).

You can use the [*make-dylan-app*(1)](/make-dylan-app/1.md) script to create a sample Dylan program composed of a **lid** file and an empty main function.

## OPTIONS

- **--help**

  Print out a message describing the available options.

- **--version**

  Print out the version and copyright.

- **-L, --libdir** *libdir*

  Specify an extra directory to search for compiled Dylan libraries.

- **-D, --define** *feature*

  Define a conditional-compilation feature which can be tested with #if.

- **-U, --undefine** *feature*

  Undefine a conditional-compilation feature which can be tested with #if.

- **-M, --log-deps**

  Write [*make*(1)](/make/1.md) -style dependency information to a file when compiling. You can then include this file into your Makefiles.

- **-T, --target** target

  Generate code for the platform named **target** instead of the native platform.

- **-p, --platforms** *descriptions*

  Get platform descriptions from the file **descriptions** instead of the standard [*platforms.descr*(4)](/platforms.descr/4.md) file.

- **--no-binaries**

  Do not compile generated C files. Often used in conjunction with **-T**.

- **-d, --break**

  Halt the compiler upon encountering an error. This is generally used when debugging **d2c** itself.

- **-F, --cc-override-command** *command*

  Use *command* to invoke the C compiler on certain source files (see below). This can be used to work around bugs in the native C compiler by passing non-standard options.

- **-f, --cc-override-file** *file*

  Mark *file* as using a non-standard command to invoke the C compiler (see above).

- **-g, --debug**

  Try to generate binaries suitable for debugging. At the moment, that means including all declared functions in the generated code.

- **-s, --static**

  Force programs to link against static libraries. This will become more useful once shared libraries are supported, of course.

- **--dump-transforms**

  Display way, way too much information about what **d2c** is doing. If you suspect you've found an optimizer bug, this is the place to start looking.

## BUGS

**d2c** runs very slowly. We need to profile it and speed things up by about an order of magnitude. Harlequin Dylan shows this is possible.

It would be nice to support compilation of single-file Dylan programs, source-level debugging and incremental compilation. Shared library support needs to be fixed, and an efficient solution for the fragile base class problem should be found.

Certain obscure Dylan features are missing, most notably support for creating classes at runtime.

Other bugs can be found on the website.

## SEE ALSO

[dylan(7)](/dylan/7.md), [gwydion(7)](/gwydion/7.md), [melange(1)](/melange/1.md), [make-dylan-app(1)](/make-dylan-app/1.md), [platforms.descr(4)](/platforms.descr/4.md), [mindy(1)](/mindy/1.md).

Much more extensive documentation in various formats is available through the Gwydion Dylan web site at *http://www.gwydiondylan.org/*.

## AUTHORS

The Gwydion Group at CMU and the current Gwydion Dylan maintainers. See the CREDITS file in the Gwydion Dylan distribution for more information.
