clara

http://www.clara-rules.org/
2018-06-29T19:27:12.000326Z

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.

2018-06-29T20:34:40.000005Z

@d4hines I don’t know of any activity on it really

2018-06-29T20:34:51.000381Z

Rules are compiled in clj. The compiler uses eval

2018-06-29T20:35:16.000174Z

What are you wanting to explore in this regard?

2018-06-29T20:38:38.000281Z

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?

2018-06-29T20:39:48.000012Z

The thread you linked to discussed it some, but you could have a server that compilers rules and sends it back to client

2018-06-29T20:39:54.000141Z

if you are wanting to have a client in cljs

2018-06-29T20:40:20.000140Z

Not sure what your non-developer constraints are - what would they be editing in?

2018-06-29T20:40:34.000199Z

eg (1) a repl (2) some sort of browser-based UI etc

2018-06-29T20:42:49.000047Z

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.

2018-06-29T20:44:10.000423Z

You can make rulesets in a dynamic way

2018-06-29T20:45:15.000100Z

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)

2018-06-29T20:45:30.000115Z

You can do mk-session with collections of rule/query structures

2018-06-29T20:45:43.000379Z

So they do not have to be bound to Clojure namespaces/vars

2018-06-29T20:46:03.000025Z

So you could build a more dynamic process around that.

2018-06-29T20:48:16.000025Z

I'm not sure I follow, but that's probably due to my unfamiliarity with Clara in general.

2018-06-29T21:33:17.000261Z

Hmm

2018-06-29T21:33:59.000172Z

I can try to come up with an example

2018-06-29T21:41:19.000221Z

@d4hines Maybe this shows you enough dynamism to inspire you.

dominicm 2018-06-29T21:43:30.000112Z

Does self hosted Clojure script work?

2018-06-29T21:43:34.000335Z

nope

2018-06-29T21:43:53.000038Z

some Clara namespaces are only clj

2018-06-29T21:43:58.000069Z

(not cljc)

2018-06-29T21:44:08.000090Z

It’d be cool to make it self-host compatible though 😛

2018-06-29T21:44:25.000173Z

adds a bit of a new layer of trickiness to parts of it, macros etc

dominicm 2018-06-29T21:44:44.000074Z

Yeah. There's some help for that in macrovich

2018-06-29T21:44:55.000052Z

yep, I’ve seen that one

2018-06-29T21:45:29.000063Z

If I had more time to do it, I’d definitely look at self-hosted support. Would be cool.

2018-06-29T21:45:44.000086Z

It probably isn’t a terribly long way off, but I’m sure there would be some trickiness