Fork me on GitHub
#hoplon
<
2017-12-29
>
thedavidmeister01:12:05

@jamesvickers19515 see how you go, for all kinds of charts i think i want something off the shelf, because it is complex, but i end up coming back to low level tools because the charting libs tend to be very config driven, which is great if you don't have specific needs but bad if they don't provide a config option for what you actually want

thedavidmeister01:12:33

that's nothing to do with hoplon, just my experience with charting libs

thedavidmeister01:12:30

the nice thing is that hoplon actually gives you a way out if you feel you want it - writing responsive and dynamic charts by hand in raw JS sounds painful

thedavidmeister01:12:23

you just build up the chart bit by bit - d3 has utility functions to help with things like drawing an axis with tick marks on it and http://thi.ng probably does too

thedavidmeister05:12:48

@flyboarder you are totally rampaging on 7.2!

thedavidmeister05:12:52

it's awesome but how do we track everything you've done for reviewing?

flyboarder06:12:34

I have been precise on the git commits

thedavidmeister06:12:07

oh ok, so the plan is to walk through commits individually

flyboarder06:12:23

im going to merge the commits as the future changelog file

flyboarder06:12:41

Then I will organize the changes within that file

flyboarder06:12:32

@thedavidmeister ie. a list of what was removed, what was reorganized, what was added etc.

thedavidmeister06:12:05

well once you're further along i'd actually like to give everything you changed a sweep with a test suite

flyboarder06:12:31

yeah that would help, i need tests before I work on a few of the other things

thedavidmeister06:12:35

which will be easier with a list of key changes than picking through commits i think

flyboarder06:12:01

currently tests still pass 100%

thedavidmeister06:12:32

well that's good 🙂

thedavidmeister06:12:00

but i suspect you're also hitting a lot of the code that has little or no coverage

flyboarder06:12:43

@thedavidmeister actually most of that is not used anywhere, there was so much dead code!

thedavidmeister07:12:04

@flyboarder well maybe i'll do a dead code review after you're done just to double check

thedavidmeister07:12:30

i wonder if there is a scanner/linter or something that can flag when something is dead

kennytilton08:12:13

I think you hit all the right points. Benchmarks are a dicey game — the moment we put aside the real code to test performance we are perforce (pun unintended) testing the performance of something else. More specifically, your point about Javelin serving a greater good (app state coordination) omitted by the benchmark is another fatal objection to that example.

kennytilton08:12:17

A good response in the future would be to ask if a performance problem had been observed in the field, and if so if that code could be shared. Performance problems arise most often from problems in the larger algorithm, not low-level constructs.

kennytilton08:12:16

Or maybe the user has a good use case worthy of getting the hood up on Javelin. I had one user using my hack to drive a C++ game engine in real time. Having the whole model/cell architecture would never have scaled. My recollection is fuzzy, but he himself hacked in a way to have a dependency on a key’s value in a hash-table. Worked great.

kennytilton08:12:23

Over in MobX land they have something I guess akin to your lenses. I just have never run into the need, so Matrix (ne Cells) lacks that. But it would be a straightforward hack. I do have something I call Synapses, basically anonymous cells spawned within a formula that can perform any arbitrary transformation on values coming from referenced cells, such as throttling, converting to a delta — whatever. Those are fun, and useful lately in resolving XHR callback hell.

thedavidmeister08:12:23

@hiskennyness thanks for the review 🙂

thedavidmeister08:12:15

i have tried your approach of asking for use cases with specific performance issues and been hit with the retort "it's because javelin isn't being used that you can't see the performance issues"

thedavidmeister08:12:20

don't know what to say to that... seems like bad logic to me

thedavidmeister08:12:10

can you share an example of a synapse?

thedavidmeister08:12:38

i've put up that lens in context of performance, but actually it's quite a general pattern that i'm using more and more, "higher order cells" or something

thedavidmeister08:12:51

so i'll write a low level API/wrapper like normal for some system, then i'll write a function that produces a lens on top of the API, so setting the value of the lens automatically does the right things to the API (validation, method calls, throttling, etc.) - similar to how storage cells interact with storage APIs, but it could be XHR or anything else

kennytilton08:12:09

Wait, what? “it’s because javelin isn’t being used that you can’t see the performance issues” Someone not using Javelin said they were experiencing a performance problem with Javelin? I will guess we have segued from the benchmark report to folks just trolling Javelin without using it. Life is too short.

thedavidmeister09:12:19

yes, it's a myth perpetuated by people who haven't seriously (or even casually) used javelin, often in defence of their choice of some other (probably more complicated) framework

thedavidmeister09:12:01

almost knee jerk... when newbies jump into the main clojurescript slack channel asking what framework they should use, it's usually something react based - i suggest hoplon and it's often "performance! monolithic! not for "real" projects!"

kennytilton09:12:12

