DEV Community

Cover image for I built a YAML to Code compiler, currently available for .NET and Vue
Tim Cadenbach
Tim Cadenbach

Posted on

I built a YAML to Code compiler, currently available for .NET and Vue

What if we could describe an entire application instead of writing or generating all of its code?

With Cordango, we can describe an application entirely in YAML. Everything from entities, relationships, permissions, workflows and automations to views, screens and ready-made UI components. Let me start with a few examples of a fully working application:

entity: expense_claim

fields:
  submitted_by:
    type: reference
    targetEntity: person

  amount:
    type: money
    currency: EUR
    required: true
Enter fullscreen mode Exit fullscreen mode

or this..a little bit more involved:

entity: assumption
ownedBy:
  parent: scenario
  via: scenario
  as: table
display: statement
fields:
  statement:
    label: Assumption
    type: text
    required: true
  scenario:
    label: Scenario
    type: reference
    required: true
    indexed: true
    targetEntity: scenario
    onDelete: cascade
Enter fullscreen mode Exit fullscreen mode

And this isn't limited to entities or CRUD.
Automations can be described in the same vocabulary:

automation: build_segment_grid
name: Lay out a segment's lifecycle
effects:
  - type: createForEach
    set:
      scenario: '{{record.scenario}}'
      segment: '{{record.id}}'
      point: '{{source.id}}'
      label: '{{record.name}} {{source.label}}'
      flex:
        pick:
          entity: revenue_plan
          filters:
            - field: scenario
              operator: eq
              value: '{{record.scenario}}'
            - field: tier
              operator: eq
              value: flex
          sort:
            - field: name
              direction: asc
Enter fullscreen mode Exit fullscreen mode

We can describe the whole application with YAML definitions, from entities, relations, workflows, automations, permissions up to views and screens and readymade widgets...its all in YAML.

Everything is specificly made for agentic development. The project comes with a CLI that is specificly made for agents to have an easier time writing the specs.

Heres one example we built with this:

Give it a try...The CLI is free and open source.

macOS / Linux (Homebrew)

brew install cordango/tap/cordango
Enter fullscreen mode Exit fullscreen mode

macOS / Linux (install script)

curl -fsSL https://cordango.com/install.sh | sh
Enter fullscreen mode Exit fullscreen mode

Windows (Scoop)

scoop bucket add cordango https://github.com/cordango/scoop-bucket
scoop install cordango
Enter fullscreen mode Exit fullscreen mode

Dotnet Person?

dotnet tool install -g Cordango.Cli
Enter fullscreen mode Exit fullscreen mode

Now create your first application:

cordango new expenses
cd expenses

# Validate the application definition
cordango check

# See the available compilation targets
cordango targets

# Configure where your app should run
cordango configure

# Generate the application
cordango build
Enter fullscreen mode Exit fullscreen mode

To start the generated application:

cd generated/expenses
docker compose up --build
Enter fullscreen mode Exit fullscreen mode

Open http://localhost:8080 and create your administrator account.
Need something immediately to try just clone our examples and run them https://github.com/cordango/examples

Enough? check out https://github.com/cordango or the CLI directly https://github.com/cordango/cordango

...want to hear more? Just stay with me :)

Built for agents, but not dependent on Coding models, I already built an app with simple old ChatGPT. One important distinction: Cordango doesn't need an LLM to compile an application. The compiler is deterministic. The same specification and generator versions produce the same output. AI can help write and maintain the specifications, but the actual build doesn't depend on prompts, tokens or an external model. You can write everything manually if you prefer.

It's still early...

The first compiler target is available, with more planned.

Currently .NET/Vue/Postgres is available. Node already half way there, more to come.

I'm particularly interested in feedback from developers who build internal applications, use AI coding agents, or have experimented with specification-driven development.

Does this approach make sense to you? What limitations would you expect from a specification-based application format?

I'd love to hear what you think, especially where you believe this approach would break down.

GitHub: https://github.com/cordango/cordango

Documentation: https://docs.cordango.com

#opensource #dotnet #ai

Top comments (0)