- Notifications
You must be signed in to change notification settings - Fork57
snazzy-d/sdc
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This is the home of aD compiler. SDC is at the moment, particularlystupid; it is a work in progress. Feel free to poke around, but don't expect itto compile your code.
The project currently provides a collection of tools:
- sdc, the D compiler.
- sdunit, an utility to run the unit tests in D modules.
- sdfmt, a code formatter for D.
This compiler is based onlibd for D code analysis. It usesLLVM andlibd-llvm for codegen and JIT CTFE. It useslibsdrt to support variousruntime facilities required by programs compiled by SDC.
The code is released under the MIT license (see the LICENCE file for moredetails). Contact me atdeadalnix@gmail.com.
SDC requires latest DMD release to compile.
Right now, SDC is a work in progress and unusable for any production work. Itsintent is to provide a D compiler as a library (libd) in order to improve theoverall D toolchain by enabling the possibility of developing new tools.
SDC now supports many very advanced features (static ifs, string mixins, CTFE)of D, but not many basic ones. This is a development choice to allow thearchitecturing of the compiler around the hardest features of the language. As aconsequence, SDC has a solid base to build upon.
See thetests directory for a sample of what is/should-be working. You canalso buildSDC's runtime library, that is compiled using SDC.
You'll needmake and the latest DMD installed and LLVM 20.
Runmake.
Then you can run the test suite usingmake check. There should be noregressions.
SDC requires a recent version of LLVM. If the default llvm-config on your systemis too old, you can specify a newer version viaLLVM_CONFIG. For instance, ona debian system, you want to useLLVM_CONFIG=llvm-config-11 make .
You'll needmake and the latest DMD installed. You'll also need a recentversion of LLVM if you don't already have it. One way to install llvm that'sbeen tested is to useHomebrew, a package manager for OS X. Afterinstalling it by following instructions from the web page, run the commandbrew install llvm11, followed byLLVM_CONFIG=llvm-config-11 make . If youare usingMacPorts instead, you can runsudo port install llvm-11,followed byLLVM_CONFIG=llvm-config-mp-11 make .
On Linux, you can also use theNix package manager to automatically fetchdependencies and build SDC for you. You may need to use the unstable nixchannel, to have a new enoughdmd to build SDC. Clone or download thisrepository.
To build the executable, runnix-build -E "(import <nixpkgs> {}).callPackage ./. {}" ornix-build -E "(import <nixpkgs> {}).callPackage ./. {dflags=\"-O -release\";}"from the project root directory.
About
The Snazzy D Compiler
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.