“it’s quite a general pattern” Yes, we Celluloids have broken through to a substantial cave system, have we not?

thedavidmeister09:12:57

indeed... that's what it feels like

thedavidmeister09:12:33

i have a nice example where i have a cell that is (roughly) a datascript entity and an "item attribute cell" function, where you pass it an entity and an attribute - it has the value of that attribute from datascript at all times, and when you set the cell it updates datascript after validation against spec, and then that datascript cell ships the updated value off over the wire

kennytilton09:12:36

“people who haven’t seriously (or even casually) used javelin” Please picture me standing behind you on TV holding up “Matthew 22:14".

thedavidmeister09:12:53

i can then pass the item attribute cell to hoplon components - dropdown selects, text fields, checkboxes, whatever... they all just need to know to update a cell on user input

thedavidmeister09:12:57

it's quite cool 🙂

kennytilton09:12:14

OK, enough politics. Where are we holding the annual dataflow conference? No annual conference, no traction. I say Vegas.

thedavidmeister09:12:41

haha, i think there was a "hopcon" on google hangouts once and i missed it >.<

kennytilton09:12:58

Ivan Sutherland is still around, he can keynote the first.

kennytilton09:12:13

When you ask for a synapse example, do you mean the code or the functionality?

thedavidmeister09:12:24

i mean both would be nice

kennytilton09:12:23

I am shuffling repos so several (most) links are broken, but I wrote this up recently: https://github.com/kennytilton/tag/blob/master/cljs/Synapses.md

kennytilton09:12:49

Basically at any depth within a cell C formula I can reference a seeming cell creation C’ and Just Use(tm) the value returned its formula. Some slick macrology memoizes C’ so it does not get created each time C runs and then can maintain private state it can use to throttle or transform its input. eg, C’ can read a value V’ changing a zillion times a second but return (> V’ 42), thus trigger C only when V’ crosses that threshold.

thedavidmeister09:12:40

"This write-up assumes the reader has read the Matrix overview; " - broken link 😛

kennytilton09:12:48

Actually, that ^^^ example does not require state.

kennytilton09:12:50

Well, a fellow Celluloid does not need that link.🙂 But lemme go sort those links out anyway…

thedavidmeister09:12:58

right, so it's something like my throttled cell example but has an explicit internal state rather than relying on managing an external local scope?

thedavidmeister09:12:32

you can do it with one cell instead of 2+ cells

kennytilton09:12:34

In the broken write-up there is an example in which the synapse makes an atom where it can stash each value of V’. The rule in pseudocode then is (if prior-value (- this-value prior-value) 0). ie, it is a synapse returning the delta of V’.

kennytilton09:12:11

Sure, examples are like benchmarks: it is hard not to lose essential elements during distillation.

thedavidmeister09:12:12

yeah i agree, there's a limit after which point you need to experience fixing a real "hard problem" in a nice way to truly get it

kennytilton09:12:16

And to a degree we are talking about syntactic sugar, if you will.

kennytilton09:12:27

I almost never use synapses. They were dead handy in addressing XHRT callback hell, however (the second approach, “Shake ’n Bake”): https://github.com/kennytilton/xhr/blob/master/cljs/XHR.md

thedavidmeister09:12:33

"The telltale signature of CBH is (a) the deep indentation of (b) asynchronous handler within handler." - this is something i'm skeptical of

thedavidmeister09:12:53

like when using a promise to "fix CBH" by removing nesting

kennytilton09:12:12

Yeah, at the end I say sth like “the indentation is still there, but that is implicit in the problem so it should be there”. ie, Agreed, the flattening is an unwise security blanket.

thedavidmeister09:12:07

it's focussing on a symptom rather than the problem imo

thedavidmeister09:12:34

you can nest and reference and whatever else as much as you want with cells and it's not really confusing at all

thedavidmeister09:12:43

referencing values, or calculations that derive values just seems easier to understand and manage than referencing async callbacks - no idea why, maybe one day i'll figure it out 😛

kennytilton09:12:55

Yep. The real problem is asynchronicity. Synapses let me hide that. Well, I have not applied XHR in anger yet, so not sure yet.

thedavidmeister09:12:23

we're doing pretty similar things i think

thedavidmeister09:12:50

i don't have a writeup

kennytilton09:12:35

Preaching to the choir provides a bit of relief from forever jawing with the trolls…

thedavidmeister09:12:59

well i think we're going off and facing similar problems and discovering how cells fit into that

kennytilton09:12:21

The one thing I see in binding.scala, MobX, and your response (and past writings of mine) is a certain defensiveness and/or comparison-with-X. I am striving to avoid that now and trying to accentuate the positive. MobX is blazing a path for us by showing a better way to drive ReactJS, so that will make it easier to hawk our wares.

thedavidmeister09:12:04

the performance stuff yes, for sure

