clojure-sg

http://www.meetup.com/Singapore-Clojure-Meetup/
2017-04-19T01:51:22.497837Z

I have uploaded the devcards demo codes to https://github.com/sniperliu/devcards-sg

👍 3
lucasbradstreet 2017-04-19T02:44:25.873748Z

the discoverability is a bit better on clojurians. What we’ve been doing from #onyx is linking to the scraped logs in our title

lucasbradstreet 2017-04-19T02:44:25.873818Z

https://clojurians-log.clojureverse.org/clojure-sg/index.html

spinningarrow 2017-04-19T04:01:36.348727Z

@lucasbradstreet nice, didn't know about the scraped logs! thanks for adding that in 🙂

spinningarrow 2017-04-19T04:01:47.349767Z

Are you still around in Singapore?

lucasbradstreet 2017-04-19T04:02:25.353904Z

Still in Seattle

spinningarrow 2017-04-19T04:02:33.354793Z

ah

spinningarrow 2017-04-19T04:02:40.355482Z

any plans of returning?

lucasbradstreet 2017-04-19T04:07:24.383923Z

Depends on how the startup goes 😎

2017-04-19T08:35:11.629429Z

just switched from rum back to re-frame for our gaming project

spinningarrow 2017-04-19T08:41:44.718656Z

what was the reason for the switch (both to and from)? I've tried a bit of re-frame but not rum

2017-04-19T08:50:19.837377Z

re-frame provide a lot best practice like effects/coeffects for us and save our effort.

2017-04-19T08:50:51.844872Z

since rum is just a component lib

spinningarrow 2017-04-19T08:51:31.854371Z

Is Rum is more comparable to reagent then?

2017-04-19T08:52:56.873848Z

I haven’t tried any of those yet but whenever I look at it it seems like it’s all full of state… contrary to what I like about Clojure what am I missing? 🙂

2017-04-19T08:52:57.873939Z

yes, re-frame is bound with reagent

2017-04-19T08:54:22.893527Z

real world have state every where, just how you manage it. even clojure is not pure.

2017-04-19T08:57:49.942944Z

🙂

2017-04-19T08:58:42.955409Z

I meant in the example projects I could always see state all over the place whereas in the Clojure projects you can encapsulate it in one safe place and (almost) never touch it

2017-04-19T08:59:03.960371Z

(that’s an exaggeration but a useful one)

spinningarrow 2017-04-19T09:00:57.990030Z

Yeah I noticed that in reagent as well

2017-04-19T14:29:58.929870Z

My ideas on reagent/rum/re-frame: reagent and rum are wrapper library for react, so they are more comparable. Re-frame is based on reagent for writing your SAP in the way it recommends, the counterpart of it on rum is scrum.

2017-04-19T14:35:31.064665Z

Rum vs Reagent: Rum is a thinner wrapper than reagent, it can using "mixins" to mix states into components, it does not have opinion on which way you want to manage states, e.g. you can choose a "static" mix-in for small, cross-project component; a "reactive" mix-in for reactive atom (ratom) based ones. It also encourage you to develop your own mix-ins to handle the lifecycle of states or other specific needs.

2017-04-19T14:36:49.094921Z

While Reagent has more opinion on this, it's core value is "ratom", watch based atom for states.

2017-04-19T14:38:50.142631Z

At First, I liked the flexibility that rum provides, and we wrote a few mix-ins to deal our own components (which using pixi.js undercover is a WEBGL render engine).

2017-04-19T14:42:41.233790Z

While this is handy, but mix-ins turned out not a very functional way and "clojure" way, it more like from javascript's prototype based way. Not very easy to write real independent mix-ins.

2017-04-19T14:45:17.296162Z

So we checked back to the initial decision, read the re-frame documents again (which is quite long, much longer than the code), realized that it may look like a framework, but actually a library composed of "best practices".

2017-04-19T14:48:30.375264Z

The core value of re-frame is a single truth source of app: "app-db", or a monolith atom for all the states. However, it does not forbidden pure-local state, you can still use reagent's type-2 components:

2017-04-19T14:50:56.434287Z

The initial evaluation process we did overlooked it. So it still encourages cross-project reuseable small components.

2017-04-19T14:56:07.561193Z

As many developers noticed, a single app database is very valuable for checking, debugging and most importantly for clojure programmers, for REPL based tool to manipulating a running program.

2017-04-19T14:57:45.602175Z

It also encourages single direction information flow, rather than using reagent's cursor (although you still can use it).

2017-04-19T14:58:49.628556Z

So it turned out most of our problems are already thought by Mike Thompson, and he provides elegant solutions for them.

2017-04-19T14:59:34.647583Z

I strongly recommend to read the docs of re-frame, it definitely worth reading.

2017-04-19T15:32:00.451539Z

oh wow, that’s a lot of to digest, thank you @renewdoit! 🙂 🙂 🙂

2017-04-19T15:32:41.468282Z

maybe you’d want to show re-frame in action during the next meetup? 🙂

spinningarrow 2017-04-19T16:17:11.515283Z

Very detailed explanation, thanks @renewdoit!