Declare is a UI language for you and your AI
Declare introduces a new UI language aiming for extreme expressiveness and verifiability, allowing complex interfaces to be built with minimal code. It positions itself as a tool for both humans and AI, sparking curiosity and skepticism among developers. The Hacker News community is intrigued by the technical ambition but critical of the marketing style and the somewhat vague AI connection.
The Lowdown
Declare is presented as a novel UI language designed to make interface creation more direct, expressive, and verifiable. The creators emphasize that core UI concepts like layout, motion, states, theming, and drawing are intrinsic to the language itself, rather than relying on external libraries. This approach aims to allow developers to articulate their UI vision precisely and have it checked by a compiler.
- Expressive & Concise: The language claims to enable the creation of sophisticated UIs, such as a continuously zooming calendar or a full desktop environment with windows, in hundreds rather than thousands of lines of code.
- Verifiable: Relationships within the UI are maintained by the language, ensuring consistency and allowing the compiler to check the integrity of the interface.
- AI Integration: A key marketing point is that Declare is "for you and your AI," suggesting it's designed to be easily understood or generated by AI, though specifics are light.
- Performance: Applications built with Declare are touted as being lightweight, with small gzipped sizes for both the application logic and runtime.
- Examples: The project showcases several impressive demos, including an interactive calendar, a functional desktop, an issue tracker handling a million items without virtualization, weather apps, market maps, and even games like Asteroids.
Declare seeks to offer a holistic solution to UI development, integrating many traditionally separate concerns into a unified language, promising a more direct path from concept to interactive interface.
The Gossip
AI Ambiguity & Marketing Misfires
Many commenters expressed confusion and skepticism regarding the advertised "for you and your AI" aspect of Declare. They questioned the practical implications of AI in this context and felt the marketing language on the website was generic, potentially AI-generated itself, and lacked concrete technical details. This led to an initial reluctance for some to dive deeper into the project.
Syntax Scrutiny & Aesthetic Aversion
The visual presentation of the Declare language and its website drew mixed reactions. Some critics found the language's syntax to be "braindead" or ugly, comparing it unfavorably to other complex syntaxes like Rust. Others commented directly on the website's aesthetics, suggesting that a UI technology should present itself with a more appealing design.
Declarative Dreams & DSL Debates
Several developers resonated with the core idea of a declarative UI language, noting that they had worked on similar concepts themselves. The discussion touched upon the broader trend of Domain-Specific Languages (DSLs) for UI, with commenters sharing insights into their own projects and approaches, such as using CUE with templating for module development.