hoplon

The :hoplon: ClojureScript Web Framework - http://hoplon.io/
GusWill 2021-01-18T15:41:59.024500Z

@euccastro Thanks, you've touched on the very point that I'm trying to wrap my head around: If the programming models are more similar than different, what's Hoplon's selling point? Reagent's is, of course, wider adoption.

GusWill 2021-01-18T15:43:22.025600Z

btw, I'm not trying do diss Hoplon... just trying to understand how it is different from Reagent since, in my limited experience, they seem almost the same thing but with different apis.

2021-01-18T16:11:29.026500Z

i don't know a whole lot about reagaent, but afaict the (abiding) main difference is the separation between javelin and HTML. the manner in which changes propagate through cell networks is decoupled entirely from how or where those values are consumed by UI components

2021-01-18T16:12:24.027100Z

another way to describe this is, dereferencing a javelin cell is not a side effect. whereas in systems like reagent, dereferencing has the side-effect of publishing liveness

☝️ 1
2021-01-18T16:13:20.028Z

one tradeoff here is that javelin cells can "leak" in ways ratoms can't, because the connections between cells endure even without usage

2021-01-18T16:13:54.028800Z

one advantage is that you can rely on the values of cells when you dereference in non-UI contexts, such as in e.g. ajax callbacks or other handlers for events that originate on the server

2021-01-18T16:15:46.029900Z

another advantage of the ratom way, that couples nicely with react, is that the equality semantics of the values contained in ratoms are immaterial

2021-01-18T16:16:05.030400Z

that is, any attempt to cause a change will cause the change to propogate. which in reagent works out fine because react ultimately de-dupes

2021-01-18T16:18:54.032300Z

hmm, reagent might actually leverage clj data equality to dedupe internally, i can't remember. but i know meteor.js used a similar system and it paired well with the lack of structural equality in native JS data

2021-01-18T16:28:26.033500Z

but to (finally) answer your question, i think maybe hoplon's main selling point is javelin, and javelin's main selling point is its total separation from UI concerns. its a pure data management library. with one known application, HTML management πŸ˜†

GusWill 2021-01-18T22:22:11.035100Z

thanks for the thoughts @alandipert... I think I do understand it a little better now... because of javelin, hoplon's model is maybe more decoupled from the ui.

flyboarder 2021-01-18T22:23:32.036500Z

hoplons model could really be used with any UI generating thing, we just have an implementation for HTML Elements

flyboarder 2021-01-18T22:23:50.037200Z

there is also an implementation for JavaFx (out in the wild)

2021-01-18T22:24:21.037700Z

javelin is completely decoupled from the UI, really.. things built on it are suggestions of how to couple

πŸ‘ 1
2021-01-18T22:24:57.038400Z

but there are attractive efficiencies of coupling, and so that space is inhabited by lots of other libraries too

GusWill 2021-01-18T22:25:33.038900Z

I will be basically doing rx programming, and the dom is just the buffer.

2021-01-18T22:25:34.039100Z

efficiencies like limiting the shape/size of data you want to map to the dom, different ways of naming relationships between data and UI elements, etc

GusWill 2021-01-18T22:27:11.040200Z

TBH, I've watched a few Hoplon presentations and i feel somewhat stupid because I can almost grasp where the presenter is getting at but not really.

flyboarder 2021-01-18T22:27:41.040900Z

That seems to be the common learning curve

GusWill 2021-01-18T22:27:43.041Z

but then I read some hoplon code and it seems so simple.

flyboarder 2021-01-18T22:28:08.041500Z

once it clicks, libraries like react and shadow dom make no sense anymore

GusWill 2021-01-18T22:28:16.041700Z

thank god I'm not the only one @flyboarder

GusWill 2021-01-18T22:28:30.042Z

πŸ˜‚

flyboarder 2021-01-18T22:28:35.042200Z

I have someone on my team who is also going through the learning

flyboarder 2021-01-18T22:28:54.042900Z

100/100 times they are always over complicating the logic, and it comes down to poor abstractions

GusWill 2021-01-18T22:29:01.043300Z

so in theory I could write a Javafx buffer for javelin then? or even swing?

flyboarder 2021-01-18T22:29:02.043400Z

when you fix the abstractions it all falls into place

GusWill 2021-01-18T22:29:52.044800Z

it makes sense. so you start with modeling javelin cells and formulas before writing the UI?

flyboarder 2021-01-18T22:30:19.045400Z

@guswill yeah the real secret to how this works is that we implement IFn for HTMLElement, you could do that with any UI generating thing, then the second piece of magic is wiring the attributes to events/jcells and BAM πŸ’₯ you reimplemented Hoplon

GusWill 2021-01-18T22:32:51.047800Z

it's funny because a few fellow clojure programmers recommended I check reagent out because it's more popular. I posted the same question in #reagent and got a ton more responses here.

GusWill 2021-01-18T22:33:09.048200Z

so, thanks everyone for being so friendly.

GusWill 2021-01-18T22:33:33.049100Z

I wil refrain from posting more n00b questions here in the meantime.

flyboarder 2021-01-18T22:33:48.049400Z

I think reagent is popular because of react being popular in JS land -> the more you move to CLJS land the less you want to deal with JS Libs

flyboarder 2021-01-18T22:34:48.050400Z

@guswill questions are always welcome, clearly there is a learning curve and getting it explained well and educating devs is a bit more difficult

flyboarder 2021-01-18T22:35:16.051200Z

but it’s worth it - we have a huge app written in Hoplon exclusively and it’s awesome πŸ™‚

2021-01-18T22:36:03.052300Z

yeah keep bringing the questions please!

GusWill 2021-01-18T22:36:33.052800Z

it makes sense... as an outsider, it feels like reagent is more popular because react is popular but there's not a lot of enthusiasm for the paradigm. not the same I'm seeing for hoplon here, at least.

GusWill 2021-01-18T22:37:19.053500Z

thanks guys. let's hope it will sink in at some point.

πŸ‘ 1
2021-01-18T22:40:37.055900Z

one activity that might be illuminating is starting with just javelin, you'll encounter all the fundamental problems on the road to what hoplon is

2021-01-18T22:41:17.056700Z

which are approximately the same as those react concerns itself with

GusWill 2021-01-18T22:41:31.057300Z

do you have any resources you could point me to besides javelin's docs?

flyboarder 2021-01-18T22:41:48.057700Z

@guswill hoplon wiki

πŸ‘ 1
flyboarder 2021-01-18T22:42:01.057900Z

this channel

flyboarder 2021-01-18T22:42:27.058300Z

good ol’ fashioned trial and error

πŸ™ƒ 1
flyboarder 2021-01-18T22:45:17.059100Z

@guswill is there anything you are currently building or evaluating hoplon for?

2021-01-18T22:47:57.060400Z

afaict the wider clojurescript community considers the matter of UI more or less settled, and in favor of reagent and derivatives, and this works for most people because nowadays nobody ever gets fired for choosing React

2021-01-18T22:49:48.062100Z

but javelin is still interesting, being separate from UI and not having a react dependency. in some sense, anyone who uses it has more leverage. but also, fewer things to google and fewer friends to help

GusWill 2021-01-18T23:28:11.065Z

I'm evaluating it for an internal tool for my workplace. we have a legacy CRUD-y, angular 1.0-based business app that needs to be updated... at first I wanted to use reagent but we use a lot of dom-modifying libs, hence hoplon.

πŸ‘ 1