feat: add README

This commit is contained in:
samsonium
2026-10-11 03:59:19 +03:00
parent 96cd855c5d
commit e01bf6e4ab
3 changed files with 98 additions and 0 deletions
+1
View File
@@ -13,4 +13,5 @@
!/CMakeLists.txt !/CMakeLists.txt
!/Makefile !/Makefile
!/README.md !/README.md
!/README.ru.md
+49
View File
@@ -0,0 +1,49 @@
# FromZero / Language
[README in Russian](./README.ru.md)
**FromZero/Language** is a package consisting of a JIT compiler and a virtual machine for the FZL language.
## Features
At the moment, the language has the following capabilities:
- Builtin `printline` function for printing argument to stdout
- String and numeric literals
- Arithmetic operations: addition, subtraction, multiplication, division, modulo, power
## File extensions
Standard file extensions:
- `.fzs` - source code
- `.fzb` - compiled binary file
## Building
1. Clone the repository: `git clone https://git.samsonium.dev/samsonium/fz-lang.git`
2. Build: `make build`
After this, a "build" directory will appear in the project root. It will contain two executable files:
- `fzc` - a compiler
- `fz` - virtual machine
Both executables have usage help that can be displayed using `--help` flag (or `-h`).
## Development guideline
You need a code editor with Clang LSP support because of `.clang-format` file in the project root.
This file provides set up codestyle rules.
There is two targets in Makefile for debugging purposes: `build-c` for the compiler and `build-vm` for the VM.
Each target can be called with `FILE` variable. For example:
```shell
$ make debug-c FILE=exl/hw.fzs
```
+48
View File
@@ -0,0 +1,48 @@
# FromZero / Language
[README in English](./README.md)
**FromZero/Language** - пакет из JIT-компилятора и виртуальной машины для языка FZL.
## Текущие возможности
На данный момент язык имеет:
- Встроенную функцию `printline` для вывода аргумента в stdout
- Строковый и числовой литералы
- Арифметические операции: сложение, вычитание, умножение, деление, модуло, возведение в степень
## Расширения файлов
Стандартными для языка являются два расширения файлов:
- `.fzs` - исходный код
- `.fzb` - скомпилированный бинарный файл
## Инструкции по сборке
1. Склонировать проект: `git clone https://git.samsonium.dev/samsonium/fz-lang.git`
2. Собрать проект: `make build`
После этого в корне появится директория **"build"**. В ней будут лежать два скомпилированных бинарных файла:
- `fzc` - компилятор
- `fz` - виртуальная машина
Оба бинарных файла предоставляют справку по использованию при запуске с флагом `--help` (или `-h`).
## Гайдлайн по разработке
Желательно иметь редактор кода, поддерживающий Clang LSP, так как в проекте есть готовые настройки для
форматтера в виде файла `.clang-format`.
Для дебаггинга есть два таргета в CMake: `build-c` для компилятора и `build-vm` для виртуальной машины.
Оба таргета позволяют указать переменную с путём файла. Например, так:
```shell
$ make debug-c FILE=exl/hw.fzs
```