Fork me on GitHub
#membrane
<
2022-09-27
>
chromalchemy00:09:41

maybe more high level, but.. • Best practices w regard to styling. • LiveReload Live Programming lifecycle: Lifecycle of a “window”, how to [start, close, restart, refresh] • Direct manipulation patterns ? maybe some of this in the blog already, still working through.

👍 1
phronmophobic00:09:49

> • LiveReload Live Programming lifecycle: Lifecycle of a “window”, how to [start, close, restart, refresh] This is a really good topic to add! > • Best practices w regard to styling. I'm not sure I've totally figured out this piece yet, but something is probably better than nothing > • Direct manipulation patterns I'm not totally sure what you mean by this

chromalchemy00:09:52

I refer to direct manipulation as when you surface part of app state with reactive UI controls (Ie control panel UI, or interact with component directly). Is this just a subset of reactive programming? But direct in the sense that through a ui event (especially a touch event) the user “directly “controls app state, with realtime feedback. I think this is probably old and somewhat obvious idea, embodied in most games and apps. But perhaps Membrane makes this affordance more accessible on a bespoke fine-grained level? Like how are Membrane apps more “moldable” than an average UI framework? Components auto-instrumented with “editor” UI? I think your dataflow repl editor example was great showcase, combined with incremental views of functions/editors!

👍 1
phronmophobic02:09:09

Honestly, I think just trying to write idiomatic clojure goes a long ways. Building on top of plain ol clojure data makes a huge difference. Most UI libraries don't even have the opportunity since they're almost exclusively built on top of some OO model (web DOM, UIKit, GTK, Swing, etc.) I think you a great point though. I should definitely include something about why avoiding the typical OO foundations makes a big difference.

chromalchemy14:09:35

👍 Yes, your perspective on this is valuable. Some of these things are so intuitive conceptually, yet such a reach when it comes to wrangling competing fameworks/runtimes, that the imagination is prematurely forclosed. Like the idea you highlighted before about being able to just get and use current component state values. Kind of outside the view of certain declarative straight-jackets (css).

chromalchemy00:09:29

Pattern for doing Devcards style n-up variations on data?

phronmophobic01:09:25

> Pattern for doing Figwheel style n-up variations on data? I'm not that familiar with figwheel and googling didn't help. Is there a link or resource that explains this feature?

chromalchemy14:09:14

I’ve not really used it. Looks like a batteries included Clojurescript Repl setup. But my understanding was that one feature it allowed was developing components with visual isolation, and simultaneously developing n permutations of a component side by side. ie designing for different screen proportions simultaneously.

rolt16:09:33

i don't think figwheel provides any help for that. Are you talking about devcards ? they work outside of figwheel but it was created by the same author. https://github.com/bhauman/devcards/

phronmophobic16:10:33

dev cards is cool. Looks like there's a lot of overlap with something like clerk. I wonder how much work it would be to build an alternate viewer for clerk.

chromalchemy18:10:08

Yes, that’s what I meant, devcards! Interesting that Clerk also provides simultaneous visualizations of multiple related functions.

phronmophobic01:10:41

For basic usage, making an alternate viewer for clerk wasn't too bad, https://github.com/phronmophobic/desk

Ben Sless04:10:40

Dude! That's awesome!

clojure-spin 2
Ben Sless04:10:19

You could connect it with the dag editor to create a dataflow editor!

😎 1
phronmophobic04:10:57

I think you would have to build the DAG engine in addition to the UI

Ben Sless04:10:42

There are several implementations of dataflow engines in Clojure already Plug and play

phronmophobic04:10:54

I listed what I thought the requirements would be in https://clojurians.slack.com/archives/CQT1NFF4L/p1657482280025899. It didn't seem like any of the current options fit, but it would be great if I just overlooked something.

Ben Sless04:10:48

What about propagators?

phronmophobic04:10:25

Is that a library?

phronmophobic05:10:09

It doesn't seem like it has side effects in mind

Ben Sless05:10:13

In what sense?

phronmophobic05:10:21

If it's using STM to run the steps within a transaction, then you shouldn't have side effects in the step.

phronmophobic05:10:56

It seems like there's a second implementation

Ben Sless05:10:03

Iirc there's also an immutable implementation without stm, eg system>system

Ben Sless05:10:08

Ninjad

🌠 1
phronmophobic05:10:17

maybe, the last time I thought about propagators was about when this library was last updated

Ben Sless05:10:27

Propagators seem like a natural fit for dataflow

phronmophobic05:10:01

I seem to remember something about propagators running until the system becomes "stable"

Ben Sless05:10:21

Not for the immutable implementation 🙂

Ben Sless05:10:52

Also, what about pathom?

Ben Sless05:10:17

The immutable implementation has a step semantic you can run until fixed point. Like macro expansion

phronmophobic05:10:21

pathom might help

phronmophobic05:10:27

or any graph library really

phronmophobic05:10:23

does pathom help you run your resolvers?

phronmophobic05:10:42

