An unofficial, read-only Hacker News reader.

Declare is a UI language for you and your AI (opens external site)

127 points by ilamont 5 days ago | davidtemkin.github.io | 98 comments on HN

View full thread · View on Hacker News

Comment thread (7)

  1. 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* [ modifiers ]

    ```

    Replies (2)
    1. Myself too, they are all essentially DSLs with a transpiler to underlying tools and packages in a given language. Mine is different by allowing module developers to control the output technologies and DSL if they want, boiled down to CUE + text/template. Downstream users get a similar experience to this post.
      Replies (2)
      1. My focus was essentially to be able to define this and let agents use these to build the interfaces. This `...with a transpiler to underlying tools and packages in a given language.` is an interesting idea, but I just want to focus on the language specs and compiler.
        Replies (1)
        1. > but I just want to focus on the language specs and compiler

          I'm using "a transpiler" loosely to cover when the input is a DSL and output is something like react, tanstack, node - but tech choices are flexible here

      2. Replies (1)
        1. Both of those are too much DSL (imo). My approach involved no business logic, because that never works out, and focussed on generating/maintaining boilerplate, while also allowing users to modify the generated code and have it survive regen (diff3)

          https://hofstadter.io/code-generation/

          I'm migrating / renaming / cleaning up the project this week

          https://github.com/verdverm/veg

    2. This was take 2

      ```

      document = { template } ;

      template = "@template", identifier, newline, { node }, "@end", line-end ;

      node = group | row ;

      group = "<", identifier, ">", newline, { node }, "</", identifier, ">", line-end ;

      row = atom, { "|", atom }, line-end ;

      atom = reference | component | spacer ;

      reference = "[[", identifier, "]]" ;

      component = "[", label, [ "|", identifier, { "|", property } ], "]" ;

      property = identifier, "=", value ;

      value = json-scalar | binding ;

      label = label-part, { label-part } ;

      label-part = literal-text | escape | binding ;

      binding = "{", identifier, { ".", identifier }, "}" ;

      spacer = "..." ;

      line-end = newline | end-of-file ;

      ```

      Still evolving.

      Core idea is to be able to define interfaces in a minimal language, without going into too much details about attributes, say height, width, etc