DEV Community

Cover image for ๐Ÿง  MadiLang: Building a Sovereign Programming Language Entirely on a Smartphone
El Madani El mkhitar (madani004)
El Madani El mkhitar (madani004)

Posted on • Edited on

๐Ÿง  MadiLang: Building a Sovereign Programming Language Entirely on a Smartphone

From human intent to production backend โ€” How I overcame Prisma 7, abstract contracts, and mobile constraints to launch MadiLang v0.5.2, a sovereign multi-target language built 100% on Termux and published on PyPI.


โœจ Code is no longer written. It is described.

In a world drowning in boilerplate, complexity, and hidden logic, MadiLang restores clarity, sovereignty, and trust.

MadiLang is a sovereign intent-driven programming language that transforms human-readable descriptions into production-ready, secure, and ethical backend systems. Every artifact carries a cryptographic signature binding it to the original intent, ensuring provenance, integrity, and accountability.

And here's the twist: MadiLang v0.5.2 was built entirely on a smartphone using Termux, and is now live on PyPI. ๐Ÿ“ฑ๐Ÿ”ฅ๐ŸŒ

This article shares the engineering saga, the philosophical foundation, and the live proof that sovereignty is not just a vision โ€” it's a working, installable reality.


๐Ÿ“ฑ The Mobile-First Revolution

Developing a programming language on a phone is not a gimmick; it's a statement.

MadiLang proves that:

  • ๐Ÿง  Intent transcends hardware: You don't need a powerful IDE or PC to create sovereign tools.
  • ๐ŸŒ Accessibility is sovereignty: Development should be possible anywhere, for anyone.
  • โšก Efficiency matters: The compiler is lightweight, modular, and optimized for constrained environments.

Using Termux on Android, I built the entire toolchain:

  • ๐Ÿ Python 3.13 environment with isolated venv.
  • ๐Ÿงช Comprehensive test suite (pytest) passing across Python 3.8โ€“3.13.
  • ๐Ÿ”„ CI/CD pipeline with 10/10 green checks (quality, security, integration).
  • ๐Ÿš€ Live backend generation and server execution for both Node.js and Python/FastAPI.
  • ๐Ÿ“ฆ Published on PyPI: pip install madilang works worldwide.

๐Ÿ’Ž MadiLang democratizes development: Build sovereign backends from your pocket.


๐Ÿงฌ The Mkhitarian Philosophy

MadiLang is built on the Mkhitarian Ontology:

Human intent is the sovereign layer.

Code is merely the execution of will.

Ethics and security are not features โ€” they are foundations.

Core Principles

  • ๐ŸŽฏ Intent over scale: Focus on purpose, not boilerplate.
  • ๐Ÿ” Sovereignty over convenience: Maintain control and provenance.
  • ๐Ÿ›ก๏ธ Ethics by default: Moral considerations embedded in the toolchain.
  • ๐Ÿค Clarity over complexity: Describe what you want, not how to do it.

๐Ÿ› ๏ธ The Engineering Saga: Challenges & Solutions

Building on mobile introduced unique constraints. Here's how we turned challenges into sovereign features.

1๏ธโƒฃ Prisma 7 Crisis โ†’ Sovereign Hybrid Adapter

Challenge: Prisma 7 dropped direct SQLite support for Wasm-based drivers, breaking builds on ARM/Termux.

Solution: We implemented a Sovereign Hybrid Adapter that intelligently detects the environment:

  • โœ… If Prisma/SQLAlchemy is available โ†’ uses the real database client.
  • ๐Ÿฆบ If not โ†’ falls back to a built-in mock adapter that mimics the API perfectly.

Result: Generated backends run everywhere without configuration hell.

2๏ธโƒฃ Abstract Contract Sealing โ†’ Dynamic Registry

Challenge: Python raised TypeError: Can't instantiate abstract class when generators were lazily loaded.

Solution: Built a Self-Activating Generator Registry with _core_targets and dynamic imports:

if target_key not in cls._generators and target_key in cls._core_targets:
    import madilang.generators.python.generator  # Auto-registers on first use
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”ง Lesson: Robust architecture allows runtime adaptation while maintaining type safety.

3๏ธโƒฃ JSON vs Python Syntax โ†’ Signature Fix

Challenge: json.dumps() produced null/true/false inside Python code, causing NameError.

Solution: Post-process signature embedding to convert JSON literals to Python-native syntax:

