robertmuth/Cwerg
소개
1만 줄의 코드로 구현할 수 있는 최고의 C 계열 언어입니다.
프로그래밍 언어 및 런타임측정된 스타 증가
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original ██████╗██╗ ██╗███████╗██████╗ ██████╗
██╔════╝██║ ██║██╔════╝██╔══██╗██╔════╝
██║ ██║ █╗ ██║█████╗ ██████╔╝██║ ███╗
██║ ██║███╗██║██╔══╝ ██╔══██╗██║ ██║
╚██████╗╚███╔███╔╝███████╗██║ ██║╚██████╔╝
╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝
To try out Cwerg, please follow quick_start_user.md
The best C-like language that can be implemented in 10kLOC
Cwerg aims to be a complete, compact and fast "from-scratch" compiler for a C-like language. It has no dependencies and consists of the following components:
Frontend (FE): Overview, Additional Docs, Code
A low-level C-like language with a Python inspired concrete syntax. Still under active development
Intermediate Representation (IR): Overview, Code
Defines an IR that serves as the interface between frontend and backend.
Backend (BE): Overview, Additional Docs, Code
Muti-target (currently: X86-64, Aarch64, Arm32).
Also suitable for other compilers and as a JIT.
To get started hacking on Cwerg please read quick_start_developer.md.
Philosophy
Most components are implemented twice (see rationale):
- spec/reference implementation: Python 3.10
- high performance implementation: C++20 (with limited STL usage)
Re-implementations in other languages are explicitly encouraged. A lot of code is table driven to facilitate that.
Cwerg de-emphasizes quality of the generated code (the hope is to come within 50% of state of the art compilers) in favor of a small code base that can be understood by a single developer and very fast translation times.
Explicit line number targets are in place to prevent feature creep:
- frontend: 10kLOC (current counts)
- backend 10kLOC (target independent code) + 5kLOC(per target (current counts) (We cheat a little bit and do not include various tables in these numbers.)
The translation speed target is 1000k LOC per sec using at most 4 cores on a 2020 era midrange desktop or high end laptop.
Inspirations
관련 프로젝트 살펴보기
불러오는 중…