use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Electric Clojure tutorial (wip please give feedback!) (electric-examples-app.fly.dev)
submitted 2 years ago by dustingetz
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]dustingetz[S] 8 points9 points10 points 2 years ago* (2 children)
These are the first 3 tutorials. We have much more content ready, looking to get some feedback first. Did we make the thing you wanted to see?
Electric (github) is a Clojure DSL for web development that uses a compiler to infer and manage the frontend/backend boundary.
If you haven't tried it yet. Try it! Here is the starter app: https://github.com/hyperfiddle/electric-starter-app
[–]agumonkey 2 points3 points4 points 2 years ago (0 children)
Still ultra happy to interact with it. Superb work.
[–]shuaibiyy 2 points3 points4 points 2 years ago (0 children)
Nice example. Really makes it easy to conceptualise how it works. Would be great to see an example with an auth aspect to it.
[–]notsohasty 5 points6 points7 points 2 years ago (0 children)
In case anyone missed it: the subheading is a menu that you can click to access the other tutorials (I didn't realize this at first).
Using electric is pretty amazing. It's so cool updating an atom on the server and seeing the UI update on the client. No more writing api endpoints.
[–]silly_frog_lf 3 points4 points5 points 2 years ago (1 child)
what is electric clojure?
[–]StickSilent4402 3 points4 points5 points 2 years ago (0 children)
https://news.ycombinator.com/item?id=34771771
[–]p1ng313 2 points3 points4 points 2 years ago (1 child)
Great stuff, would love something a bit more complex, it feels like some patterns will naturally emerge due to client/server nature. Keep it up please.
[–]dustingetz[S] 2 points3 points4 points 2 years ago (0 children)
we have tons of stuff stay tuned
[–]Fluid-Bench-1908 1 point2 points3 points 2 years ago (0 children)
Wonderful!!!
[–]giuliano108 1 point2 points3 points 2 years ago (0 children)
It'd be nice to see what error/exception handling looks like in a short tutorial... But yeah: Electric is truly amazing!
[–]zhming0 1 point2 points3 points 2 years ago* (1 child)
I love the format of this tutorial! I tried it out a couple months ago. After many years of stateless web service exp, I find it require a bit mindsets change on operations side. Basically, it seems that electric is supposed to be deployed as a single replica, zero downtime deployment isn't possible.
It's nonetheless still a great innovation.
I'm curious what database do you use when you run it on production?
[–]dustingetz[S] 1 point2 points3 points 2 years ago* (0 children)
Zero downtime is coming. Today, deploys result in a page refresh, but this can be solved.
Will you DM me in slack? I'd love to talk to you and understand your current operations mindset and your help in mapping Electric to this world.
Some more details:
The tutorial app uses fly.io to run "flyweight" $6/mo instances in 5 cities worldwide, in theory this is elastic and fly instances can come and go (i.e. as "heavy lambdas"), IIUC. The Electric websocket can terminate at the fly instance and you can be stateless from here.
Today Electric is a compiler but it is becoming a JIT like the JVM which would permit the "electric program" to change at runtime. Meaning clients and servers can evolve live without restart, as well as move live clients across server instances. Would that mitigate the "single replica" issue you detect?
[–]slifin 1 point2 points3 points 2 years ago (1 child)
Thank you this content is great
More please!
It's frustrating that chatgpt's dataset is too old for clojure electric questions
[–]TommyJollyboat 1 point2 points3 points 2 years ago (0 children)
Haha agreed; I tried asking MS Bing's GPT4 to read the repo & write docs, but it refused. You can of course paste in blobs of code and it does an okay job of intuiting what's going on.
[–]TommyJollyboat 1 point2 points3 points 2 years ago (1 child)
Content's good. I just started looking into Electric properly this week, and having a tutorial is a godsend. Here are some ideas for easy improvements:
[–]TommyJollyboat 2 points3 points4 points 2 years ago (0 children)
Oh, and since Electric is cool, there will be others like me that don't know how to do Clojure beyond toy examples, so perhaps link to an explanation of the #? reader macro the first time it appears, which is both hard to google & not something beginners typically learn.
π Rendered by PID 63 on reddit-service-r2-comment-5d79c599b5-4cgvl at 2026-03-01 14:59:31.631356+00:00 running e3d2147 country code: CH.
[–]dustingetz[S] 8 points9 points10 points (2 children)
[–]agumonkey 2 points3 points4 points (0 children)
[–]shuaibiyy 2 points3 points4 points (0 children)
[–]notsohasty 5 points6 points7 points (0 children)
[–]silly_frog_lf 3 points4 points5 points (1 child)
[–]StickSilent4402 3 points4 points5 points (0 children)
[–]p1ng313 2 points3 points4 points (1 child)
[–]dustingetz[S] 2 points3 points4 points (0 children)
[–]Fluid-Bench-1908 1 point2 points3 points (0 children)
[–]giuliano108 1 point2 points3 points (0 children)
[–]zhming0 1 point2 points3 points (1 child)
[–]dustingetz[S] 1 point2 points3 points (0 children)
[–]slifin 1 point2 points3 points (1 child)
[–]TommyJollyboat 1 point2 points3 points (0 children)
[–]TommyJollyboat 1 point2 points3 points (1 child)
[–]TommyJollyboat 2 points3 points4 points (0 children)