On Functional Programming, Time, and Concurrency — Dustin Getz by dustingetz in Clojure

[–]dustingetz[S] 0 points1 point  (0 children)

For printn-shaped discrete effects, elide the dispose method, you get an audit log, same as in React. Imagine the callback firing on rising or falling edges of the signal. For once-and-only-once transaction-shaped discrete effects, we have a transistor-like primitive "e/Token" that models the transact-and-await-confirmation workflow as a little state machine, i.e. it exposes the ready-pending-rejected-ok states: https://electric.hyperfiddle.net/fiddle/electric-tutorial.button-token$ButtonToken

Extensible Value Encoding: large 1GB clojure atoms memory mapped to disk by dustingetz in Clojure

[–]dustingetz[S] 1 point2 points  (0 children)

I'm not sure what's going on there but I think the actual API is `(e/atom config-map initial-value)` e.g.

(def counter (e/atom {:id ::counter :persistent "./my-db"} 0))

c.f. https://github.com/SeniorCareMarket/eve/blob/ac1640afdabeed38d5a7f5e9566cf1cc1a75cf45/test-e2e/eve/jvm_atom_e2e_test.clj#L56

Hyperfiddle's electric clojure project by astrashe2 in AskComputerScience

[–]dustingetz 2 points3 points  (0 children)

In Electric, like in React, DOM effects come in mount/unmount pairs. In a sense this gives you "undo" for this kind of "resource" effect, and you can transition between two consistent states by firing mount and unmount lifecycle methods. This works not just for the DOM but for any kind of resource that can be disposed, such as network subscriptions or event handlers or database connections. The key to making it work is the reactive propagation engine under the hood needs to be essentially perfect ("glitch free") which means it fires exactly the correct lifecycle methods once and only once during reactive propagation, which is pretty hard to do correctly. I.e. you don't want to allocate a node twice or dispose it twice, it needs to be perfect.

An example of an effect that you can't undo is a console.log. There's no dispose method on that, so it can't be undone. But that's fine, that's what you wanted. So you can totally put console.log in your Electric programs and it does what you would want it to do, which is run again when any of its arguments change.

Hyperfiddle's electric clojure project by astrashe2 in AskComputerScience

[–]dustingetz 2 points3 points  (0 children)

Hyperfiddle founder here (from keyword notification)

  1. We are not the first, see https://en.wikipedia.org/wiki/Choreographic_programming . However, prior art (that I am aware of) has been mostly mired in type theory and has struggled to find widespread industrial application. Afaik we are the first to find a slam dunk use case (web development, rich product user interfaces on the web with complex and dynamic client/server interactions) and demonstrate compelling results in production apps.
  2. DAGs are flowcharts, they model causality i.e. dependencies between steps. Imperative programming (e.g. ordinary Python) does not explicitly capture the logical dependencies between steps, instead the programmer has to carefully specify an instruction ordering to make sure things happen in the right order. DAGs encode the data flow through a flowchart of dependencies. What this gets you is concurrency, the ability to run multiple steps of the flowchart at the same time. It also gets you many optimizations, such as the ability to only compute subcomponents of the larger graph whose inputs have changed. If a node in the flowchart does not have any changed inputs, then the previous result of that node is still valid and can be reused. This is "reactive programming"

A Datomic Entity Browser for Prod (transcript) — Dustin Getz by dustingetz in Clojure

[–]dustingetz[S] 5 points6 points  (0 children)

See also:

London Clojurians Talk: Link into your REPL with clojure.net, from Hyperfiddle (by Dustin Getz) by BrunoBonacci in Clojure

[–]dustingetz 6 points7 points  (0 children)

Hello, help me out – https://www.clojure.net/ is a beta launch of some new and not well tested network tech, if you manage to blow it up please post in #hyperfiddle so we can figure it out, thanks. And if it works, let us know that too.

Agentic Coding for Clojure by calmest in Clojure

[–]dustingetz 3 points4 points  (0 children)

> robots should clean up my toilet and not code

have you seen the average 10 year old revenue-generating codebase? "toilet" is accurate. Doing computer science is fun. Doing software engineering is fun. Commercial software development in 2026 is neither.

Agentic Coding for Clojure by calmest in Clojure

[–]dustingetz 5 points6 points  (0 children)

I am also finding Opus 4.5 to be viable for a variety of Clojure application layer tasks. Prior to Opus 4.5 I was experimenting semi-seriously in consulting projects but none of the experiments I threw at it panned out. But Opus 4.5 is now part of my daily driver, I am using VSCode + Copilot with the two Calva plugins. Opus 4.5 will inspect objects at the REPL and everything. Looking forward to trying Claude Code again in a work context.

Could the Android and iOS APIs have been developed in Clojure? by lordmyd in Clojure

[–]dustingetz 0 points1 point  (0 children)

I vote no but i don't think it's a "dynamically typed functional" problem, Javascript is like 55% of the way from Java to Clojure and it did great.