Are there any libraries that bring ref
s, atom
s and agent
s to C code?
Are there also structural sharing libraries for C to accompany?
To my knowledge no.
Even if there was, IMHO it wouldn't be a particularly good fit for C code:
swap!
for updating an atom is itself a higher order function. While I'm not saying that you can't write functional-style STM code in C if you are determined enough.... it's not a good fit though, and you'd probably end up reinventing something like Lisp anyway. I'm reminded of Greenspun's tenth rule of programming:
Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.
Basically, use the right tool for the job :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With