Biff tutorial: build a chat app with Clojure
biffweb.com
biffweb.com
I was going to ask why the tutorial mentions using rum to render components, but then also mentioned using htmx, since the latter seems like it should be sufficient. But a quick perusal of the code suggests rum isn't used after all. Why does the tutorial still mention that?
htmx doesn't render anything on the backend; rather it gives the frontend more ways to interact with the backend. e.g. say you make an inline form--htmx gives you the ability to display/submit that form without refreshing the entire page, but all the html that's sent to the frontend is still getting rendered first by Rum.
[1] See https://github.com/jacobobryant/biff/blob/6353c406adef034448... and https://github.com/jacobobryant/biff/blob/6353c406adef034448...
Interesting project though
"Many databases can support various levels of "time travel" queries across transaction time (i.e. the transactional sequence of database states from the moment of database creation to its current state), however such capabilities are typically complex to use and have practical limitations. By contrast, XTDB provides an always-on capability for point-in-time querying of past transactional states and across the valid time axis."
- Immutability, which makes it fit well with the functional programming style used in Clojure. You can create a database connection object that represents a snapshot of the database at a specific point in time (usually the current time), and queries made via that object will ignore any transactions that occurred later. So you can effectively pass the entire DB around as an argument and your functions stay pure. (That also makes it easy to inspect historical snapshots, similar to looking through old git commits--I don't do it often, but it's very nice to have when you need it.)[1]
- Datalog instead of SQL. I find Datalog queries to often be more compact than the equivalent SQL, especially thanks to the implicit joins--you can query for things from multiple "tables" without having to type up a bunch of JOIN expressions. And there are various other handy doodads like pull expressions[2].
- Clojure ergonomics. You can store Clojure maps as XTDB documents as-is without needing to write code to translate them to records.
[1] XTDB's bitemporality also has some benefits over e.g. Datomic (https://www.datomic.com/, another immutable, Clojurey database), though I haven't needed to use it yet--Datomic's "monotemporality" would be sufficient for my current needs.
[2] https://docs.xtdb.com/language-reference/datalog-queries/#pu...