프로젝트
GitHub에서 보기
maekawatoshiki/sericum
소개
(Toy) Compiler Infrastructure influenced by LLVM written in Rust
프로그래밍 언어 및 런타임측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalSericum
Compiler Infrastructure influenced by LLVM written in Rust
Do not expect too much stuff!
To Do
- Implement basic block parameters
- Make it possible to generate code for multiple targets without rebuilding sericum itself
- Verify IR
- More optimizations for IR
- Support returning struct as value
- Write documents
Build
Requirement: Rust nightly
cargo test --features x86_64 # build for x86_64
cargo test brainfuxk --features x86_64 --release -- --nocapture # this is fun. just try it.
cargo test --features aarch64 # build for aarch64. a few features are implemented.
cargo test --features riscv64 # currently doesn't work. need help.
Example
cargo test demo --features $ARCH -- --nocapture # $ARCH is x86_64 or aarch64
- Useful macro is available to describe IR
let fibo = sericum_ir!(m; define [i32] f [(i32)] {
entry:
cond = icmp le (%arg.0), (i32 2);
br (%cond) l1, l2;
l1:
ret (i32 1);
l2:
a1 = sub (%arg.0), (i32 1);
r1 = call f [(%a1)];
a2 = sub (%arg.0), (i32 2);
r2 = call f [(%a2)];
r3 = add (%r1), (%r2);
ret (%r3);
});
Make your own language using sericum as backend
./minilang and ./sericumcc may help you.
관련 프로젝트 살펴보기
불러오는 중…