Re:Breaking up with JavaScript front ends
by the_gipsy on Sunday December 11, 2022 @10:29AM
(#33943957)
Yes and no. That you can build a hierarchy with Element(attrs, children) where attrs may include callbacks is really decades old. Plain JS does it, react and angular do, and also a million template languages.
The question is, how can we not end up in a spaghetti ball? Your scripting style alone brings nothing to the table.
I would look up to something like Elm, which does answer OP's question.
Re:Breaking up with JavaScript front ends
by sparks1970 on Monday December 12, 2022 @04:42AM
(#33952783)
Qooxdoo: https://qooxdoo.org/
It's a no-html, widget only web framework that's been going for at least 10 years.
Re:Breaking up with JavaScript front ends
by ttfkam on Sunday December 11, 2022 @09:28AM
(#33943489)
Java Swing is decades old (1998?) and does everything you list above. Was even embeddable as a browser applet in all major browsers at the time.
Every swing tutorial out there starts with a good old:
c = new Container()
w = new Widget()
c.add(w)
w.addActionListener(
…200 bytes of a functor boilerplate…
)
Also I don’t know java well, but variable/keyed arguments and closures like in python do not exist there, to my knowledge.Am I missing something, or maybe you meant something else?
The example above is brief due to forum limitations, so yes, it doesn’t include lifecycles or the whole implementation of a rendering loop. But the context of that comment was using one or more languages for building interactive hierarchies of widgets, and not the topic you brought up, so it didn’t even have to.