kennytilton09:12:53

I’ll have to get to those links the next time I am up. Crashing now.

thedavidmeister09:12:17

i feel there is a myth to dispel there, and a need to defend against something incorrect being said

thedavidmeister09:12:22

but i also started this:

thedavidmeister09:12:11

i think we could present things in a way that is much more obviously good than we currently do, to avoid getting into the situation of needing to be defensive in the first place

kennytilton13:12:50

I heard somewhere that the way to go is to target the select few early adopters who are more inclined to experiment and soldier thru a learning curve, then let them spread the word. So everything we do needs target only the top enginers. Sounds right (and easier) to me.

kennytilton13:12:11

One problem for us is TodoMVC. Yes, we need to toe that line, but it does not exercise interesting state management at all — every dependency goes back to the Todos!

kennytilton13:12:42

My plan is to cobble together a more interesting demo app and evolve it gradually in a series of small write-ups. By the end the implicit state dependency graph should be substantial, and cover XHR requests and PostGres persistence and a 3rd party charting library, leaving the reader in a good place to build their own app.

kennytilton13:12:17

I do not think we can convey the greatness of programming with cells by explaining it. Instead, we must somehow arrange for the audience to experience coding with cells.

kennytilton13:12:17

I will comment more over in the issue, but I would like to suggest a stronger rallying cry than “It’s just HTML!“. That is an important feature, but a defensive one. I suggest something that gets to the experience we have as we build more and more elaborate applications without linearly simple code: “It Just Works!”

kennytilton13:12:02

Indeed, I believe I have seen IJW in the context of ReactJS. We just take it further, beyond the view.

kennytilton14:12:21

Now I just have to fix the links in the links. 🙂 Btw, re me not using synapses much, I brought them up just to point out that should there be a performance problem requiring throttling we are ready. (We also have like four varieties of lazy cells. Those I do find use for.)

thedavidmeister14:12:42

@hiskennyness well the cells stuff is all technically javelin, hoplon itself is "just HTML" + some minor convenience functions like with-timeout

thedavidmeister15:12:29

not that i don't love cells, but i think what hoplon brings to the table is equally important in terms of web app development as it trivially facilitates composability, testability, interoperability, and extensibility for the DOM

kennytilton15:12:34

Oh, OK, I do have trouble keeping Hoplon and Javelin apart.

thedavidmeister15:12:37

maybe "just HTML" is a shitty tagline 😛

kennytilton15:12:27

I am working on a relevant comment on the issue. 🙂

kennytilton15:12:43

tl;dr: we creators are too close to our creations to explain them to others even though we are the ones who see most precisely why they rock.

thedavidmeister15:12:33

haha, well i didn't create hoplon, i had to learn it from scratch at the same time as learning cljs - which is where the biggest potential audience is

thedavidmeister15:12:49

so i can share my personal experience with that learning curve before i forget it

thedavidmeister15:12:29

well i tried to introduce hoplon in the last team i worked in, and currently i bring it up periodically at an agency i do some contracting for

thedavidmeister15:12:06

people can understand it, they just don't want to for some reason

kennytilton15:12:29

It may be a good news-bad news joke: Good: cells really are a dramatically superior paradigm shift. Bad: folks do not like their paradigms shifted. This gets back to worse-is-better: incremental steps such as ReactJS can succeed, but complete solutions will be rejected like a mismatched transplant.

thedavidmeister15:12:52

sure, but i still think we can do better 🙂

thedavidmeister15:12:20

7.1 and 7.2 are really good cleanups for hoplon, with improved tests and simpler/more extensible internals

thedavidmeister15:12:30

and there's plenty of low hanging fruit for the homepage

kennytilton15:12:09

Hey, I am once-more-into-the-breaching on the 17th…never say die!! But it is a wonderful challenge: how to give away tickets to heaven.

thedavidmeister15:12:51

haha, i just keep using it and reporting problems

thedavidmeister15:12:27

they seem to only get fixed by making things simpler and better tested, funny that 😉

thedavidmeister15:12:21

aight, i put another comment on the issue

kennytilton23:12:29

Yes, building stuff with it is the best revenge! 🙂

thedavidmeister11:12:59

woah, i did not mean to do that ^^

thedavidmeister11:12:22

@alandipert could we protect the master branch in github? i accidentally pushed to the wrong repo 😳

thedavidmeister11:12:02

i can turn it on, just checking that you're ok with it

kennytilton12:12:08

Thx, @alandipert! I saw another of us celluloids talking about “point” dependencies or sth. and really liked that, use it a lot.

flyboarder20:12:54

@thedavidmeister I would suggest we protect master for sure!

alandipert21:12:52

thedavidmeister really enjoy the performance page 👍

alandipert21:12:01

thedavidmeister also sure re: protecting

flyboarder23:12:55

@thedavidmeister performance looks good!