Fork me on GitHub
#hoplon
<
2023-04-27
>
kennytilton01:04:17

"ECL ... wasm port"? Time for me to dust off https://github.com/kennytilton/Cello! That's my OpenGL-grounded UI framework--when you pushed a button, it really did go deeper into the screen. Too much fun.

šŸ‘€ 2
kennytilton01:04:27

Gotta say, programming OpenGL from Common Lisp made programming new again. I imagine audio would be the same. I had this idea for a computer music centered code camp. Sadly, I know nothing about music.

alandipert17:04:37

Common Lisping the past few years had the effect on me the past few years

alandipert17:04:05

when i crack open Cello and see beauties like define-symbol-macro ... šŸ’“

kennytilton17:04:33

Symbol macros! It's a huge language, but after ten years I had used it all. Except iterate. šŸ™‚

alandipert17:04:52

on the last Clojure survey i requested *macroexpand-hook*, i try to request at least one CL feature a year

alandipert17:04:58

https://gitlab.com/embeddable-common-lisp/ecl/-/merge_requests/277/commits btw. and http://turtleware.eu/static/ecl/ecl.html is a (very) rough demo, but on that page is a genuine ECL image running in a wasm blob

alandipert17:04:02

the era of True Cells (tm) in the browser is nigh šŸ“– āš” šŸŒŖļø

kennytilton17:04:47

World domination cannot be far behind. Fascinating to see this project. Thx for the heads up! šŸ™

šŸ‘ 2
kennytilton11:04:09

Btw, re changes dispatched in formulas, that's pretty wild. In my hack I allow changes to be dispatched by watches, which run right when formulas are recalculating, but the changes must be explcitly deferred for execution as soon as the current state change has fully propagated. Just arrange an internal queue and, when one change completes, look to see if other changes got enqueued. The one trick here is having any such change return a bogus :CHANGE-DEFERRED token, instead of the expected value of an assignment, the new value, so anyone availing theselves of this feature get a quick reminder šŸ™‚ if they try to use the return value. Overall, we can bind various dynamic vars regulating what is allowed and when, so at run-time transgressions can be trapped. Might be worth a try for H/J. I do not find such constraints have mush dimished the d/x.

alandipert18:04:41

in javelin we're pretty good about signalling you've modified a dependency; your browser locks up immediately šŸ˜‚

alandipert18:04:00

an improvement here could be, we probably know enough to tell you the loop before locking

kennytilton18:04:20

That will teach them! šŸ™‚ Yeah, I imagine you have the dependency chain at hand. In Cells, I dump the chain, I think including each cell body, which gets captured in symbolic form by the cell-generating macros. Ain't macros grand?!

alandipert18:04:07

unfortunately capturing compile-time stuff and doing cool things with it at runtime in cljs has always been fraught because of the gclosure shenanigans

alandipert18:04:31

and, you know, no EVAL-WHEN šŸ§”

alandipert18:04:42

in Cells do you walk the chain to find the loop a priori? or do you detect the loop on the 2nd iteration

kennytilton18:04:57

Ah, I will keep my eye open for that. Thx for the heads up. EVAL_WHEN! Less, :compile, :load, :eval? And there were two syntaxes: :*-toplevel. re the loop: Cells is all run-time, no code inspection. Each formulaic cell gets pushed onto a dynamic stack var when it starts calculating. When a cell needs recalculation, we check if it is already calculating, ie in the stack. If so, we go boom, displaying the stack members. If I ever get a good use case for supporting cycles, I'll add an :on-cycle handler, but it has never come up. Fun stuff!

alandipert18:04:25

very nice, makes sense, thanks for explanation

alandipert18:04:44

that seems like the optimal solution in javelin too

kennytilton19:04:48

Ain't *specials* grand? (I seem to be repeating myself.)

alandipert19:04:52

we already do https://github.com/hoplon/javelin/blob/master/src/javelin/core.cljs#L213-L227 to suspend propagation within a transaction, as i imagine you do

alandipert19:04:26

which was always something i could never really express the awesomeness of to people who were more excited about having one big everything-atom they could swap! on

kennytilton19:04:16

Suspend propagation? In transactions? That might be one problem with my hack, no transactions. We could roll back the cascading calculations, but side-effects are dispatched as each value changes, and we would not be able to roll those back since they operate outside the Cells system. One big atom? That came up in the call. I was already yapping too much so I did not want to make things worse, but I hope H/J stays granular. Flux et al was a prima facie good idea that just made everything harder, when we already had existence proofs like H/J that a DAG could be maintained "in place", property by property. Twenty-four Redux training videos later... don't get me started! :rolling_on_the_floor_laughing:

simple_smile 2
alandipert19:04:37

don't worry, complete Hoplon training video series forthcoming

šŸæ 4
alandipert18:04:51

Like the last one, feel free to post topics you'd like to lodge for discussion, or anything you'd like to present, and I'll make sure we get you on deck

alandipert18:04:01

One thing I'd be happy to do is walk through what's discussed https://clojurians.slack.com/archives/C08BDAPRA/p1682618921457579, or the grimy details of what happens in a situation where a formula calls itself indirectly. and collect ideas about what we could do better. What Ken proposed sounds easy (and way better than just locking up) Update: made an issue https://github.com/hoplon/javelin/issues/43

alandipert19:04:22

ā¬†ļø thanks for pollinating us @hiskennyness simple_smile

kennytilton13:05:58

My pleasure! Not sure it matters, but in Cells I used a LIFO stack (just a CLJ list onto which I cons the current cell), not a set. Having a list allowed me to show the dependency cycle in order. Hth!

alandipert16:05:32

yep, solid. though i think we'll use a clojure set to get random order for a little extra job security

šŸ§  2