5 ms·
No markup format will support interactivity well, you need a full scripting language with all of the standard features. I don’t think it’s possible to couple t
by wefarrell 4y ago
No markup format will support interactivity well, you need a full scripting language with all of the standard features.
I don’t think it’s possible to couple the interactivity and visual layout in a single language and have it make sense. We can certainly do better than JavaScript, HTML and CSS but I think there will still need to be at least two languages to describe layout and interactivity.
- wruza 4y agoSounds like hyperscript. Look at this hypothetical PyGtk example: i = 1 def click(event): i += 1 g.Window( g.Frame(title=“Hello”, g.VBox( spacing=10, g.Label( “i = %d” % i, expand=True ), g.Button(“click me”, click=click, ) ) ) ) Desktop frameworks could do this for decades instead of Glide XMLs or manual setup, but they didn’t.
- the_gipsy 4y agoNobody cares that you can build up a DOM differently, that's decades old. What matters is: how do changes behave? Your example shows nothing of the complications of lifecycles or state-render loops.
- wruza 4y agoRespectfully, that isn’t decades old. 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.
- ttfkam 4y agoJava 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.
- wruza 4y agoEvery 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_gipsy 4y agoYes 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.
- sparks1970 4y agoQooxdoo: https://qooxdoo.org/ https://qooxdoo.org/ It's a no-html, widget only web framework that's been going for at least 10 years.