Fork me on GitHub
#hoplon
<
2023-04-26
>
alandipert19:04:09

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

alandipert19:04:51

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

alandipert20:04:59

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

dave20:04:23

Thanks again for organizing this, Alan! I had fun

alandipert20:04:05

my pleasure Dave thanks for coming

chromalchemy20:04:09

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

hoplon 4
mynomoto11:04:53

Thank you Alan, it was great!

simple_smile 2
alandipert20:04:33

@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

alandipert20:04:43

..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

dave20:04:26

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

dave20:04:32

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

alandipert20:04:38

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

alandipert20:04:24

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

โ˜๏ธ 4
๐Ÿ–จ๏ธ 2
dave20:04:50

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!)

mynomoto11:04:16

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.

alandipert20:04:29

๐Ÿ˜‚ . 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

alandipert20:04:03

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

kennytilton20:04:23

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.

kennytilton20:04:43

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

alandipert20:04:54

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

kennytilton21:04:14

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.

kennytilton21:04:51

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.

dave20:04:21

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 ๐Ÿ˜„

kennytilton21:04:39

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. ๐Ÿ™‚

dave22:04:40

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 :thinking_face:

kennytilton23:04:52

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. :rolling_on_the_floor_laughing: