Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The Snazzy D Compiler

License

NotificationsYou must be signed in to change notification settings

snazzy-d/sdc

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.

Goals

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.

What Can It Compile?

See thetests directory for a sample of what is/should-be working. You canalso buildSDC's runtime library, that is compiled using SDC.

Compiling SDC on Linux

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 .

Compiling SDC on Mac OS X

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 .

Building SDC as a Nix package

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

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp