https://github.com/v420v/ibu
🕊️ A programming language
https://github.com/v420v/ibu
assembly compiler holyc ibu language programming-language self-hosting
Last synced: 10 months ago
JSON representation
🕊️ A programming language
- Host: GitHub
- URL: https://github.com/v420v/ibu
- Owner: v420v
- License: mit
- Created: 2023-07-10T14:32:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-23T08:34:19.000Z (10 months ago)
- Last Synced: 2025-03-25T16:22:10.963Z (10 months ago)
- Topics: assembly, compiler, holyc, ibu, language, programming-language, self-hosting
- Language: Assembly
- Homepage:
- Size: 330 KB
- Stars: 19
- Watchers: 1
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
The Ibu programming language
[](https://github.com/v420v/ibu/actions/workflows/ci.yml)
A language designed for the enjoyment of programming.
## Key Features of Ibu
- No strict type checker
- No C-like pointer arithmetic
- No function-like macros
- No variable shadowing
- No `break`, `continue` stmt. Use `goto`
- No libc dependency
- No hidden control flow
- No hidden memory allocations
- Allows syntax like `13 <= age < 20`
- Variable length args `func(...)` can be accessed with built-in variables `argc i64` and `argv *i64`
- All values are extended to 64-bit when accessed
- The compiler is written in itself
- Default args don't have to be on the end (WIP)
> [!IMPORTANT]
> Supports x86-64 Linux only
## Build the language
```zsh
$ git clone git@github.com:v420v/ibu.git
$ cd ibu
$ make init
```
## Build the language with docker
```zsh
$ git clone git@github.com:v420v/ibu.git
$ cd ibu
$ make up
$ make ibu
$ make init
```
| Command | Execution |
|-----------|------------------------|
| `make up` | `docker compose up -d` |
| `make ibu` | `docker compose exec ibulang bash` |
| `make down` | `docker compose down` |
## Usage
```
$ ./ibuc .ibu
```
## Compiler implementation
| File | Content |
|-----------|------------------------|
| `src/ibu.ibu` | Entry point |
| `src/tokenizer/tokenizer.ibu` | Lexical analyzer |
| `src/preprocessor/preprocessor.ibu` | Preprocessor |
| `src/parser/parser.ibu` | Parser |
| `src/codegen/codegen.ibu` | Assembly code generator |
| `src/linux-syscall/linux-syscall.ibu` | Linux system call |
| `src/runtime.s` | Syscall function in assembly |
| `src/util/util.ibu` | Other |
### Contribution
contribution is welcome!
### License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.