hyperfiddle

grounded_sage 2025-03-18T07:53:53.796149Z

Have not touched my electric repository for a while. No changes from my code but I am getting this when I try and start it. Start of stack trace is: Exception in thread "main" Syntax error macroexpanding at (hyperfiddle/electric/impl/lang3.clj:1:1). Also later says it's related to contrib. Caused by: java.io.FileNotFoundException: Could not locate contrib/assert__init.class, contrib/assert.clj or contrib/assert.cljc on classpath. Did something change. I think I saw something about contrib changing.

grounded_sage 2025-03-18T09:05:11.217299Z

Going to just try with a fresh starter.

grounded_sage 2025-03-18T09:05:22.264129Z

Did get it working. Will leave messages here for search history.

xificurC 2025-03-18T11:19:07.572589Z

mostly yes, the analyzer passes are a bit out of date. Is this just out of curiosity? This documents compiler internals for our own needs and is subject to change

oλv 2025-03-18T11:19:31.918299Z

Yes, just curiosity

👍 1
oλv 2025-03-18T11:20:34.894969Z

Now that you’re here, what is an Electric function in terms of Missionary?

xificurC 2025-03-18T13:26:24.802289Z

internally it is a missionary flow. (e/pure electric-expr) returns the underlying missionary flow (incseq)

⚡ 2
Dustin Getz (Hyperfiddle) 2025-03-19T02:02:15.519199Z

• calling an e/fn with zero args is like joining a missionary flow • any args are basically passed by dynamic scope

👀 2
oλv 2025-03-18T12:02:03.543569Z

I think the docstring of e/input should be updated. It says “Returns the current state of current continuous flow cf“. In https://electric.hyperfiddle.net/tutorial/temperature2 it is being used with a discrete flow random-writer.

oλv 2025-03-18T12:08:37.800459Z

Or maybe I’m misunderstanding what it means for a flow to be continuous. I think a continuous flow is a flow which is always ready to transfer, so random-writer is not a continuous flow because after transferring 0 it is not ready to transfer again for one second.

xificurC 2025-03-18T13:28:34.425809Z

the terms are defined loosely. Often we mean it is initialized, i.e. defined at all times. (m/ap (m/? (m/sleep 1000 :foo)) is not initialized, upon boot it has no value. (m/ap (m/amb :foo (m/? (m/sleep 1000 :foo)))) is well defined and you can call e/input on it because it has a value defined at all times

xificurC 2025-03-18T13:29:24.410779Z

i.e. it is OK to join discrete flows iff they are initialized

oλv 2025-03-18T13:31:58.876269Z

👍

2025-03-18T13:18:43.847969Z

There’s a new version of my code-coloring-for-Emacs thing. Highlights from the CHANGELOG: • Don’t color Electric calls. • Don’t color bound symbols when used in certain contexts: ◦ as an arg in an Electric call ◦ as the RHS of a binding pair. • Provide an extension mechanism so that you can teach the mode about user-land binding macros. • Support destructuring in let-bindings forms and fn-bindings forms. See thread for details.

🌳 2
2025-03-18T13:19:28.922529Z

It’s at https://github.com/simon-katz/nomis-electric-clojure-mode

bdbrodie 2025-03-18T15:51:16.812879Z

Looks nice! I wonder how hard it would be to do something similar with Calva

2025-03-18T15:56:30.431359Z

> Looks nice! Thanks! > I wonder how hard it would be to do something similar with Calva I don’t know — I’m not familiar with Calva.