Repository navigation
Releases
Releases · Solype/Krc
Krc v0.1.0: first release
First release of Krc, a programming language written in Korean (한국어 프로그래밍 언어) and its compiler, written in Rust. The project is a work in progress and continues for fun.
Try it
You need Linux on x86-64, and gcc for the link step.
curl -LO https://github.com/Solype/Krc/releases/download/v0.1.0/krc-v0.1.0-x86_64-linux.tar.gz
tar xzf krc-v0.1.0-x86_64-linux.tar.gz
cd krc-v0.1.0-x86_64-linux
cat > hello.kr <<'EOF'
외부 정수를 반환하는 printf(문자 주소 형식, …)
정수를 반환하는 main() {
"안녕하세요!\n"을 printf해요.
0을 반환해요.
}
EOF
./compiler -x hello.kr
./a.outThe compiler prints the AST and the IR of each file, writes hello.o, and -x links it into a.out.
The binary is static (musl), so it does not depend on the version of your libc.
What works
- Language: functions as conjugated verbs, arguments with their particles, chained calls,
만약/아니면,동안,세면서,그만해요,넘어가요,그리고/또는in short-circuit, andprintfand other libc functions. - Types:
정수,짧은 정수,부호 없는 정수,소수,짧은 소수,논리,문자,바이트, addresses, and바꾸다for conversions. - Compiler: lexer, pre-parser, LR(1) parser, typed IR, x86-64 encoder and ELF writer, all written for this project.
All 59 programs in sample/ behave as expected with this binary.
Known limits
- A variable declared without a value is not zeroed: #33.
- Casts from an unsigned value are extended as signed: #2.
- There is no unsigned 32-bit integer yet: #20.
Use of AI
Part of this project was written with an AI assistant: see USE_OF_AI.md.