I got tired of AI writing 500 lines of C# boilerplate, so I built a language that forces it to generate strict architecture
We all use ChatGPT, Claude, or Copilot to write code. It's great for simple scripts. But the moment you ask for a real Enterprise microservice (with Kafka, Redis, and Saga patterns), the AI gives you a massive wall of te
We all use ChatGPT, Claude, or Copilot to write code. It's great for simple scripts. But the moment you ask for a real Enterprise microservice (with Kafka, Redis, and Saga patterns), the AI gives you a massive wall of text.
You spend hours reviewing it, fixing missing dependencies, wiring up DI, and realizing it wrote an insecure SQL query.
I got so frustrated with this that I started asking a different question: What if I don't ask the AI to write code, but ask it to compile a strict architectural blueprint?
That's how tommylang was born.
π What is tommylang?
It's an AI-native DSL with a custom file extension (.ty). You don't write public class UserService or async Task. You write pure intent.
Here is an example of a payment endpoint in Tommy:
[Saga]
[Outbox]
[Idempotent(key = 'order_id')]
[REST('/api/payments')]
[Auth(oauth2 = 'client_credentials')]
create_payment (@order_dto order) {
? order.amount <== 0.0 {
<= bad_request('Amount must be greater than zero')
}
@db.query('INSERT INTO payments ...', { id = order.id })
[Event('payment_created')].publish({ id = order.id })
<= created('Payment processed')
}
When you run our CLI (tommycli), it sends this to GPT-4o with a strict System Prompt. The AI doesn't just write code; it generates a <pre-flight> architecture plan, UML diagrams, and idiomatic C#, Rust, or Python.
π The Coolest Features
Here is what makes tommylang different from "just a prompt":
1. Semantic Typography (TommyColor)
We designed a custom VS Code theme where color represents architecture, not just syntax. Purple is for logic (if, return), Green is for Classes/Interfaces, Blue is for Functions, and White is for Variables. Code reviews become 10x faster.
2. Built-in Enterprise Patterns
You don't need to explain to the AI what a Saga or Circuit Breaker is. You just use [Saga] or [CircuitBreaker]. The prompt forces the AI to generate the exact framework implementations (e.g., MassTransit for C#, or Polly).
3. Polyglot by Design
Write once, compile anywhere. Tommy targets C#, Python, Rust, Go, PHP, and TypeScript. Because the blueprint is abstract, the AI doesn't carry over C#-specific boilerplate into Rust.
4. OS-Level & AI-Agents
It's not just for web dev. We have annotations for [Ring(0)] (bare-metal Rust #![no_std]) and [Agent] (LangChain / CrewAI integration).
π§ How it works under the hood
Tommy uses the "prompt-as-compiler" approach. The entire logic lives in a single System Prompt (COMPILER_PROMPT.md).
It enforces strict rules: snake_case for functions, = for all data, and : only for logic. If the AI hallucinates, the prompt forces it to fail the AST dry-run.
π Try it out
The project is in early Alpha, but you can test the VS Code theme and the CLI right now.
- VS Code Theme: TommyColor
- GitHub Repo: tommylang
I'd love to hear your thoughts. Is this something you would use for your next microservice, or is it overengineering? Let me know in the comments!
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.