Skip to content

Systems programming language with Python-like syntax and C-level performance. Compiles to native x86-64 machine code without external dependencies.

License

Notifications You must be signed in to change notification settings

AGDNoob/axis-lang

Repository files navigation

AXIS

Version Platform License

A minimalist programming language with Python-like syntax and dual execution modes.

AXIS can run as an interpreted scripting language OR compile directly to x86-64 machine code.


πŸš€ Quick Start

Installation

Download and run the one-click GUI installer for your platform:

Platform Installer One-Liner
Windows install-windows.ps1 Right-click β†’ Run with PowerShell
Linux install-linux.sh curl -fsSL https://raw.githubusercontent.com/AGDNoob/axis-lang/main/installer/install-linux.sh | bash
macOS install-macos.sh curl -fsSL https://raw.githubusercontent.com/AGDNoob/axis-lang/main/installer/install-macos.sh | bash

The installer will:

  • βœ… Check/install Python 3.7+
  • βœ… Download all AXIS files
  • βœ… Set up the axis command
  • βœ… Optionally install VS Code extension

Hello World (Script Mode)

Works on Windows, macOS, and Linux:

axis run hello.axis

Hello World (Compile Mode)

Linux x86-64 only - creates native ELF executable:

cat > hello.axis << 'EOF'
mode compile

func main() -> i32:
    give 42
EOF

axis build hello.axis -o hello --elf
./hello && echo $?  # Output: 42

πŸ“– Dual-Mode Execution

AXIS supports two execution modes:

Mode Declaration Execution Speed Use Case
Script mode script Transpiled to Python Fast startup Scripting, prototyping
Compile mode compile Native x86-64 ELF Maximum performance Systems programming

Script Mode

Script mode transpiles AXIS to Python and executes it. ~30% overhead vs native Python.

mode script

writeln("Script mode example")
x: i32 = 10
writeln(x)

Run with:

axis run script.axis

Compile Mode

Compile mode generates native Linux x86-64 executables. The output binary has no runtime dependencies.

mode compile

func main() -> i32:
    x: i32 = 10
    y: i32 = 20
    give x + y

Build with:

axis build program.axis -o program --elf
./program

πŸ“š Language Reference

Variables

x: i32 = 42          # 32-bit signed integer
y: i64 = 1000000     # 64-bit signed integer
small: i8 = 127      # 8-bit signed integer
flag: bool = True    # Boolean

Types: i8, i16, i32, i64, u8, u16, u32, u64, bool, str, ptr

Output

write("Hello ")      # Output without newline
writeln("World!")    # Output with newline
writeln(42)          # Works with numbers

Conditionals

when x > 0:
    writeln("positive")

when x < 0:
    writeln("negative")

Loops

# Infinite loop with break
i: i32 = 0
repeat:
    writeln(i)
    i = i + 1
    when i >= 10:
        stop

# While loop
while i < 20:
    i = i + 1

Keywords:

  • repeat: – Infinite loop
  • while condition: – Conditional loop
  • stop – Break out of loop
  • skip – Continue to next iteration

Functions (Script Mode)

mode script

func greet():
    writeln("Hello!")

func add(a: i32, b: i32) -> i32:
    give a + b

greet()
result: i32 = add(10, 20)
writeln(result)

Functions (Compile Mode)

mode compile

func main() -> i32:
    x: i32 = 42
    give x

Operators

Arithmetic: +, -, *, /, %

Comparison: ==, !=, <, <=, >, >=

Bitwise: &, |, ^, <<, >>

Comments

// C-style comment
# Python-style comment

πŸ“ Examples

The examples/ folder contains 20 example programs:

