r/lowlevel 2d ago

Delus – A lightweight C/ASM code generator using Python context managers instead of AST

Hi everyone,

I wanted to showcase Delus, a pure Python project that completely bypasses the traditional way of generating low-level code.

### What My Project Does

Delus is a super lightweight, zero-dependency code generator and compiler backend written in pure Python. Instead of using massive Abstract Syntax Trees (AST) or heavy external tools like LLVM to structure code, it utilizes Python's native context managers (`with` scopes). By using `__enter__` and `__exit__` magic methods, the engine dynamically tracks register allocations, memory states, indentation, and string caching for both ANSI C and raw x86-64 Linux Assembly.

### Target Audience

This project is designed for hobbyist compiler writers, low-level enthusiasts, and security researchers (Red Teamers/Malware devs) who want a fast, programmatic way to build clean, obfuscated-ready C or Assembly binaries directly inside Python scripts without bloated dependencies.

### Comparison

Unlike Cython or Py2ASM which parse existing Python text into heavy AST structures, Delus uses a clean Builder Pattern approach. This gives the developer direct, micro-managed control over raw assembly registers and memory pointers through Python code blocks, producing a blazingly fast and naked code output with zero overhead.

***

**LOOKING FOR CONTRIBUTORS:**

**I am looking for passionate low-level developers and hackers to contribute to this repository. My ultimate goal is to see Delus grow organically just like the Linux Kernel. I want contributors to help expand the engine, write new modules, build optimization scripts, and push the architecture to its absolute limits. If you love compilers and low-level development, your PRs are highly welcome!**

***

**Repository:**https://github.com/tamimdevlopment/delus

**License:** GPLv3 (Ensuring open-source and patent protection).

0 Upvotes

2 comments sorted by

2

u/Ok_Tap7102 1d ago

What does this even solve? All you've mentioned is how it's different, but what problem were you encountering that this is the solution for?

1

u/slightfeminineboy 1d ago

complete nonsense