From the Mohio team

Lose the Stack

Ron Smith 4 min read

Before you write a single line of business logic, you've already written the application. You just can't see your idea in it yet.

Before you write a single line of business logic, you've already written the application. You just can't see your idea in it yet.


Open a fresh PHP project and count the lines before you write the thing you actually came to build.

The router setup. The database connection. The session start. The error handler. The CORS headers. The input validation. The auth middleware. The rate limiter. The logger configuration. The environment variable loader.

Then the feature. After all of that.

This is not a PHP problem specifically. Rails, Express, FastAPI, Laravel, they all start with a pile of framework before a line of your actual idea. Some frameworks hide the pile better than others. The pile is still there.

The pile has a name. Developers call it "the stack." And it costs real time, real money, and real focus, not because's hard, but because it's not what you came to do.


What you actually came to build

Say you're building a rates page for a short-term rental property. Simple enough: read the cabin from the database, format the nightly rate, render the page.

In PHP, before you write a single line of page logic:

session_start();
require_once 'config/database.php';
require_once 'helpers/format.php';

$db = new PDO(
    'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME,
    DB_USER, DB_PASS
);

$router = new Router();
$router->get('/rates', function() use ($db) {
    $stmt = $db->prepare("SELECT * FROM cabins WHERE slug = ?");
    $stmt->execute(['stoneridge']);
    $cabin = $stmt->fetch();
    if (!$cabin) {
        http_response_code(404);
        require 'views/404.php';
        exit;
    }
    $price = '$' . number_format($cabin['nightly_rate'], 2);
    $date  = date('F j, Y');
    require 'views/rates.php';
});

$router->dispatch();

That's before a single line of actual page logic. And this is the minimal version. No auth, no caching, no logging, no real error handling.

In Mohio:

// rates.mho - one file, one page
connect db as postgres from env.DATABASE_URL

listen for
    new sh.Request

        retrieve cabin from db.cabins
            match slug to "stoneridge"
            on.failure give back 404 "Page not found"
        retrieve: done

        hold display_price cabin.nightly_rate as USD
        hold display_date  now() as date "MMMM D, YYYY"

        give back 200 view "rates_page"
        view "rates_page"
            title       cabin.name
            price       display_price
            updated     display_date

    new: done
listen: done

That's the whole file. The database connection is declared once at the top. The 404 is handled inline where the retrieval happens. Number and date formatting happen at the point of logic. The view renders from the data you hand it.

No router class. No helper files. No PDO boilerplate. Read the file and you know what the page does.


The pile is not just boilerplate

The real cost of the stack is not the lines. It's what the lines do to your thinking.

Every time you start a new feature, you start in framework-land. You wire things before you think things. The routing decision happens before the business logic decision. The database abstraction layer decision happens before the data model decision.

Mohio flips this. You start at the idea. The language handles the infrastructure declaration.

listen for is your entry point, not a framework's router. connect db is your database, not a connection pool class with a factory method. sector: financial is your compliance layer, not a library you installed, configured, and wired. These declarations are one line each. They disappear into the background and let the logic take the foreground.

The shift is small on a per-feature basis. Across a codebase, across a team, across a year, it compounds.


What you keep

Nothing you need is missing. SQL is still there. MoQL handles the everyday queries and raw sql blocks handle the rest. Your existing database is still your database. Your schema stays the same. Your deployment target stays the same.

Mohio does not ask you to move to a new cloud, learn a new mental model for how web applications work, or abandon the tools you already know. It removes the part between "I have an idea" and "I am writing the idea."

The stack was always meant to be invisible. Mohio makes it actually invisible.


Mohio is an AI-native programming language in active development. The language and base runtime are open source. Start building at mohio.io

Ron Smith

Founder of Mohio and Particular LLC. Building the first AI-native programming language from Mooresville, NC.

Mohio founder

Questions about this topic

What is 'the stack' in web development?
The stack refers to all the infrastructure code you write before your first line of business logic: routing, database connections, session handling, error handling, auth middleware, and validation setup. It is necessary but it is not the application you came to build.
Does Mohio use a framework?
No. Mohio doesn't use a traditional framework. The language handles routing via listen for, database connections via connect db, and compliance via sector: declarations. There is nothing to install or configure before you start writing logic.
Can I migrate an existing PHP application to Mohio?
Yes, incrementally. Mohio runs as its own process alongside existing applications. You don't have to migrate everything at once. Start with a new endpoint or a new feature and evaluate from there.
Does Mohio support HTML rendering and templates?
Yes. The view block in Mohio renders a named template with the data you pass it. Your .mho file handles the logic and data preparation; the view handles HTML output.
What databases does Mohio support?
Mohio supports PostgreSQL, MySQL, and other standard databases. The database type is declared once at the top of the file with connect db as postgres from env.DATABASE_URL. The rest of the file uses MoQL or raw sql blocks without repeating the connection details.
← All articles

Try it yourself

The compiler is open source. Clone the repo, run your first .mho file, and see what changes.