-
Notifications
You must be signed in to change notification settings - Fork 0
Design Philosophy
Random thoughts as they come up on designing a cross-platform desktop UI using HTMLRenderer.
There is a temptation to design a desktop UI so that we can put it out on the web too. That is, the browser and the HTML/Javascript should not know if we are tightly connected to APL on the client machine, or if we are working over the internet. This seems like a good idea, we should write our code to be as general as possible. I think this is a mistake. First of all, it is very hard to do, and it puts severe restriction on what one can do. It defeats a lot of the purpose of having the HTMLRenderer in the first place. Once we have rejected this, all sorts of design options open up. PUT vs GET vs POST, none of that matters. Caching - doesn't matter. The semantics of HTTP - doesn't matter. The HTMLRenderer is simply a GUI object that fires events while APL listens and does things. For all intents and purposes, HTMLRenderer is built in to the interpreter. We are not doing HTTP.
There is no need to create complex pages a priori that hide and expose content based on user interaction (simple things like summary/details excepted). It can all be done live. When a user clicks a button, APL can respond and change as much of the page/screen as necessary by manipulating the DOM.
Related to "No Hidden Conent", there is no need for HTML Dialog elements that are hidden and exposed as needed. A dialog box is implemented as a new HTMLRenderer window, with a complete HTML document, generated at runtime and disposed of immediately upon completing.
There is no need for HTML forms excerpt perhaps as a semantic element. We don't need submit buttons that package up and post the name/value pairs. This can all be done very differently and more directly.
We don't know JavaScript and we don't want to learn it. All significant operations are done in APL. For example, transposing the rows and columns of a table - done in APL, not JavaScript. Trivial JavaScript snippets like setting a property of an element are sometimes necessary, but even this becomes less necessary as we get experience and build in commonly occurring patterns.
There is no escaping a good understanding of HTML, CSS and the DOM. If, in the past, we wanted to want write GUI in APL using the Win32 API, we needed to know ⎕WC
. If now we want to write GUI in APL using the browser, we must know HTML. HTML with CSS is ⎕WC. There is no useful way to hide the HTML. For example, just as we must understand the Attach property in ⎕WC
, we must know about the flexbox layout in CSS. Arguably HTML and CSS are much higher level concepts than ⎕WC
. It does not make sense to re-create ⎕WC with HTML.
We need to know about event bubbling, etc.