Fork me on GitHub
#architecture
<
2023-05-04
>
vemv13:05:21

Are there ClojureScript architectures that foster a pristine-pure functional programming model? The way I see it (which admittedly is a subjective definition of FP) is that one would be able to program with referentially-transparent, simple functions and data structures, without any sort of magic/reactive 'context' passed as a parameter (or much less, global state). Such a defn could as well be coded in .cljc with little to no differences between runtime branches. The framework would be plugged in at the edges of the application, instead of being something pervasive (and therefore difficult to swap). With these constraints, one would get specific benefits, e.g. being able to run 95% of your tests in any clojure runtime, very quickly (no IO involved). Or generatively test edge cases like ajax timeouts.

vemv13:05:13

A little extra context, I've wanted/envisioned this for a very long time. I have the impression that people (in misc JS dialects) want this, but in practice frameworks aren't exactly that functional even if going roughly in that direction.

rolt13:05:11

what do you think of membrane ?

vemv13:05:18

I didn't know it! Looks great. What's your take on it?

rolt13:05:50

i want to try it, i completely agree with the philosophy, and it makes sense for java GUI. I'm not sure about targeting the browser

apbleonard19:05:40

I'm not a UI or clojurescript developer, but I am always looking architectures like that you describe. I really enjoyed this talk recently, which seems to be squarely in this area :) https://youtu.be/_g_Kyl4_TSA

pyroxin21:05:12

Have you looked at Coeffects[1]? This is the idea behind how Re-frame[2] handles the environment. 1. https://tomasp.net/coeffects/ 2. https://github.com/day8/re-frame

👀 2