Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamkow1/yup
source code of the yup compiler and other related tools
https://github.com/kamkow1/yup
compiler language llvm programming-language
Last synced: 3 months ago
JSON representation
source code of the yup compiler and other related tools
- Host: GitHub
- URL: https://github.com/kamkow1/yup
- Owner: kamkow1
- License: mit
- Created: 2022-07-06T09:58:16.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-29T00:25:07.000Z (about 2 years ago)
- Last Synced: 2024-09-30T12:06:38.629Z (4 months ago)
- Topics: compiler, language, llvm, programming-language
- Language: Go
- Homepage:
- Size: 37.1 MB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yup language
![Github Actions](https://github.com/kamkow1/yup/actions/workflows/ci.yml/badge.svg)
## introduction
Yup is an imperative programming language. It borrows syntax from
Go, Rust and C.
It's compiler is implemented using LLVM.Small example of the language:
```c
// calculate a fibonacci number for N:import "#std/IO.yup";
calc_fib: fnc(n: i64) -> i64 {
if n <= 1 {
return n;
}
return calc_fib(n - 1) + calc_fib(c - 2);
}pub main: fnc() -> i32 {
printf("give me a number N: ");
var count: i64;
scanf("%d", &count);
printf("your number is: %d\n", calc_fib(number));
return 0;
}
```if you'd like to see a more complex usage of the language, see yup_stdlib/FileSys.yup
or yup_stdlib/Errors.yup. these are some of the more advanced usages of Yup.# installing the standard library
run:
```bash
cd /root/of/project/yup/yup_stdlib
chmod +x ./install_stdlib.sh
./build.sh
./install_stdlib.sh # installs in ~/yup_stdlib
```# building from source
As of now, Yup doesn't provide prebuilt binaries so you will
have to build the compiler from source.
Also, the compiler only supports Linux, but that is going to change in the future. I do not own a copy of Windows, so if you do, feel free to create a port of the compiler.```bash
cd /root/of/project/yup/yupc./gen.sh # generates needed ANTLR4 files
sudo ./llvm.sh 14 # installes LLVM 14.0.6 which is required to build the compiler
./build.sh # outputs the yupc binary into bin/
```