[HN Gopher] Relic: Functional relational programming for Clojure...
___________________________________________________________________
Relic: Functional relational programming for Clojure(Script)
Author : zonotope
Score : 97 points
Date : 2023-02-26 20:03 UTC (2 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| Rodeoclash wrote:
| Clojure(script) always seems to me to be this hotbed of
| interesting ideas in programming. I.e. you'll see something wild
| like this start here then eventually the concepts make their way
| out into regular JavaScript.
|
| I'm almost starting to regret not picking Clojurescript for my
| app
| wotbrew wrote:
| A big part of the curse of lisp is that anything feels
| possible. Even for one guy who works at a veg shop.
| nextos wrote:
| While I love Clojure, these ideas already existed in other
| languages. For example, Mozart/Oz basically integrates all
| major paradigms [1].
|
| It's a bit of a tragedy it has been mostly abandoned. I wish a
| Lisp, such as Clojure, emulated Mozart/Oz semantics.
|
| [1] https://www.info.ucl.ac.be/~pvr/VanRoyChapter.pdf
| gsinclair wrote:
| Link looks great; thank you.
| cloogshicer wrote:
| Holy crap, that figure 2, showing all the programming
| paradigms and how they relate to each other is incredible.
| nextos wrote:
| The extended version of this is the book _Concepts,
| Techniques, and Models of Computer Programming_ [1], which
| is just incredibly good.
|
| There's also a summary poster [2].
|
| Actually, CTM was in Rich Hickey's reading list when he
| designed Clojure [3].
|
| [1] https://www.info.ucl.ac.be/~pvr/book.html
|
| [2]
| https://www.info.ucl.ac.be/~pvr/paradigmsDIAGRAMeng201.pdf
|
| [3] https://www.goodreads.com/list/show/137472.Rich_Hickey_
| s_Clo...
| cloogshicer wrote:
| Thank you for the recommendation!
| Scarbutt wrote:
| I guess sqlite + honeysql would be alternative. Curious to know
| why the author prefers the relations/table/codd model over graph-
| map-databases like datomic and thinks something like datomic
| "feels out" of "out of the tarpit".
| sesm wrote:
| I like how the typical JS-library-style README is put separately
| in a 'Pitch' section.
| Funnyduck99 wrote:
| I dont like clojure
| ballpark wrote:
| Funnyduck99 is probably mocking all the people that go into HN
| posts about Clojure to complain about how their team of non-
| Clojure programmers went to work on a Clojure project and it
| was a bad experience.
| Funnyduck99 wrote:
| No I genuinely don't like clojure because I just finished my
| first clojure class, it was also my first functional language
| and it was online and i am bad at learning online so thats
| why.
| joelittlejohn wrote:
| Dan recently recorded a session about Relic, if you'd like to
| hear him speak more about the origins of the library, some design
| choices, and some examples:
|
| https://youtube.com/watch?v=QsEJ5O2e4Es
| wcerfgba wrote:
| How are updates triggered, what's the mechanism? From the
| examples it seems like you don't need to subscribe and provide a
| function to be called when changes happen, but then how does it
| work?
| wotbrew wrote:
| A relic db is a persistent data-structure [1]. Applying a
| transaction with rel/transact gives you a new database,
| rel/track-transact also returns the changes to relations you
| have opted-in to change tracking (using rel/watch).
|
| [1] https://en.wikipedia.org/wiki/Persistent_data_structure
| prettyStandard wrote:
| This looks really interesting! As someone who has worked with
| relational databases and Clojure in the past, I can definitely
| see the appeal of a functional relational programming model.
|
| I like that relic provides support for declarative data
| processing and declarative relational constraints. These are
| areas that can be tricky to handle when working with traditional
| relational databases, so it's great to see a library that
| addresses these pain points.
|
| The ability to use relic with reactive programming is also a big
| plus. I'm curious to see how this would work in practice,
| particularly in the context of an interactive application.
|
| Overall, relic seems like a promising library for anyone looking
| to work with normalized data in Clojure. I'll definitely be
| giving it a try on my next project!
___________________________________________________________________
(page generated 2023-02-26 23:00 UTC)