Declare is a UI language for you and your AI

By hackernews · · AI News

Declare is a UI language for you and your AI

Just as SQL is a domain-specific language for database queries, Declare is a DSL for user interfaces — for taking the custom, fluid experience you have in mind beyond a prototype, into a real app: structured, verifiable, and with the design written plainly in its code.

Expressive. And verifiable

A calendar that zooms through time, a desktop with real windows: complete programs, each readable end to end and checked by the compiler. Open one, or edit it live in the browser you’re using.

Day, week, month and year views are one surface, zooming continuously; a view doesn’t switch so much as become the next one, and every motion can be interrupted. It runs on real data: drag an event to another day, and it’s moved.

lines of code, plus 228 of comments — four views, zoom, drag and edit

over the wire, gzipped — app (structure, logic, styling) and runtime

lines typed by hand — human-designed and directed, built with AI

The acid test for a UI language: multiple applications, windows that drag, resize, layer and minimize into live thumbnails, a magnifying dock, menus that follow focus, and separately loaded apps running inside its windows. Elsewhere that is a project assembled from several libraries; here it is one program.

3529 lines — 2011 code, 939 comment · 264 KB over the wire · every pixel drawn from shapes, no image assets

What Hacker News is saying

  • “neat…”
  • “This looks quite nicely done.”
  • “I was working on a similar concept - Morpheus Snippet - ``` document ::= ( comment | blank ) screen-line body body ::= ( element-line | comment | blank ) element-line ::= indent kind [ name ] meaning* [ mod…”
  • “Next time you try to build a UI tech, make sure your site isn't ugly.”

Read the full discussion on Hacker News →

Source: https://davidtemkin.github.io/declarelang/

More stories