https://github.com/wzid/phi
A compiler written in C using LLVM
https://github.com/wzid/phi
c compiler llvm llvm-frontend
Last synced: 8 months ago
JSON representation
A compiler written in C using LLVM
- Host: GitHub
- URL: https://github.com/wzid/phi
- Owner: wzid
- Created: 2025-03-09T18:59:36.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-12T17:22:33.000Z (8 months ago)
- Last Synced: 2025-07-12T19:29:07.002Z (8 months ago)
- Topics: c, compiler, llvm, llvm-frontend
- Language: C
- Homepage:
- Size: 60.5 KB
- Stars: 31
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# phi φ
A compiler written in C using LLVM
The name is inspired from [Euler's totient function](https://en.wikipedia.org/wiki/Euler%27s_totient_function) which is also called Euler's phi function.
Watch my devlogs on YouTube [here](https://www.youtube.com/watch?v=QPHYcFLAWoo&list=PLEgtx_e7NiZeAXGu8U04pLPKDU5zTNG4M&index=3)!
## syntax
```
func get_name(): string => "phi";
// it would be cool if I could remove the : int and just infer the return type
func add_five(a: int): int => a + 5;
func main() {
string name = get_name();
int result = add_five(5);
print(name);
print(result);
}
```