This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-25
Channels
- # aws (2)
- # bangalore-clj (2)
- # beginners (90)
- # boot (89)
- # bristol-clojurians (1)
- # cider (23)
- # cljs-dev (48)
- # cljsjs (2)
- # cljsrn (3)
- # clojure (118)
- # clojure-argentina (3)
- # clojure-austin (8)
- # clojure-czech (1)
- # clojure-dev (18)
- # clojure-ireland (1)
- # clojure-italy (4)
- # clojure-russia (6)
- # clojure-spec (75)
- # clojure-uk (224)
- # clojurescript (103)
- # core-async (28)
- # cursive (3)
- # datascript (7)
- # datomic (15)
- # dirac (30)
- # emacs (14)
- # events (3)
- # figwheel (1)
- # hispano (1)
- # hoplon (176)
- # lambdaisland (1)
- # lein-figwheel (6)
- # off-topic (21)
- # om (7)
- # onyx (2)
- # pedestal (6)
- # re-frame (4)
- # reagent (15)
- # spacemacs (67)
- # specter (13)
- # testing (9)
- # untangled (65)
- # vim (6)
- # yada (1)
@qqq @micha i think d3 has key functions too, for diffing data structures that need to be rendered to the dom (not just strings), so the approach a lot older/more common than just a react internal
Hi guys, i have some vague questions about about how to approach working with structured data for a to-do list app.
I am used to working in outliners, so I'm looking at zippers, and trying to understand TheLarch Hoplon example.
btw https://github.com/tailrecursion/orcus/ is a slightly simplifed thelarch
ps. I noticed a commented out reference to thelarch in Panoply. https://github.com/hoplon/panoply Since Panoply is a todo list, is there any relation?
we're not sure what panoply will be yet, last idea is a chat app lol
i just lifted the oauth code
I still have to digest Hoplon TodoFRP too https://github.com/hoplon/demos/tree/master/todoFRP, But I think that doesn't have any nesting.
Oh ok
I have heard Micha talk down on clojure.zip in favor of Jquery as a zipper library. But in what context? I think I will be working with clojure data (immutable?)
And I've heard others distance themselves from zippers in favor of Specter (which in addition to the lens approach, has it's own zipper library)
Does Specter play nice with Javelin? Are there advantages to using it over Javelin lenses? I don't want to get to far away from Hoplony goodness 🙂
I'm doing primarily cljs with Firebase ala @flyboarder Brew library. https://github.com/hoplon/brew/blob/master/src/hoplon/firebase.cljs.hl Since I still have not figured out how to deploy a proper clojure app (Heroku noob)
I am still a clojure noob in general, and am eager to get something working. Should I be wary of zippers, in favor of lenses, for easier grokking?
@alandipert Thanks for the Orcus link, I didn't have that one
... Or should I stick to the theLarch pattern as pretty idiomatic Hoplon/Javelin?
In my outliner apps, I like to use aliases and saved queries on metadata. So then the tree really becomes a graph. So should I be looking past zippers for more graph-oriented patterns? Perhaps Datomic/Datascript?
Again, I want to edit this thing with Hoplon UI, so I dont want to steer to far from Javelin
ps. maybe with all of this I need to be less focused on fancy libraries and getting more familiar with Clojure data (Zippers, Seqs, patterns, etc)
Any guidance would be appreciated.
@micha I know your have some experience with zippers so I would love your opinion. Thanks!
but if you want to do stuff to elements in the dom, i find the immutable zipper abstraction to be inferior to like jquery for example
I am thinking more like I have data that I CRUD w Firebase, then render to and edit in a page.
Am I correct that my case is a different one than accessing the Dom-as-data (with zippers, etc), and that the functional zippers might be very appropriate (vs Jquery)?
@micha Ok. What do you think of clojure.zip vs Specter vs Javelin Lenses? (especially on the cljs side for Specter vs Javelin)?
and all that vs Datomic/Datascript?
I guess if I had datomic I wouldn't need Firebase. I am not at the level to re-implement my own database. But I like how Firebase seems simple and accessible, (and client-only deploy) and might be very good as an accessory db.
I tried something and got errors, I'll have to try again.
Is using Specter redundant considering I already have Javelin lenses at the ready? What is the conceptual overlap?
i haven't used specter, but isn't it a library for destructuring clojure data, basically?
"abstraction called navigators which complete the story around immutable programming and make it easy to transform and query nested data structures. It allows you to concisely specify what you want to change within a data structure, and get a new data structure back with only your changes applied – everything else is reconstructed and the types of data structures throughout don't unexpectedly change."
" Specter is (at least in main use cases) Haskell's lens package"
like here for instance http://nathanmarz.com/blog/functional-navigational-programming-in-clojurescript-with-sp.html
"Definitely more lens than zipper. If you think of a lens, in simple form, as a path into a structure then a zipper is a structure plus a path into itself. This constrains the form that a zipper can take. If you examine these paths on their own then you get into general "optics" which is where the lens type lives and where specter lives (it seems). In particular, we start talking about generalized folds and traversals."
Ok , thanks for the insight. I'm just trying to orient. I haven't used it barely at all yet.
I thought that if Specter is promising an easier approach than zippers. But if it is essentially lenses, and Javelin has lenses, maybe Specter is redunant for my purposes.
I remember @laforge49 had a project with both Specter and Javelin lenses in it. Javelin on the client, Specter on the server.
Ok, I'll play with them both together. Thanks for the clarification.
@laforge49 What is your impression of Javelin lenses (strengths, limitations?) after doing your own lens implementation https://github.com/hoplon/demos/tree/master/lens, and also using Specter
Javelin lenses are best on the browser, where the scope is narrow enough (single user) and the resources per user is maximal (100%). And Javelin has a number of optimizations that can at times be helpful. On the server side, specter looks really great and I used it, once. I just don't seem to encounter enough use cases, for which I am currently blaming myself. I've ended up adding notifications capability to my Datomicish database, but even there the usage to date is minimal.
@chromalchemy maybe interesting to you, https://github.com/alandipert/intension
competes with specter in the 'get' arena. no facilities for update
also, wildly inefficient. but that could easily change... https://github.com/halgari/odin is another recent thing that uses a different logic language
@alandipert Very interesting! I definitely want to play with Datalog
@alandipert Can Intension be used in cljs?
hypothetically
ok, yes it can
not much to it
Cool! Will try it out.
this is tl;dr of how it works https://pbs.twimg.com/media/CXkTdHaWwAAmrhM.png
@chromalchemy http://github.com/mynomoto/github-client is a project using hoplon and datascript if you want to take a look.
@alandipert : although I like hoplon's frp model more than I like reagent's reactive model, re-frame's re-com and re-frisk (amazing!) has won me over; I hope hoplon / javlin / casatra have more public libraries soon!
@qqq did you check out https://github.com/hoplon/ui?
haha, 'one last thing'
is there a live demo of all gui widgets? I can't find it on https://github.com/hoplon/ui/wiki
no, it's sort of a well-kept secret, very close to 1.0 release tho afaik
http://re-demo.s3-website-ap-southeast-2.amazonaws.com/ <-- see, this is re-com's marketing
nothing we have has the momentum of reagent/react/re-frame
it's good for marketing
at this point the cljs web devs i know won't even look at something that doesn't involve react
which has kind of stunted our growth a bit... but we are still slowly growing
yeah i dunno
it's not really related to or inspired by react in any way, other than that it solves a similar set of problems
so it would be disingenous to say we're going beyond react when we haven't even used react yet 🙂
or, I guess, adds a number of pre-defined patterns of how to structure the application which matters once you grow to a certain size
a lot of people like that
people with more rails type mindsets, and junior people. clear directions
I'd say that reagent offers nothing over hoplon, but re-frame's single db source of truth + subscribers + event handling system is neat
javelin / reagent basically provide the same primitives, with javelin/cell == reagent/ratom
that's the part i personally would avoid.. having built a medium-sized eventbus-based thick client 5 yrs ago
its part of the reason we decided it was important that cells can be anonymous
javelin gets dependency graph via macro analying the code; and re-frame gets it via running the reaction, and looking at what's dereferenced -- right?
how do you figure out what cell depends on which cell -- do you do it at compile time or at runtime?
(cell= (+ (* a b) (/ c d))) expands to ((formula +) (* a b) (/ c d)) ... but now, isn't this fucked, because we need to know it depends on a b, c, d, -- rather than use their values ?
(cell= (+ (* a b) (/ c d)))
;; same as
((formula (fn [v w x y] (+ (* v w) (/ x y))) a b c d)
(cell= (f (g a b) (h c d)))
;; same as
((formula (fn [x1 x2 x3 x4 x5 x6 x7] (x1 (x2 x3 x4) (x5 x6 x7)))) f g a b h c d)
can se say: cell= finds all the "leaves" of the following sexp cell= then cfeates a new function, where there ar e"holes" for each leaf, and it applies formula new-func leaves
okay, so very broad strokes of cell=
`
(cell= sexp)
leafs <- leafs of sexp
possible-cells <- filter [some matic function] leafs
new-func <- sexp as a function with holes for "possible-cells
returns [ formula new-func possible-cells ]
I don't understand why they don't just run topolotical sort after they extract dependency graph
when you want to make complex things from small pieces the dependency graph becomes important