Split khepri_fun
into its own library?
#60
Replies: 1 comment 1 reply
-
Hi! That's a good use case as well, I didn't think about it before. Nothing strange there :-) And yes, There is a significant amount of work with the Khepri testsuite too. It started as a testsuite to make sure transaction functions didn't do anything forbidden. It's now a large testsuite testing many things, sometimes unrelated to transactions. But the most difficult part remains the same as with every new projects: finding a name! A name generator just suggested me Qyrad The Taker Of Life or Resosdienth The Insane. I like them and the domain names are available! :-) More seriously, I will come up with some ideas. @kjnilsson: You are good at picking names, what would you suggest for the function extraction code of Khepri? @the-mikedavis, feel free to share yours as well! |
Beta Was this translation helpful? Give feedback.
-
I was parousing through the Erlang Forums post and I caught @dumbbell's comment (btw congrats on 0.2 :) that it might be nice to have khepri_fun as its own library.
I have been considering opening up this discussion as well because I have a use-case for khepri_fun unrelated to the database aspects of khepri.
My use case...
is a bit strange admittedly 😄. We have business logic code that can be expressed in a purely-functional transaction-like way and then other code that provides an impure runtime for that code (Phoenix endpoints, database connections, HTTP clients, etc.). I would like to lint the logic code for impure instructions and also re-compile it into a fully self-contained in a module that I can hand over to the runtime code (with
code:load_binary/3
for example). The modules being both fully self-contained and purely functional means that we could load multiple versions of the same logic code into memory at once and compare outputs given the same inputs (only performing side-effects on the outputs for the "live" version), so you can expose new changes in business logic to production traffic safely and quickly. A big plus is that this approach works for any beam language 🎉I have a working prototype of this in Elixir (eventually I wanted to rewrite in Erlang and open-source), and its usage looks something like
I can talk about this more if you're interested (and I can probably give you read access to
overhaul
) but in my opinion it is pretty niche 😅What would you think about separating out khepri_fun into its own library focused on linting and re-organizing beam modules and functions?
Beta Was this translation helpful? Give feedback.
All reactions