Giter Site home page Giter Site logo

brianush1 / sdc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snazzy-d/sdc

0.0 0.0 0.0 14.6 MB

The Snazzy D Compiler

License: MIT License

Shell 0.45% C++ 3.54% Python 0.05% C 10.83% D 83.68% Assembly 0.08% Nix 0.06% Makefile 0.81% DTrace 0.50%

sdc's Introduction

SDC - The Snazzy D Compiler

This is the home of a D compiler. SDC is at the moment, particularly stupid; it is a work in progress. Feel free to poke around, but don't expect it to compile your code.

The project currently provides a collection of tools:

  • sdc, the D compiler.
  • sduint, an utility to runt he unit tests in D modules.
  • sdfmt, a code formatter for D.

This compiler is based on libd for D code analysis. It uses LLVM and libd-llvm for codegen and JIT CTFE. It uses libsdrt to support various runtime facilities required by programs compiled by SDC.

The code is released under the MIT license (see the LICENCE file for more details). Contact me at [email protected].

SDC requires latest DMD release to compile.

Goals

Right now, SDC is a work in progress and unusable for any production work. Its intent is to provide a D compiler as a library (libd) in order to improve the overall 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 the architecturing of the compiler around the hardest features of the language. As a consequence, SDC has a solid base to build upon.

What Can It Compile?

See the tests directory for a sample of what is/should-be working. You can also build SDC's runtime library, that is compiled using SDC.

Compiling SDC on Linux

You'll need make and the latest DMD installed and a recent version of LLVM.

Run make.

Then you can runt he test suite using make check. There should be no regressions.

SDC requires a recent version of LLVM. If the default llvm-config on your system is too old, you can specify a newer version via LLVM_CONFIG. For instance, on a debian system, you want to use LLVM_CONFIG=llvm-config-11 make .

Compiling SDC on Mac OS X

You'll need make and the latest DMD installed. You'll also need a recent version of LLVM if you don't already have it. One way to install llvm that's been tested is to use Homebrew, a package manager for OS X. After installing it by following instructions from the web page, run the command brew install llvm11, followed by LLVM_CONFIG=llvm-config-11 make . If you are using MacPorts instead, you can run sudo port install llvm-11, followed by LLVM_CONFIG=llvm-config-mp-11 make . You'll also need a recent version of nasm; if nasm does not recognise the macho64 output format, try upgrading nasm to a newer version.

Building SDC as a Nix package

On Linux, you can also use the Nix package manager to automatically fetch dependencies and build SDC for you. You may need to use the unstable nix channel, to have a new enough dmd to build SDC. Clone or download this repository.

To build the executable, run nix-build -E "(import <nixpkgs> {}).callPackage ./. {}" or nix-build -E "(import <nixpkgs> {}).callPackage ./. {dflags=\"-O -release\";}" from the project root directory.

sdc's People

Contributors

aatch avatar bakkegaard avatar bhelyer avatar bpr avatar carlor avatar deadalnix avatar dmitryolshansky avatar dnadlinger avatar dukc avatar dymk avatar georgethomas111 avatar groterik avatar johanengelen avatar john-colvin avatar kinke avatar lindt avatar maxhaton avatar panke avatar qno avatar redstar avatar schancel avatar schuetzm avatar sidmutha avatar timotheecour avatar uplinkcoder avatar vivekvpandya avatar wallbraker avatar webdrake avatar zoadian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.