Giter VIP home page Giter VIP logo

cuik's Introduction

Cuik (pronounced 'Quick')

warning: unfinished

The plan is a modern C11 compiler which can mostly work with Clang, GCC, and MSVC while also introducing some new ideas.

Why write a C compiler?

  • To improve the compile times on debug builds without sacrificing features like I would with TCC.
  • To test out my upcoming (and currently private) compiler backend.
  • To add some extensions to improve the workflow of C programmers.
  • Because I can.

How to install?

Mac & Linux aren't ready yet but i'll be moving forward to those platforms in the upcoming months

You'll need MSVC installed on windows (i use link.exe for now... sorry, i'll write a linker soon enough)

Just take a C compiler and compile the compile.c file and run it, if you want an optimized build add RELEASE_BUILD as a preprocessor define with -D or /D. Then you should have a cuik executable in your build/ directory, you can add that directory to your path if you want.

How am I doing?

mostly aight, thanks for asking.

What are some cool new things?

One of my favorite new features are the live compiler (essentially an offline Godbolt but within a terminal) and the out of order declarations.

What architectures will you support?

I'll be starting with x64 but I plan on having Aarch64 support soon enough, it's mostly a matter of user-demand what other platforms I add though I probably won't be supporting anything with a segmented address space because I don't want to implement it.

What OSes will you support?

Ideally the essentials like Windows, Linux and MacOS but currently MacOS isn't setup and Linux has basic support (no live compiler)

Will it have optimizations?

It will eventually have a smart but non-aggressive optimizer but that's still a work in progress

What C extensions will you have?

I'll be supporting all the normal extensions such as:

  • pragma once
  • builtin bitmath (popcount, ffs, clz, ctz, etc)
  • __builtin_trap, __builtin_expect
  • x86 SIMD intrinsics
  • typeof
  • case ranges
  • computed goto

And some possibly novel extensions such as:

What's left?

It can currently compile programs using the subset of C it currently supports but it's still missing some essential details before it compiles any basic C program such as:

  • More tests
  • Bug fixes
  • Self hosting
  • Thread local
  • Atomics (halfway there)
  • MSVC extensions
  • GNU extensions
  • Proper Mac/Linux support

PS

If you're wondering about the tinybackend static library, it's essentially a project of mine that's not ready for everyone's precious eyes so i've been sharing it just enough to actually let people play with the compiler but not play with the backend (it'll be open source eventually).

cuik's People

Contributors

realnegate avatar slightknack 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.