Thx @emil0r!
Hey, @meta-meta. Yes, Matrix is at once active and done. 🙂 The "active" part is about documentation and tutorials. "Done" is the core reactive engine. It often grows new capabilities when challenged by new applications, but after twenty years (starting in Common Lisp) a lot of challenges have been covered.
There are several non-DOM reactive flows inside my various TodoMVC implementations, especially the one I called rxTrak, which searches a government database for adverse events on the item entered by the user as what used to be a "to do". But all of them use Matrix to persist items to localStorage, and later pipe localStorage back to the DOM.
Also, the Flux Challenge implementation has a GUI component, but the challenge is mostly about handling async data from a socket and from an HTTP source.
I have to drag my car to inspection, but will provide more afterwards.
FYI, I did have one user do a tight integration of Matrix (Cells, at the time) with a physics game engine. He himself did some nice extension of Cells to make the flood of data manageable. We can dig up that code if it proves relevant.
More soon.
Thanks a bunch! I'll take a look and come back at you with some questions. Another project I stumbled upon yesterday is https://github.com/leonoel/missionary Are you familiar with it? In a way I'm new to dataflow programming although I'm well versed in React, PureData, Max/MSP; the underlying academic concepts like "backpressure" and "streams", yada yada I don't quite get yet. So it's a bit of a challenge to trawl through the docs and examples to determine what's applicable to my use case, what might be fun to integrate later, vs features that I'll never use. I think React, at least the reconciler portion, is a special case of dataflow where not only is it a DAG, it's a tree. PureData and Max/MSP are my inspiration for doing this project. I want that live experience of wiring things up but I want to break away from the mouse and keyboard and use my body; take advantage of human spatial thinking and have fun. PureData is dataflow but it allows cycles and I think this, while powerful, spawns a lot of confusing idioms/patterns. Connecting signal chains is something familiar to musicians, guitarists and modular synth folks especially. My use case is to generate musical data in a performance or jam setting. Anyway, that's just some background. Car inspections are something I don't miss about NJ! (grew up in Tinton Falls 👋 )
Tinton Falls?! I am in Manasquan now, born/raised Tenafly. Thank god inspections are not what they used to be. Missionary sounds great from the intro. I will try to dig into the tutorials over the weekend. React to me is not reactive at all; it just creates the appearance of reactivity by re-rendering everything efficiently: the reconciler and that lifecycle thing about not updating a given view. In fact, FB has explicitly come out against reactivity ("we want to control everything") and said they should have called it ScheduleJS. Looking forward to learning more on Missionary. Thanks for the heads up!
btw, speaking of generated music in a performance setting, are you into SonicPi at all? https://sonic-pi.net/
"PureData is dataflow but it allows cycles" After inventing Cells back in the 90s I discovered Garnet KR, a reactive system that looked very much like Cells. But they allowed all sorts of skullduggery, such as assigning values to computed Cells. "...I think this, while powerful, spawns a lot of confusing idioms/patterns. " My concern exactly, so Cells is fairly strict. But over time I have loosened things up, in the Lisp spirit of letting giving users power at the risk of shooting themselves in the foot. Yet again, I have used Cells massively and not really been hindered by the constraints I have on their use, so many are still there. Easy enough to loosen if you have the need. • KR Manual, postscript: http://www.cs.cmu.edu/afs/cs/project/garnet/doc/kr/kr-manual.ps
Yep, I saw Manasquan on your Github profile. We used to play soccer against them in middle school. React is moving increasingly towards Elm's model which does indeed sounds like "we want to control everything". Where it feels more like plumbing than tending a garden or what not. I enjoy that model for its predictability though when it comes to orchestrating disparate API calls and integrating the data from them, that part is ad-hoc and it seems that kind of thing is where something like Cells shines. Re: Sonic Pi, you know that would be the smart thing but I masochistically have been kludging together my own system for live coding and generally thinking about music. I got into Clojure when a coworker showed me Sam Aaron's live coding performance on Overtone. I have some weird personal hang-ups about note spellings and how music is commonly taught and understood so I've been working out a DSL and approach to factoring music data so that it's more malleable. That's all in clojure but I don't feel musically stimulated at the repl so I'm trying to move that toolbox into a spatial environment where one can compose at various levels of abstraction by manipulating and transforming data literals in space as if they were tangible things. My main issue with live coding music is it's typically too cerebral. Another component of this is spawning virtual instruments that one can play expressively and whose tunings and layouts might be part of the composition. some rants: https://github.com/meta-meta/aframe-musicality/blob/master/notes/Why-a-DSL.md https://github.com/meta-meta/aframe-musicality/blob/master/notes/12TET-source-code.md generating polyrhythmic tapestries of notes by cycling through various sets of pitches at different rates https://github.com/meta-meta/musicality-clj/blob/master/src/musicality/compositions/2021_01_03_14.clj#L316 generating longer drum beats from condensed polyrhythm components https://github.com/meta-meta/musicality-clj/blob/master/src/musicality/compositions/2021_08_17.clj#L102
virtual mallet instrument whose tuning and layout can be live-coded https://youtu.be/Mxvi9RpEilc
The two "compositions" linked I'm sure are a lot of nonsense without context but just an idea of the kinds of expressions I'd rather be building in a graphical environment.
Are you playing the virtual mallet using VR stuff that translates your own hand gestures into the VR world? The compositions are fine. I'd have to run them of course to get what is going on musically. And I guess this textual coding is what you are hoping to get away from, while still generating much algorithmically. Off-topic: I am reminded of a project in which they developed a part interactive, part algorithmic installation for the public to play with. MIT Media Lab? Anyway, the problem I saw, and which they reported 🙂 was that the music responded to the user's gestures, but not in any way they could anticipate! So the first thing anyone wanted was to know how to achieve a certain effect. The researchers had left sense of expression out of their equation. I know nothing about music, btw, but I have done a lot in teaching and esp. inner city teaching. I have this idea about creating a code camp for students at risk that was built around textual coding of music, using the music only as a hook to draw a few students into coding in general. It would be a code camp I would enjoy, being a music dummy. But I know there is a lot of math and transformations in music, so I am guessing a lot of traditional programming material could be covered within the context of music. Heading for dinner, but will look at your rants and Missionary later.
Yes, that's me playing. The hand/controller tracking is all standard. When the ends of the mallets collide with the eggs, a MIDI message is constructed according to the impulse force.
Yeah I'll put together a proper demo one day where you can actually hear what the code does. Those are probably broken at the moment anyway because I'm still shuffling things around, figuring out my primitives but generally I've tried to set it up so everything can be expressed in a ->> macro with the forethought that some graphical node based system would be easier to implement that way.
That's funny about the MIT installation! I think it's probably best to consider these computer-aided art projects to be a conversation. And that's even true of a regular old instrument. Attempting to command something is not very expressive because it's rare that we ever know precisely what we want. The code camp idea is great! I love the idea of learning to code as a way to empower people whether or not it's going to be a career, it's so valuable to know how to break down a problem into manageable pieces. Music and video games are pretty great ways to engage kids. Some of my motivation for this project is to package programming in a way that resonates with kids when text does not. I have a 10yo nephew who was raised by YouTube and Minecraft, has a high school vocabulary but struggles with reading. I'm confident that I could hang out with him in a VR environment and have him coding something brilliant in a few days but he wouldn't be willing to work with text long enough to accomplish anything. Music can have a lot of math and transformations, or it can be felt or it can be verbal. Modern western music - 12-tone equal temperament is actually a recent invention that I think is best encoded with integers, algebra, modulo 12 arithmetic, group theory, and that aligns really well with coding. Sort of another approach to music is more in line with physics and the harmonic series and deals in rational numbers. It's oddly simpler conceptually but more challenging to access because of industry of scale: pianos and floating point processors. Clojure is a nice fit here because of the ratio type. If you like to listen to music and sound in general, and since you're a math guy you might find this approach stimulating: http://www.dbdoty.com/Words/Primer1.html Just Intonation is taught as this "advanced" topic in music but it's really more fundamental.
"12 tones"! I recognized something! 🙂 Are you a Vi Hart fan? https://www.youtube.com/watch?v=4niz8TfY794
Just Intonation fascinates me. It is so far over my head, but I get that is fundamentally different. I have to google up some JI music.
yes! I know and love this video
I lost three days catching up on Vi videos when I finally discovered her. "Lost" not the right word!
Including some links to rxTrak 🙂 brb...
rxTrak: https://github.com/kennytilton/matrix/tree/main/cljs/rxtrak I think I broke that ^^^ experimenting with the various build tools; when I shared it six months ago it was fine. The two examples of non-DOM reactive flow are the aforementioned persistence to localStorage, and async Ajax request handling. I have a substantial write-up on that somewhere I will dig up shortly. Flux challenge: https://github.com/kennytilton/matrix/tree/main/cljs/fluxchallenge As for XHR handling, this readme might address non-DOM directly. It describes how I took vanilla XHR and wrapped it in a Matrix-aware object so XHR can play well with other reactive elements (usually the DOM). btw, speaking of non-DOM, one application that "challenged" Cells to a whole new level (specifically, eliminating reactive glitches) was the RoboCup Competition https://2021.robocup.org/. In the virtual competition, client players see only sensory info over a UDP socket. Strategy and tactics were all computed reactively off that raw data. Ping me any time for help with any of this.
btw, @meta-meta, it sounds like your first task will be similar to the XHR wrapping/glue with Matrix. I can work with you on that and at the same time add to the doc how that is done.