Natrix: a compiled, dynamic, strongly typed general purpose language.
This repository has been archived on 2026-07-26. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • C 98.5%
  • Makefile 1.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nikita Kulakov 6d7f803fa6 Init v1.0.0
2025-04-10 17:44:51 +03:00
io Init v1.0.0 2025-04-10 17:44:51 +03:00
src Init v1.0.0 2025-04-10 17:44:51 +03:00
test Init v1.0.0 2025-04-10 17:44:51 +03:00
.clang-format Init v1.0.0 2025-04-10 17:44:51 +03:00
.devcontainer.json Init v1.0.0 2025-04-10 17:44:51 +03:00
.gitignore Init v1.0.0 2025-04-10 17:44:51 +03:00
dockerfile Init v1.0.0 2025-04-10 17:44:51 +03:00
LICENSE Initial commit 2025-04-10 17:17:21 +03:00
Makefile Init v1.0.0 2025-04-10 17:44:51 +03:00
README.md Init v1.0.0 2025-04-10 17:44:51 +03:00

Natrix

Dev-environment

Build:

docker build . -t zubrailx-natrix

Run container and execute commands inside:

docker run -v .:/workspace -it zubrailx-natrix:latest bash

Or run and connect with SSH:

docker run -v .:/workspace -itd zubrailx-natrix:latest

ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null \
    -p 2222 user@<ip>
  • ip - container ip

Default password for user user is user.

Cd to mounted workspace:

cd /workspace

Configuration

Make Targets:

make help
Targets:
  clean/build                 Remove build files
  clean/out                   Remove io output files
  compiler                    Build compiler executable
  debugger                    Build debugger executable
  format                      Format
  help                        Help
  index                       Index project
  run/asm                     Compile file
  run/dbg                     Run debugger
  run/pdf                     Run main executable and generate dot
  run/test                    Run all tests or specific
  test                        Build tests
  util                        Build libutil.a
  x86_64_core                 Build libx86_64_core.a
  x86_64_std                  Build libx86_64_std.a
Modules (prefixes of module targets):
  util compiler x86_64_core x86_64_std debugger test

Build compiler

make compiler

Build debugger

make debugger

Test

make run/test

Run assembly

Run default suite:

make run/asm

Run selected suite (for example io/suite28.txt):

make run/asm/io/suite28.txt

Run manually:

make x86_64_core x86_64_std

./build/compiler/main  \
        -o io/suite28.txt.asm \
        io/suite28.txt /workspace/src/x86_64_std/x86_64_std.txt

as --64 -g -o io/suite28.txt.asm.o io/suite28.txt.asm

ld -g -z noexecstack -o io/suite28.txt.asm.out \
        -dynamic-linker /usr/lib64/ld-linux-x86-64.so.2 \
        /usr/lib/x86_64-linux-gnu/crt1.o \
        /usr/lib/x86_64-linux-gnu/crti.o \
        -lc \
        io/suite28.txt.asm.o \
        /workspace/build/x86_64_core/libx86_64_core.a \
        /workspace/build/x86_64_std/libx86_64_std.a \
        /workspace/build/util/libutil.a \
        /usr/lib/x86_64-linux-gnu/crtn.o

Help:

./build/compiler/main -h
Usage: ./build/compiler/main [options] <file>...
Options:
-d <directory>   - output directory (current: .)
-o <file>        - main output file (current: a.asm)
--tee            - print to file and to stdout (current: 0)
--ignore-errors  - continue execution on errors (current: 0)
--ast            - add AST output (current: 0)
--cfg            - add global subroutines control flow graph output (current: 0)
--cfg-add-expr   - include expressions in control flow graph (current: 0)
--cg             - add global subroutines call graph output (current: 0)
-s <subroutine>  - set or add global subroutine for call graph generation (current: main)
--hir-tree       - print HIR tree (current: 0)
--hir-symbols    - print HIR symbol table (current: 0)
--hir-types      - print HIR type table (current: 0)
--mir            - print MIR tree (current: 0)
-h
--help           - show help

Run debugger

Run with default init file:

make run/dbg

With specific init:

make run/dbg/io/dbg_init.txt

Run manually:

./build/debugger/main

Help:

./build/debugger/main -h
Usage: ./build/debugger/main [options] <file>...
Options:
-i <file>  - init file (current: (null))
-h         - show help