# Example Description
01 hello_world.axis Basic output
02 variables.axis Variable types
03 arithmetic.axis Math operations
04 conditionals.axis when branching
05 loops.axis repeat loops
06 while_loops.axis while loops
07 break_continue.axis stop and skip
08 nested_loops.axis Multiplication table
09 boolean_logic.axis Bitwise logic
10 comparison.axis Comparison operators
11 bitwise.axis Bit manipulation
12 functions.axis Function definitions
13 fibonacci.axis Fibonacci sequence
14 prime_numbers.axis Prime checker
15 factorial.axis Factorial calculation
16 guessing_game.axis Binary search
17 ascii_art.axis Pattern drawing
18 gcd.axis Euclidean algorithm
19 fizzbuzz.axis Classic challenge
20 compile_mode.axis Native compilation

Run examples:

# Script mode (examples 01-19)
axis run examples/01_hello_world.axis

# Compile mode (example 20)
axis build examples/20_compile_mode.axis -o demo --elf

πŸ—οΈ Architecture

Compilation Pipeline

Source (.axis)
     β”‚
     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Lexer     β”‚  tokenization_engine.py
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Parser    β”‚  syntactic_analyzer.py
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β–Ό                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Transpiler  β”‚    β”‚  Semantic   β”‚
β”‚ (Script)    β”‚    β”‚  Analyzer   β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β–Ό                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Python    β”‚    β”‚  Code Gen   β”‚
β”‚   exec()    β”‚    β”‚  (x86-64)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                          β–Ό
                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                   β”‚  Assembler  β”‚
                   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                          β–Ό
                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                   β”‚  ELF64      β”‚
                   β”‚  Executable β”‚
                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

axis-lang/
β”œβ”€β”€ compilation_pipeline.py    # Main driver
β”œβ”€β”€ tokenization_engine.py     # Lexer
β”œβ”€β”€ syntactic_analyzer.py      # Parser + AST
β”œβ”€β”€ semantic_analyzer.py       # Type checker
β”œβ”€β”€ code_generator.py          # x86-64 codegen
β”œβ”€β”€ executable_format_generator.py  # ELF64
β”œβ”€β”€ examples/                  # 20 example programs
β”œβ”€β”€ axis-vscode/               # VS Code extension
└── installer/                 # GUI installers (Windows/Linux/macOS)

πŸ› οΈ Usage

Commands

After installation, the axis command is available on all platforms:

axis run script.axis        # Run in script mode
axis build prog.axis        # Compile to native binary (Linux only)
axis check prog.axis        # Validate syntax without running
axis info                   # Show installation info
axis version                # Show version
axis help                   # Show all commands

VS Code Extension

The installer can optionally install the VS Code extension for syntax highlighting. Or manually: axis-vscode/ folder contains the extension source.

Uninstall

Run the same installer again and select Uninstall.


⚠️ Platform Requirements

All modes require Python 3.7+ to run the AXIS compiler.

Compile mode:

  • Linux x86-64 only (Ubuntu, Debian, Fedora, Arch, etc.)
  • Generated binaries are native ELF64 executables (no runtime dependencies)

Script mode:

  • Any platform with Python 3.7+
  • Windows, macOS, Linux all supported

πŸ“Š Performance

Mode Overhead Binary Size Compiler Requires Output Requires
Script ~30% vs Python N/A Python 3.7+ Python 3.7+
Compile Native speed ~4KB Python 3.7+ Nothing (standalone)

πŸ—ΊοΈ Roadmap

Implemented βœ“

  • Dual-mode execution (script/compile)
  • Python transpiler for script mode
  • ELF64 native compilation
  • All integer types (i8-i64, u8-u64)
  • Control flow (when, while, repeat, stop, skip)
  • Functions
  • Arithmetic and bitwise operators
  • I/O (write, writeln, read, readln, readchar)
  • VS Code syntax highlighting

Planned

  • Function parameters in compile mode
  • Structs and arrays
  • Pointer arithmetic
  • Standard library
  • Language Server Protocol (LSP)

πŸ“œ License

MIT License


AXIS – Python syntax. Native performance. Your choice.

About

Systems programming language with Python-like syntax and C-level performance. Compiles to native x86-64 machine code without external dependencies.

Resources

License

Stars

Watchers

Forks

Packages

No packages published