Why AIScript

AIScript is an experimental project exploring a new approach to building web applications in the AI era. This isn't just another language created by someone learning interpreter design—my ambition is much greater.

Regardless of which language you use to build web APIs, you need a web framework. These frameworks essentially perform the same functions: parsing HTTP requests, executing database queries, and returning results as JSON or rendered HTML. Some frameworks offer additional features like request validation or OpenAPI spec generation. However, frameworks across different languages provide vastly different development experiences. Switching between them inevitably requires learning new syntax and documentation. That's why I wanted to create an intuitive approach that combines language with web framework to deliver a modern experience for building web applications.

Intuitive First

My vision is to write code that runs a web API with a single command—no need to learn a new framework, struggle with choosing which one to use, or install dependencies to run it. Just execute aiscript serve and you're up and running.

route.ai
run
curl
get /guess {

    query {
        @number(min=0, max=100)
        value: int
    }

    let message = "You got it!" if query.value == 42 else "Try again";
    return { message };
}

This is just a small part of the ideas that have come to mind. I've searched to see if someone has already built something similar, but finding nothing, I decided to build it myself.

Out-of-box First

When building a web app, most components beyond the core business logic are standard across projects. How do you implement JWT authentication? How do you integrate Google or GitHub login? How do you query databases or validate data? For these rarely changing standards, I believe they should be built directly into the language or framework, providing an out-of-box experience.

jwt_auth.ai
google_login.ai
validation.ai
project.toml
@auth // JWT auth
post /chat {
    query {
        @string(min_len=5, max_len=200)
        message: str
    }

    use std.db.pg;
    let message = pg.query("INSERT INTO messages (message) VALUES ($1)", query.message);
    return message;
}

AI First

People often ask

"Do we really need a new programming language in an age when AI can write code for us?".

In my opinion, for web applications at least, the answer is yes.

Most mainstream languages were designed decades ago—features like prompt and agent aren't primitives in these languages, but they are in AIScript. You don't need to install packages to call LLM APIs or orchestrate multiple agents.

prompt.ai
agent.ai
project.toml
let answer = prompt "Why the sky is blue?";
print(answer);

Additionally, AIScript includes many out-of-box features in its standard library, which is particularly helpful for AI code generation.

Thoughts on the AI Code Generation Era

Building Web Apps Is Not That Easy

  • Solid coding experience is still required, from programming languages to web frameworks and libraries. You need substantial hands-on experience to build software with confidence.

  • Even with AI code generation, you still need expertise if you're building anything beyond a toy project.

  • Finishing the code is just the beginning; deployment, observability, and security present additional challenges that current AI tools don't fully address.

Code Generation: Just the Tip of the Iceberg

  • For any serious production software, 80% or more of the cost comes after initial development—in what's called "Day-2 operations."

  • Day-2 operations present the biggest challenges.

  • Tools like Cursor, WindSurf, or even Devin can't fully solve deployment problems or make Day-2 operations effortless.

Best Practice First

Developers shouldn't need to learn several approaches to the same problem just to determine which is best. Ideally, there should be one solution representing best practices, freeing you from decision paralysis.

AIScript adopts Rust's web development best practices and encapsulates them directly into the language and framework, letting you focus on what matters most—your application's unique value.