Declare: a UI language built so AI can tell when it's wrong
Declare is a UI language for you and your AI
Declare is a new UI language where layout, motion, states, theming, and drawing are part of the language itself rather than bolted-on libraries. Demo apps include a zoomable calendar (568 lines), a full desktop with draggable windows (3,529 lines), and a million-issue tracker with no virtualization code. The pitch centers on AI: a six-rung verification ladder from parse to pixels lets an agent check its own work. In one early test, the same agent built a ticket app in 1,279 Declare lines versus 2,666 in React, passing 11 hidden checks to React's six.
Your AI can write the code. Can it tell when it's wrong? In Declare, yes.
- saidinesh5
I think Qt/QML really reached hit sweet spot for me when it comes to describing UIs (ignore if any syntax errors, doing this from memory):
For eg. compare this:
```
Window {
textColor: "slategray"
property int v: 40
ColumnLayout {
id: layout
anchors.fill: parent
spacing: 20
Text {
id: number
Layout.alignment: Qt.AlignHCenter
font.pixelSize: 70
text: v
}
ProgressBar {
id: progressBar
Layout.alignment: Qt.AlignHCenter
value: v/100
color: v < 50 ? "dodgerblue" : "turquoise"
}
}
MouseArea {
anchors.fill: parent
onClick: v = (v+20)%100
}
}
```
with Declare:
```
App [ textColor = slategray,
group: View [ x = center, y = center, width = 80%,
layout: SimpleLayout [ axis = y, spacing = 20 ],
number: Text [ width = 100%, textAlign = center,
fontSize = 70, fontWeight = bold, text = { "" + v } ],
bar: Gauge [ width = 100%, value = { v },
tint = { v < 50 ? cool : warm }, accessibilityLabel = "v" ],
hint: Text [ width = 100%, textAlign = center,
text = "click anywhere to change v" ]
],
v: number = 40,
cool: Color = dodgerblue,
warm: Color = turquoise,
onClick() { v = (v + 20) % 100 }
]
```
- abrookewood
The LLM language is pretty off putting: "Say what you mean. Exactly" and then in the code comments "// One value, v, and three things that follow it". It's such an awful way of writing.
- samrus
The claudish here got unreadable after a while. The project's thesis really should be written by a human. Shame becuase it seems like an interesting idea
- mtford
First contact marketing pages and core documentation should be written by a human. This sounded interesting but my eyes glazed over as soon as I detected the AI smell...
- skybrian
This looks quite nicely done. I'm reluctant to try it solely because the website has so much marketing-style writing (probably AI-generated) and I'm not sure I want to read more of it.
It should probably say up front that this is an npm package along with the tooling for it, and the output runs in a browser.