An early experiment with Kivy and a browser DOM
This is an introduction to the concept of a generic application model explored in this and the ensuing two posts.
The idea
The objective of the Generic Application project is to develop a way of describing an application independently of the technology used to display and operate it. The intention of the designer takes center stage.
Traditionally, an application is designed and implemented for a particular platform. A Kivy application is built using Python and Kivy widgets. A browser application is built using HTML, CSS and JavaScript. Although the two applications might look and behave similarly, their implementations are different.
The approach being explored here separates the description of an application from its execution.
The application is described through a structured application definition using canonical objects. This definition identifies the screens, their controls, the relationships between screens, the interactions available to the user, and the data required by the application.
A platform-specific runtime then interprets that description.
The same application definition could therefore be interpreted by a Kivy runtime, a browser-based DOM runtime, or another runtime developed in the future.
The principal parts
The concept has four important parts:
- Application definition — describes the complete application and its screens.
- Screen definitions — describe the controls, their identities, properties and geometry.
- Interactions and data — describe what happens when a user operates a control and how application data is accesse
- Runtime — interprets the definition and creates the actual user interface on a particular platform. The runtime is not supposed to contain the business identity of a particular application. Its responsibility is to interpret the application definition and translate its elements and interactions into the facilities offered by its platform. For example, a BUTTON in the application definition becomes a Kivy Button in one runtime and an HTML button in another. The application definition does not need to know the implementation class used by either platform.
A small illustrative example
The following is conceptual pseudocode, not a complete implementation or a claim about the exact schema of the current project:
{
"application": "SampleApplication",
"screens": [
{
"id": "SCREEN_1",
"controls": [
{"id": "LABEL_1", "type": "LABEL", "text": "Welcome"},
{"id": "BUTTON_1", "type": "BUTTON", "text": "Continue"}
]
}
] }
A runtime reads this definition and creates the corresponding native controls. The runtime also associates the declared interactions with those controls.
The important point is that the application description identifies what is required, while the runtime determines how it is implemented.
Other possible platform runtimes
Although the first practical demonstrations have used Kivy and a browser DOM, the same architectural approach could be explored with other frameworks.
For example:
Qt / PySide — for desktop applications using Python and Qt widgets.
Flutter — for applications targeting mobile, desktop and web through Flutter's widget system.
React — for browser applications using component-based rendering.
.NET MAUI — for applications targeting several Microsoft-supported desktop and mobile platforms.
These are potential future runtimes, not implementations already completed in this project. Each would require an interpreter that maps the common application definition, controls and interactions to the framework's own facilities.
The advantage is that the application description need not be redesigned merely because a different rendering framework is selected.
AI and voice as application-creation methods
A further possibility is to use Artificial Intelligence and voice input to create applications.
Instead of requiring every screen and control to be configured manually, a user could describe the application in ordinary language.
For example:
"I want an application with a welcome screen, a recording screen, a listening screen and an administration screen. The welcome screen should identify the user. The recording screen should allow a recording to be made and submitted."
An AI system could interpret this description and help produce the structured application definition: screens, controls, geometry, interactions and data requirements.
Voice input could make this process more natural. A user could describe a screen, request a change, or specify an interaction by speaking. The resulting instructions could be translated into the same structured application model used by the conventional designer.
This creates an important distinction:
AI or voice can help create and modify the application description.
The generic runtime is responsible for executing the resulting application.
AI does not have to be embedded in every runtime. It can be used at design time, while the resulting application can execute through conventional, predictable runtime code. Where an application genuinely needs AI during operation, that capability can be provided as a separate service or declared operation.
The longer-term vision is therefore not simply a generic screen renderer. It is a possible route from a person's spoken or written intention to an actionable application.
Why this separation matters
This architecture offers several possibilities:
An application can be designed without committing to one display technology.
The same application definition can be tested using different runtimes.
Platform-specific implementation can be changed without redesigning the application.
A new runtime can potentially support existing application definitions.
Application behaviour can be examined independently of the graphical implementation.
AI and voice can be used to assist in creating and modifying applications without tying the application definition to one AI system.
The idea does not mean that every platform will behave identically or that every control will automatically be supported. Each runtime must implement the controls, events and data operations it claims to support.
The objective
The long-term objective is a generic application system in which an application is described once and interpreted by different platform-specific runtimes.
Beyond that, the system could allow people to describe applications through ordinary language or voice, with AI helping to translate those intentions into executable application definitions.
The experiments described in the following articles are an early practical investigation of the first principle: one application description, interpreted by different runtimes.
No comments:
Post a Comment