hoplon

2023-04-26T19:04:09.389769Z

This is going down right now โฌ†๏ธ

2023-04-26T19:58:51.145299Z

thanks to all who attended, exciting stuff! here's that demo i showed: https://tailrecursion.com/~alan/ttt/basic.html ๐Ÿงต

2023-04-26T20:01:59.810699Z

and here's the channel for Ken's matrix project: #matrix

dave 2023-04-26T20:07:23.396129Z

Thanks again for organizing this, Alan! I had fun

2023-04-26T20:08:05.829089Z

my pleasure Dave thanks for coming

chromalchemy 2023-04-26T20:09:09.390289Z

Sorry i missed it guys. Travelling to the conj. Viva la Hoplon

2
2023-04-27T11:48:53.535529Z

Thank you Alan, it was great!

1
2023-04-26T20:07:33.307709Z

@dave sources and sinks here are the cell dependency graph edges; input cells have no sources https://github.com/hoplon/javelin/blob/master/src/javelin/core.cljs#L104. they are javascript arrays. in the past they were https://github.com/tailrecursion/cljs-priority-map ordered by https://github.com/hoplon/javelin/blob/master/src/javelin/core.cljs#L19 but now they are JS that we binary insert into, still sorted by rank

2023-04-26T20:10:43.835439Z

..from any cell you can walk the graph of any connected cells and learn possibly interesting things, or populate a graph like in the demo. using the JS debugger you can also find Cell instances even if they have disjoint graphs

dave 2023-04-26T20:12:26.727769Z

That's interesting! I'll have to explore that the next time I'm sifting through our cell spaghetti ๐Ÿ™‚

dave 2023-04-26T20:13:32.019259Z

I will say, though, that most of the time, I'm able to figure out any Hoplon problem by sprinkling (cell= (prn :my-cell my-cell)) in the affected areas

2023-04-26T20:14:38.675389Z

at a minimum i'm wondering about a bookmarklet or chrome extension that would economize e.g. setting watches on cells

2023-04-26T20:16:24.988419Z

ah that takes me back, the unreasonable effectiveness of (cell= (prn...

โ˜๏ธ 2
๐Ÿ–จ๏ธ 1
dave 2023-04-26T20:21:50.880209Z

I just thought of a common mistake that newcomers have made in our code base: not using the appropriate if-tpl or cell=, etc. when using a cell's value in an if statement. Something like this:

(p
  (if some-cell
    "truthy"
    "falsy"))
They might not realize that some-cell is a cell, and thus will always be truthy because it's a JS object. But the application appeared to work fine when they tested it because maybe they only tested the truthy path. It gets more confusing when you start getting into writing functions that return cells, because then you have to understand that the function returns a cell, and that cell= doesn't know that by default, so you have to either use formulet / formula-of or invoke ~ black magic (I still have no idea how that works!)

2023-04-27T11:55:16.205189Z

One way I saw in a reagent codebase is to make clear using naming conventions what is a cell or what returns a cell. Over there people used & as a suffix on ratoms (which would be the equivalent of cells in hoplon). Maybe you could also have something like &= for formula cells as those cannot be updated. Functions that returns cells/formula cells could also use the same naming convention. It is sort of ugly but effective when the convention is followed. But in a large codebase that would be confusing for sometime until that information is reliable.

2023-04-26T20:28:29.092579Z

๐Ÿ˜‚ . fwiw not much magic to ~, it's just a way to instruct the code walker not to wrap the succeeding form in the boilerplate that will dereference it

2023-04-26T20:29:03.401309Z

@hiskennyness i forgot to mention, and may be of interest to you, ECL (the CL impl.) is host to an increasingly viable wasm port

kennytilton 2023-04-26T20:32:23.700959Z

Good call! "They might not realize that some-cell is a cell,..." Do they get up to speed pretty quickly? Following up on sth: maybe look at wrapping React instead of HTML? I find it only takes a few weeks to wrap sth new. Except Flutter. That was three months. Almost killed me. ๐Ÿชฆ But going from HTML to React was pretty painless. I kinda stopped when I saw React saying they had to see all state -- that would not have worked. And then ClojureDart was released, so I moved on.

kennytilton 2023-04-26T20:33:43.672849Z

I think that state visibility constraint of React is opt-in for now. Have not looked in a while.

2023-04-26T20:34:54.913369Z

could definitely be a thing... hoplon's mediation with HTML is done entirely through a handful of multimethods, e..g https://github.com/hoplon/hoplon/blob/master/src/hoplon/goog.cljs... perhaps these could be implemented for React.Component

kennytilton 2023-04-26T21:38:14.007359Z

Yep. To me, anything like Hoplon/Javelin can be cast as a "reactive first" solution: start with well-executed (transparent, granular) reactive, then the rest (talking to HTML or React or Flutter) is just a pluggable UI backend requiring a few weeks or at worst months of gluing, a finite effort. We could even flip the arrow and truly turn, say, ReactNative into a plug-in, but then I suspect we make it hard to get to specific RN capabilities. A plug-in approach would not make the connection that much easier, so I like the unfettered access to the wrappee.

kennytilton 2023-04-26T21:56:51.091949Z

I should add that React was a breeze because I could lose all the low-level DOM maintenance, which I see Hoplon does -- I just had to call setState. Same with Flutter, btw. Flutter killed me with its low-level OO I had to make happen.

dave 2023-04-26T20:49:21.906479Z

It's hard to say whether or not people get up to speed quickly. I guess it probably varies from person to person. I'd like to think that it's easy to grasp, but I'm also biased because I learned Hoplon directly from its authors, in person, 8 years ago ๐Ÿ˜„

kennytilton 2023-04-26T21:42:39.126929Z

I worry about the bias a lot myself, having done it for 25 years and written the damn things. ๐Ÿ™‚ But have you found that some people never miss a beat? I have near zero adoption, but the little I have is people who I did not know existed until they shared some work--they had just figured it out from some examples. That's my excuse for not documenting the thing, btw. ๐Ÿ™‚

dave 2023-04-26T22:04:40.398329Z

It seems like most people do OK, but I also find myself providing a fair amount of Hoplon guidance. It's hard to tell if that's because we've done confusing things in our code in particular, or if Hoplon could benefit from having some kind of best practices guide or cookbook. Maybe it's both ๐Ÿค”

kennytilton 2023-04-26T23:41:52.603209Z

I think one thing missing in software today is libary authors finishing good work with more good work to make the d/x easy. I am looking at you, Linus. ๐Ÿ™‚ But the reason I am so high on Hoplon/Javelin is the transparent d/x. Plus I would rather work on making the d/x slicker than write documentation. ๐Ÿคฃ