Design a custom UI DSL from the ground up. Assume that a custom interpreter will be made for it. The goal is to have a language that is both powerful and elegant. Consider how logic and styles will be handled, and whether they should be embedded or separated. Work by creating drafts and iterating until you can no longer improve it anymore. When evaluating, consider how easy the language is to read, edit and write (low boilerplate and low verbosity), expressiveness (supports everything a UI DSL should) and elegance (high developer satisfaction). Make sure to consider different types of syntax, and try to iterate and optimize it for elegance, expressiveness, readability and developer experience.
When evaluating, try to think from the perspective of a developer, and consider questions like: What is easiest to read? What is easiest to write? What is easiest to modify? Which one looks the most elegant? Which makes it easiest to see the structure? You can assume that the styling and layout system is custom too (although the main purpose right now is to design the DSL).
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Designing a custom UI DSL (Domain-Specific Language) from the ground up is a powerful way to improve developer experience, especially when building UIs that are complex or need to be consistent across platforms. The goal is to create a language that is:
Expressive: supports all the features a UI DSL should (components, layout, styling, logic, interactivity, etc.)
Elegant: clean, readable, and satisfying to work with
Low-boilerplate: minimal repetition and ceremony
Flexible: allows for logic, styles, and structure to be defined clearly and modularly
Scalable: suitable for small or large UIs
Developer-centric: designed with the developer in mind—easy to write, read, and modify
We'll approach this by going through several draft iterations, each refining the language based on the criteria above.
✅ Goals Recap
Design a UI DSL from scratch.
Assume a custom interpreter will exist.
Support layout, styling, logic, and interactivity.
Decide whether to embed logic/styles or separate them.
Focus on developer experience: readability, editability, writability, elegance, and structure visibility.
🧱 Draft 1: Naive Tree-Based DSL
We'll start with a tree-based structure, where UI elements are defined hierarchically.