and can you inpsect the results as it's resolving?

Ben Sless05:10:58

I'm not a pathom expert 😅

phronmophobic05:10:06

me neither 🤷

phronmophobic05:10:25

propagators are nice because you can have cycles

Ben Sless05:10:30

But I THINK there's an implicit context which passes along with everything

Ben Sless05:10:37

Yeah I dont know if pathom has cycles

phronmophobic05:10:56

supporting cycles might be a requirement

Ben Sless05:10:15

The people demand propagators 🙂

clojure-spin 1
Ben Sless05:10:44

Btw, dataflow + code editor = write code and visually see what values are doing throughout your code AS YOU ARE WRITING

Ben Sless05:10:22

We have a hackathon at work soon :thinking_face:

🎉 1
phronmophobic05:10:42

my evil plan is spreadsheet for pure functions, data flow for impure functions, https://twitter.com/phronmophobic/status/1471612491645874176?s=20&amp;t=CQ6vQtKoOS0eF4xWTDg1DA

phronmophobic05:10:46

I'm pretty happy with the spreadsheet (and use it regularly), but the data flow editor is still vaporware

Ben Sless05:10:13

Why spreadsheet and not something slightly more visual? (Like dag?)

Ben Sless05:10:36

I already nerd sniped you to write a graph editor 😄

phronmophobic05:10:56

that's a good question. I'm not sure they're mutually exclusive, but I think spreadsheets are very effective for pure functions and immutable values. generally speaking, the annoying thing about DAGs is density and tedium, especially if adding 2 numbers requires 3 nodes.

phronmophobic05:10:18

I think DAGs are much better at the flow aspect, where it's important to see where the data is coming and going. spreadsheet are nice for pure functions because each cell is kind of an island

Ben Sless05:10:08

Isn't this just a specific visual representation of a graph?

Ben Sless05:10:21

Why not toggle between the two views?

phronmophobic05:10:13

yea, that could work

phronmophobic05:10:20

right now, I only have the one view

Ben Sless05:10:38

But you could have another 🙃

phronmophobic05:10:52

yea, that's goal

Ben Sless05:10:55

"I'm a stick" "But you could be fire"

Ben Sless05:10:05

The spreadsheet is closed source at the moment, right?

Ben Sless05:10:49

And wrt dataflow and representation, the spreadsheet currently won't be able to handle feedback loops, although pure

👍 1
phronmophobic05:10:52

it's closed source, but not for any particular reason

phronmophobic05:10:17

if you were interested in trying it, I could try to make it usable

Ben Sless05:10:31

Usable? Where's the fun in that? I would connect it to desk and use the mechanism to represent data flowing through code as you edit it

phronmophobic05:10:40

I guess usable is the wrong word. I thought it depended on a bunch of local extensions to membrane, but I think all of those have since been released

phronmophobic05:10:35

I used the word "usable" when I really meant runnable on a second computer

phronmophobic05:10:37

oh, it depends on another unreleased project for the mini UI editor

Ben Sless05:10:17

This is an unrelated thought about code organization, but I wonder if such projects should be organized in monorepo where all the ancillary modules are under a modules directory

phronmophobic05:10:03

I have a janky setup where I use :local/root and then change it when I commit and push to github. I think polylith solves this problem, but I haven't tried it

phronmophobic05:10:13

since the spreadsheet already breaks apart your code and it doesn't live in a traditional file format, I've also been investigating how to store code directly in the db rather than on the file system, but there are still problems to be solved there

Ben Sless05:10:05

I've been playing with that but the tools analyzer output isn't ideal

Ben Sless05:10:52

It would be better if the keywords were qualified. And I'm not sure how to replace the entities with ids correctly

Ben Sless06:10:13

Codeq only does git, not the code itself

Ben Sless06:10:43

I might try throwing it into asami

phronmophobic06:10:45

of all the db options, I really liked asami

phronmophobic06:10:09

I don't think it supports range queries though, which can be important for some use cases

Ben Sless06:10:06

I don't have an opinion on the matter yet

phronmophobic06:10:00

I'm still pretty new to using them, but xtdb also seems good

chromalchemy13:10:03

I would love to try the spreadsheet editor/repl out.

Ben Sless18:10:34

Managed to ingest the AST to datascript @U7RJTCH6J

phronmophobic18:10:50

Once you have the AST, you can turn it back into code you can eval, right?

chromalchemy19:10:04

I’ve not had a chance yet to get into Datalog db’s, but have always been attracted by the idea of high-level graph query. Interesting how it might be utilized in the localized UI context.

chromalchemy00:09:11

Using results from (headless?) webview if one had to render some html?

phronmophobic01:09:28

there are some examples in the https://github.com/phronmophobic/clj-cef project, but it doesn't seem like people are that interested (although I think they should be)

chromalchemy21:09:17

That does look interesting

phronmophobic01:10:41

For basic usage, making an alternate viewer for clerk wasn't too bad, https://github.com/phronmophobic/desk