I'm hoping one day someone in Nim would adopt approach pioneered by Phoenix 
LiveView, that allows to create a lot with very little code.

It's better to showcase by example, take look at gif and the full code it's 
made with <https://twitter.com/joerichsen/status/1109122286139965441>

Advantages vs Modern Web Apps like React/Karax:

  * Reactive, fluid Web UI (React/Karax can do that)
  * No need to write Network Code (React/Karax require REST/socket API)
  * No need to handle latency and N+1 problem (React/Karax need to handle that 
and query server in a way to avoid N+1)
  * I.e. much less code.



Advantages vs Old Web Sites like PHP/RoR/Django:

  * Reactive, fluid Web UI (PHP/RoR/Django much, much harder to do with 
AJAX-like tricks, turbolinks, dynamic updates etc.)
  * Declarative, reactive UI with smart DIFF (PHP/RoR/Django can't do that)
  * I.e. much less code.



Costs:

  * More complicated, statefull server storing the UI state.
  * Higher (not if done right, as in Phoenix) server load, because DIFF 
algorithm will be run on server.
  * High badwidth usage (not if done right, as in Phoenix).
  * Tiny, but unavoidable latency for user. Makes it impossible to use for some 
web apps like highly interactive games.



But, for usual Sites, Web Apps, and especially for Admin UI - it's ideal. Very 
little code to write to get things done.

Hope some day one bright Nim developer can alter/adopt Karax to work on server 
the way Phoenix LiveView do. As far as I know Nim and took a look at Karax - it 
should be quite possible... Karax should run on server and all the 
events/html-diffs to apply to DOM should be serialized and sent back and forth 
over network.

Reply via email to