Git Product home page Git Product logo

2pcc's Introduction

2pcc — the two-phase C compiler

You can either pronounce it as two-pee-see-see or two pieces.

⚠ The development is temporarily suspended due to lack of knowledge in parsers.

Notice: this compiler IS NOT compliant with the ANSI C standard. Some things break compliancy by choice, all the others do so by mistake. Of course I don't know all the ANSI C standard draft by memory.

Introduction

Typically, making an executable file out of source code involves a compiler, which translates the source code into object code, and a linker, which links the object code with prospective libraries. 2pcc takes a different approach: it divides the job into platform-dependent and platform-independent, so that every part does roughly the same amount of work. This allows each part to focus on one job only and therefore achieve simplicity. Platform-independent work is done by a representer while platform-dependent work is done by a realizer.

The 2pcc linker also attempts to statically link shared libraries, so that it is not necessary to build them again. Why? Because dynamic linking was a mistake.

Documentation

You can find some documentation in the doc directory.

Roadmap

☑ = present, tested and working.
☒ = missing, not tested or not working.

Representer

  • ☒ Line reconstruction
  • ☒ Preprocessor
  • ☒ Checks and replacements
    • ☒ Type replacement
    • ☒ Automatic type casting (optional)
    • ☒ Expression validity check
  • ☒ Optimization (optional)
  • ☒ IR code generation
  • ☒ UTF-8 support
  • ☒ Language extensions
    • ☒ Embeddable structures (Go-like composition)
  • ☒ Command line utilities

Realizer

Each realizer has its own roadmap since its development is platform-dependent.

Goals

  • Simplicity
  • Lightness
  • Minimalism

Non-goals

  • Complexity
  • Heavyweight features
  • Extreme code optimization

License

CC0 logo

2pcc is licensed under the Creative Commons Zero (CC0) license.

Attribution is not required by the Creative Commons Zero license. However, I'm happy if you give me credit for my work :)

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.