Code as data for UI

13th November 2022 at 8:53pm
GUI

These days most software allows you to download your data as JSON/CSV but it still come with a few issues:

  • if the new tool you want to move your data requires specific formatting (e.g it uses "tags" rather than "labels", etc.), you will have to do the formatting by yourself
  • maybe you simply don't like how bloated the software became but you can't go back to a previous version

However, tools like Drawing Dynamic Visualizations by Bret Victor would make things a lot easier – the UI is defined in relationship with the data (this is what Elm is doing).

Another option, what if you could export the UI as well as your data? For example, if I click a button and go to another page, I can't represent this with JSON. The best I can do is to create an onClick property with some string:

{
  onClick: "function {
    changePage()
  }"
}

So what's better than that? Any language that represents code as data like REBOL ("machine-independent executable expressions") or Lisp.

But is it not the same thing as having the source code? Will companies be able to stay competitive? Maybe companies can keep the rendering engine? (maybe have a look at The complete guide for open sourcing video games )

Does it mean that my app is now truly decentralized?

Related to