4 ms·
Spreadsheets and FPGAs are two places where there's no focus on a "program counter". Metamine was amazing... he had figured out how to safely mix procedural an
by mikewarot 5y ago
Spreadsheets and FPGAs are two places where there's no focus on a "program counter".
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.com/ymte/metamine 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 https://github.com/caminadab/metamine
Of course I forked that fork to have a copy for safety]
- breck 5y agoMetamine looks amazing. I don’t know if I’ve seen it before. Thanks for sharing. Now I’m really curious.
- hcs 5y agoMetamine looks interesting, thanks! Here's a tutorial video I found demonstrating programming the game Snake http://web.archive.org/web/20201014024057if_/https://www.youtube.com/watch?v=RvRc3c9TQ6c&gl=US&hl=en http://web.archive.org/web/20201014024057if_/https://www.you... Found from a Reddit discussion http://web.archive.org/web/20201130115327/https://www.reddit.com/r/programming/comments/j94lgd/metamine_a_completely_declarative_programming/ http://web.archive.org/web/20201130115327/https://www.reddit...
- mikewarot 5y agoIn Metamine there are two different modes of assignment 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.
- taeric 5y agoPretty sure this is used in the likes of metafont, as well. Is a great tool where it is applicable. Oddly not that applicable in most programs. Especially if the "plumbing" variety.
- morelisp 5y agoThis technique (with the same assignment syntax) is used in Make, perhaps the quintessential plumbing program.
- taeric 5y agoThough, Make is one of the quintessentially disliked versions of that type of plumbing program. :( Such that I'm not sure on which side of the evidence line it lands.
- vgel 5y agoSvelte does something similar with its `$: x = ...` syntax. I wonder if it was inspired.
- geokon 5y agoDon't you accomplish nearly the same thing with memoized functions? This seems to just provide a wrapper that obfuscates things
- mikewarot 5y agoMemoized functions have to be idempotent (without side effects). 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.
- geokon 5y agoWell they don't need to be idempotent, but it's generally a good idea if you want to stay sane debugging your system. To the second effect, I know in clojure's reframe this is handled by something called "subscriptions". It provides a sort of extension of memoization where functions subscribe to a state atom and you can create this dependency graph. 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 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 :)
- mikewarot 5y ago> second magical assignment operator "magical assignment operator" - I love it. 8)
- nielsole 5y agoOPA's Rego has the same syntax and semantics
- AndresNavarro 5y ago> Spreadsheets and FPGAs are two places where there's no focus on a "program counter". 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.
- mikewarot 5y agoYes, softcores are often used to set up peripherals, and some light duty computation, but the real time aspect of an FPGA is something best set up in Verilog or VHDL, or those type of things.