Note I really agree with @JohnAD about not trying to do both retained mode and 
immediate mode, or even a declarative UI layer initially.

Here's a list of things I think would be good for a pure Nim UI:

1\. Figure out either async or a good event system upfront

  * Pretty much _all_ of the widely used UI's provide mechanisms for "events" 
like Qt's slots and signals.
  * Consider making it all _async_ first, as async provides event mechanisms 
already and would encourage javascript like non-blocking programming.
  * Alternatively copy another good event system based on objects and things 
like Cocoa's observer pattern.



2\. Figure out how to use native text input widgets for text input!

  * This would save many developer months (years?) of effort and give the UI a 
_chance_ of competing with UIs with major resources behind them.



  3. Support NimScript from the get-go or provide a text based method to define 
the UI.
  4. Use the DLL / shared library approach for fast compiling.



5\. Use _CSS Grid_ for layouts! (I'm not 
[biased](https://github.com/elcritch/cssgrid) though).

  * CSS Grid is probably the most well thought out modern UI constraint system 
that's also easy to use. Note that's not CSS Flexbox, etc. CSS Grid is much 
saner than those, IMHO.



6\. Consider ripping off an existing UI system whole sale ;)

  * As in use `c2nim` to blatantly copy the core of gtk4, tkinter, Godot or 
something. Turn pointers to ref's. Then make the programming UI Nimmified, and 
only afterwords Nimify the internals.
  * Though I still think a Nim browser + NimScript for an html subset like 
Sciter would be the coolest. ;)


Reply via email to