Hello all. What is the current status of dynamically generated rules in CLJS with Clara? I saw this thread: https://groups.google.com/forum/#!topic/clara-rules/9x-dIBM1hoo, but the last bit of activity was several years ago, and I can't tell where things landed.
@d4hines I don’t know of any activity on it really
Rules are compiled in clj. The compiler uses eval
What are you wanting to explore in this regard?
I know a major goal of Clara is to "take back rules for the developer", but a major goal of a project I'm working on is to be able to update rules on the fly based on changing business logic. The rules aren't that complicated at all, but there are a lot of them, so it would be nice to create an interface for a non-developer to edit and publish the rules. It sounds like that would require deploying a new build, correct?
The thread you linked to discussed it some, but you could have a server that compilers rules and sends it back to client
if you are wanting to have a client in cljs
Not sure what your non-developer constraints are - what would they be editing in?
eg (1) a repl (2) some sort of browser-based UI etc
Well, I was definitely leaning towards (2), but having seen an example of instaparse creating clara rules, it might be neat to create a dsl such that the source of truth for the rules is a text file, in which case a fancy UI might not be as necessary.
You can make rulesets in a dynamic way
So bring in some text files, convert format to Clara rules data format, compile them (and ensure you have the right compiling-context for var resolution etc)
You can do mk-session
with collections of rule/query structures
So they do not have to be bound to Clojure namespaces/vars
So you could build a more dynamic process around that.
I'm not sure I follow, but that's probably due to my unfamiliarity with Clara in general.
Hmm
I can try to come up with an example
@d4hines Maybe this shows you enough dynamism to inspire you.
Does self hosted Clojure script work?
nope
some Clara namespaces are only clj
(not cljc)
It’d be cool to make it self-host compatible though 😛
adds a bit of a new layer of trickiness to parts of it, macros etc
Yeah. There's some help for that in macrovich
yep, I’ve seen that one
If I had more time to do it, I’d definitely look at self-hosted support. Would be cool.
It probably isn’t a terribly long way off, but I’m sure there would be some trickiness