GDC

From D Wiki
Revision as of 09:30, 23 February 2014 by Verax (talk | contribs) (ARM Cortex-M)
Jump to: navigation, search

Compilers: OverviewDMDGDCLDC

Welcome to GDC. This project aims to continue the development of GDC, a GCC frontend for the D programming language.

Useful Links

Introduction

What is GDC?

GDC is a frontend for the D programming language. By using GCC as a backend, it gives us the ability to target the same platforms that GCC targets.

This project was originally started by David Friedman. His first announcement can be found here and his original project page can be found here. Unfortunately, he disappeared from the D scene, and was no longer able to maintain GDC. This project was the result of an effort to help continue David Friedman's work on GDC.

Why GDC?

There are many advantages to adding a D frontend to GCC, and most of them stem from the fact that the GCC codebase has been the focus of extensive development over several decades, and that the GCC middle and back ends are designed such that multiple languages can easily take advantage of them. This means that a D frontend that can make use of the GCC middle and backend code will gain many advantages that would require years of development to match in the DMD codebase.

Firstly, GCC targets many more platforms than DMD.

Secondly, GCC has a very well-developed optimization framework that can generally generate more performant code than DMD, particularly when taking advantage of more recent CPU features such as SIMD instructions (both directly and through automatic vectorization).

Thirdly, GDB is primarily developed to debug code generated by GCC, so debugging code generated by GCC will generally result in a better user experience.

Status

D2 Frontend Version: 2.064

Supported GCC versions

Documentation

Installation Guide

This documentation page includes information on building and installing GDC alongside your system's host compilers.

Developer Documentation

This documentation page includes information about the internals of GDC, and will most likely only be of use to you if you want to help with the development of GDC.

User Documentation

This documentation page aims to explain a couple of aspects of GDC to user, such as its usage, differences from DMD, and known issues. If can't figure out how to use GDC, take a look here.

Target Documentation

MinGW

This documentation page aims to explain aspects of the MinGW port of GDC. Such as MinGW specific features, Windows specific topics and known issues.

ARM Cortex-M

In December 2013 an effort was launched to bring D to the ARM Cortex-M family of MCUs. GDC is currently the compiler of choice, and development is currently taking place here.

A minimal "Hello World!" example that requires no D runtime, no standard library (Phobos), and no C can be found here. It serves as an excellent starting point for anyone wishing to pursue their own port of D to the ARM Cortex-M family of microcontrollers.

See Bare Metal ARM Cortex-M GDC Cross Compiler for instructions specific to building a bare metal ARM Cortex-M GDC cross compiler.

Binary Releases

By host:

Support

Support can be found in a couple of different places:

  • On irc.freenode.net, there is a GDC irc channel. It is channel #d.gdc.
  • The D.gnu newsgroup, located here.
  • Sending an inbox message to one of the maintainers.

The D.gnu newsgroup should also be used for general discussion about GDC. A bug, proposal, or enhancement can go to the issue tracker. If you choose to use the issue tracker, please label the issue appropriately. (bug, proposal, enhancement)

Bugs

A list of open bugs can be found here. Bugs created before this repository was made can be found here. These lists are still maintained, however, new bugs should be submitted to the GDC Bugzilla site. A simple comment saying "This also happens/doesn't happen on Mac\Windows\Linux under GCC x.x.x(GCC version)" can be useful in helping solve the bug.

If you have found a possible bug in GDC, please submit it! Here are some guidelines that you should follow when submitting a bug:

  1. Make sure the bug has not already been submitted to GDC.
  2. Include the GCC version. (e.g. 4.7.0, etc)
  3. Include the git changeset you are using for GDC. (e.g. changset 6f03952ff48f)
  4. Include your operating system.(Mac/Windows/flavour of Linux)
  5. Include a simple test case demonstrating the issue.
  6. if possible, include a patch to fix the issue.

Getting Involved

GDC is currently developed by a very small group (as the commit history on GitHub shows). While the addition of a D frontend to GCC represents a great step forward for D, it also represents an informal promise by the D community to keep the D frontend up to date with the latest GCC development.

If you use GDC, we encourage you to try to contribute, whether by submitting pull requests or bug reports. In the past, GDC has nearly died due to poor communication and lack of development. Avoiding those issues is easier than ever before, but GDC will always need a community that's willing to give back.

There are a lot of things that you can do to get involved and help out with GDC. They vary from making simple documentation for some of the files, finding and submitting bugs, testing out bugs on different platforms, or submitting patches for GDC. Any help is appreciated.

Please see Project Ideas for inspiration.