4 ms·
There is an interesting synergy at play amongst UI as s-exprs, functional programming, and components/vdom where the whole is more valuable than the sum of its
by aaron-santos 8y ago
There is an interesting synergy at play amongst UI as s-exprs, functional programming, and components/vdom where the whole is more valuable than the sum of its parts. I was surprised to find no mention of Reagent[1] nor Om[2] both ClojureScript interfaces to React. They share a remarkable similarity with Umbrella especially the s-expr syntax. However, Reagent[1] and Om[2]'s language choice pushes the functional composition further.
I'm interested to see this how this combination of ideas spreads outside the browser and into other applications of UI. As for myself, I've been experimenting with a writing a terminal emulator/component lib[3] using Clojure that is inspired by Reagent/Om and React Native. It's been satisfying seeing the way these ideas compose.
[1] - https://reagent-project.github.io/ https://reagent-project.github.io/
[2] - https://github.com/omcljs/om https://github.com/omcljs/om
[3] - https://github.com/aaron-santos/zaffre/blob/master/src/examples/components.clj https://github.com/aaron-santos/zaffre/blob/master/src/examp...
- geokon 8y agoThis is by the same guy who wrote the massive thi-ng/geom library for Clojure, so the influence is implied ;)
- toxmeister 8y agoI actually did mention Reagent in the readme in this section (below the diagram): https://github.com/thi-ng/umbrella/tree/master/packages/hdom#the-hdom-data-flow https://github.com/thi-ng/umbrella/tree/master/packages/hdom... Quote: "The syntax is inspired by Clojure's Hiccup and Reagent projects, which themselves were influenced by prior art by Phil Wadler at Edinburgh University, who pioneered this approach in Lisp back in 1999. hdom offers several additional features to these established approaches." However, Reagent also still relies on React under the hood whereas hdom is completely standalone. Also, hdom has a lot more features in terms of what kind of values are supported within an hiccup tree and additionally, in this latest version (5.0), hdom already has been extended to support non-DOM targets to update. Currently, the only user of this feature is the hdom-canvas package (https://github.com/thi-ng/umbrella/blob/master/packages/hdom-canvas/README.md#about https://github.com/thi-ng/umbrella/blob/master/packages/hdom...), which allows you to define canvas scene graphs in the same way as the rest of the UI, but those virtual shape elements are translated into canvas draw calls. A WebGL version of this is in early progress. In general, by implementing a certain interface you can support any other target context/data structure. Ps. I've never used Om so didn't list it as an active influence.
- aaron-santos 8y agoThank you for pointing that out. My mistake in missing it!