https://github.com/juripan/hadzik
A custom compiler for my own programming language written in python that compiles into 86x_64 linux assembly
https://github.com/juripan/hadzik
compiler linux python python3 x86-64 x86-assembly
Last synced: 4 months ago
JSON representation
A custom compiler for my own programming language written in python that compiles into 86x_64 linux assembly
- Host: GitHub
- URL: https://github.com/juripan/hadzik
- Owner: juripan
- Created: 2024-06-22T17:36:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-09T21:28:23.000Z (7 months ago)
- Last Synced: 2025-03-09T22:25:49.074Z (7 months ago)
- Topics: compiler, linux, python, python3, x86-64, x86-assembly
- Language: Python
- Homepage:
- Size: 274 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HADZIK
A programming language with keywords based on east slovak dialect.
Heavily inspired by Python and C programming languages
For now only compiles to x86_64 linux assemblyFile extension: **.hdz**
Strings use " "
Chars use ' 'Scopes are declared by curly braces
'\n' ends statements instead of using ';' to end statements
All current design principles are subject to change
## Quick start:
```
$ python3
```## Flags:
Flags that are used when running the compiler in the console (more are going to be added in the future)+ -s - switches on the east slovak error messages
```
$ python3 hdz.py path/file.hdz -s
```+ -r - after compilation is done runs the compiled file and prints its output
```
$ python3 hdz.py path/file.hdz -r
```+ -n - determine a path and name of the compiled file
```
$ python3 hdz.py path/file.hdz -n new_path/file2
```+ -d - dumps all of the compiler debug information available to the console
```
$ python3 hdz.py path/file.hdz -d
```+ --help - displays user manual
```
$ python3 hdz.py --help
```Order of flags doesn't matter just the order of paths:
```
$ python3 hdz.py path/file.hdz -s -r new_path/file2 -n
```## Dependencies:
all of the dependencies are listed in the Docker file but for more transparency I will list them here also
+ Python 3.12.3
+ libraries: sys, os, dataclasses, typing
+ NASM version 2.16.01
+ GNU ld 2.42## Docker:
To run this project in a docker you first need to install docker and then run these commands**NOTE: use the full file paths on windows**
```
$ docker build -t
$ docker run -it -v :/app
```
The container creates a volume of the source directory on the /app directory inside the docker container so it can access the src folder and modify its content-it flag makes the container console accessible so you can run the start.sh file yourself or run any commands in the container until you close it
## Credits:
name of the programming language by: Miška Mašlonková