by mikewarot · 5y ago · 0 comments
Metamine was amazing... he had figured out how to safely mix procedural and reactive code in one place without going insane in the process:
https://web.archive.org/web/20201101065701/https://github.co...
I watched a set of videos on YouTube that were amazing, but now I can't find any links to them. 8( I would really like to know where it went.
[Edit: I found a fork of the repository at https://github.com/caminadab/metamine
Of course I forked that fork to have a copy for safety]
x = y is an equation, any time the expression y changes, x will be recomputed
a := b is an assignment, it only happens once, like we're all used to.
It is profoundly powerful to be able to use them both in one program. There appears to be a type associated with them, you can't assign to an equation variable, and vice versa.This seems to just provide a wrapper that obfuscates things
This is more like a multithreaded application, where one set of calculations is kept updated by a background thread, without most of the attendant synchronization issues. There was some very clever InterBase like generational tagging of data to prevent deadlocks.
I'll be honest, I haven't used reframe myself, I just came across the concept while using cljfx https://github.com/cljfx/cljfx/#subscriptions-and-contexts so I'm not quite sure if it's all updated async or on each render - but the framework is very powerful and simplifies application logic by an order of magnitude.
But in both reframe and cljfx it's tied to the gui rendering which is a shame - b/c as you comment suggests - this is a more general purpose pattern. In-library it remains a bit too verbose with lots of boiler plate and api to remember and it's all a bit too difficult to reason about at times. It seems like it should be something that's part of the language "runtime". However in the end it still works through memoized functions, which is a bit more explicit that a second magical assignment operator :)
Anyway, a bit of a ramble.. thanks for the info :)
Here's a tutorial video I found demonstrating programming the game Snake http://web.archive.org/web/20201014024057if_/https://www.you...
Found from a Reddit discussion http://web.archive.org/web/20201130115327/https://www.reddit...
I'll give you spreadsheets, but while it's not the "focus" you will very often see softcores and lots of state machines being used in FPGAs. Some things are just easier to reason about and write that way.