sig_python = sig_json.replace(": null", ": None")
                     .replace(": true", ": True")
                     .replace(": false", ": False")
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”ง Lesson: Cross-language generation requires meticulous syntax awareness.


๐Ÿ†• What's New in v0.5.2

Since the initial v0.4.0 release, MadiLang has evolved into a multi-target sovereign platform:

Feature Status Impact
๐Ÿ Python/FastAPI Generator โœ… Live Async handlers + Pydantic models + Uvicorn
๐Ÿฉบ madi doctor โœ… Live Instant environment diagnostics
๐Ÿ›ก๏ธ Sovereign Hybrid Adapter โœ… Live Zero-config database fallback
๐Ÿ—๏ธ Modular CLI โœ… Live Lazy-loaded commands for fast mobile startup
๐Ÿ“ฆ PyPI Publication โœ… Live pip install madilang worldwide
๐Ÿ” Signature Python Fix โœ… Live None/True/False instead of JSON literals
โœ… CI/CD โœ… 10/10 Passing across Python 3.8โ€“3.13

๐Ÿ” Sovereign Features

๐Ÿงพ Cryptographic Intent Signature

Every generated file embeds a signature proving:

  • ๐Ÿ‘ค Who authored the intent.
  • ๐Ÿ“ What the intent was (source hash).
  • ๐Ÿ“… When it was generated.
  • ๐Ÿ›ก๏ธ Whether it passed ethical review.

๐Ÿ›ก๏ธ Ethics & Security by Default

  • ๐Ÿ”’ Secure fields: Automatically hashed with bcrypt.
  • ๐Ÿ” Auth coverage: Sensitive routes require authentication.
  • ๐Ÿ‘ค Role guards: Admin operations enforce RBAC.
  • ๐Ÿšซ Injection prevention: Input validation generated for all inputs.
  • โš ๏ธ Error safety: Generic messages prevent data leakage.

๐Ÿš€ Live Proof: FastAPI Server Running on Phone

The ultimate test: Does it work end-to-end?

Using Termux, I installed from PyPI, initialized a project, and launched a Python/FastAPI server:

pip install madilang==0.5.2
madi init my-backend
cd my-backend
madi run src/main.madi --target python
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“ธ Session: FastAPI Server Launch on Termux

Termux Session: FastAPI Server Running

โœ… Generated main.py + requirements.txt

โœ… Dependencies installed automatically

โœ… Uvicorn running on http://0.0.0.0:3000

โš ๏ธ Sovereign Mock Adapter active (zero-config)

The server responds correctly, validation works, and the sovereign signature is embedded with Python-native syntax. MadiLang is alive, sovereign, and multi-target.


๐Ÿค Join the Sovereign Movement

MadiLang is open source and invites contributors, thinkers, and builders.

๐Ÿ“ฆ Install Now

pip install madilang
madi doctor
Enter fullscreen mode Exit fullscreen mode

๐ŸŒŸ Star the Repository

๐Ÿ‘‰ madanimkhitar22-beep/madilang

๐Ÿ’ฌ Join Discussions

๐Ÿ‘‰ GitHub Discussions

๐Ÿ”ฎ Roadmap to v1.0.0

  • ๐Ÿ“š OpenAPI/Swagger auto-documentation
  • ๐Ÿงช Auto-testing generator from intents
  • ๐Ÿ”„ madi watch mode for live reload
  • ๐Ÿฆ€ Go/Fiber generator
  • ๐Ÿ”— Pi Network integration for decentralized deployment
  • ๐Ÿง  Sovereign-Cognition-Engine deep integration

๐Ÿ“œ Citation

cff-version: 1.2.0
title: "MadiLang"
authors:
  - family-names: "El Mkhitar"
    given-names: "El Madani"
    email: "madani004@proton.me"
version: "0.5.2"
date-released: 2026-07-02
license: "MIT"
repository-code: "https://github.com/madanimkhitar22-beep/madilang"
Enter fullscreen mode Exit fullscreen mode

๐Ÿ’ฌ Final Words

MadiLang is more than a tool; it's a declaration:

Sovereignty is no longer optional. It is embedded.

The future of development is sovereign, ethical, and accessible to all.

Built from a smartphone, tested on the edge, published on PyPI, and ready for the world.

Join us. Describe your intent. Generate your sovereignty. ๐Ÿง โœจ


El Madani El Mkhitar

๐Ÿ“ง madani004@proton.me

๐ŸŒ GitHub Profile

"Building sovereign tools for a decentralized future, one intent at a time."

Top comments (0)