clara

2023-03-14T00:38:56.975119Z

Hmm. I thought I remember something like that too. But now can’t find it

jherrlin 2023-03-14T14:01:22.112719Z

Hey, Is there any know tools for creating Clara rules from like a web UI. Aimed for non programmers to use.

staypufd 2023-03-16T12:54:20.119719Z

If you want a user approachable rules system, look at Drools. It has nice UI a web Ui as well, supports rules in a English like language, decision trees, and more. There are a few Clojure projects on GitHub. They are older but probably good to look at for how to interop using Clojure. https://drools.org/

jherrlin 2023-03-15T07:12:07.829669Z

Thanks for the input! Yeah I guess it will hide that's Clara underneath. I think Clara is very well suited for it though as of the data model for rules and queries.

ethanc 2023-03-14T18:41:20.669099Z

Generally speaking, as the contract within the rules dsl is inclusive to CLJ and CLJS, clara isn’t really aimed at non programmers. That “raw language” api would be a concern for malicious code injection, which might dissuade people from having such a page… That being said, no, i am not aware of any such tools. If one did exist, i’d imagine it would hide it’s clara underbelly under a user friendly facade.

Dave Russell 2023-03-14T16:16:32.485579Z

http://www.clara-rules.org/docs/ruleforms/

Dave Russell 2023-03-14T16:16:43.721679Z

Is this not possible in clojurescript because CLJS requires pre-defined rule sessions?

✅ 1
2023-03-17T14:35:01.827039Z

I think my issue https://github.com/cerner/clara-rules/issues/388 mentioned above would have to be overhauled in order to explore other cljs tooling.

Jakub Holý (HolyJak) 2023-03-16T22:21:23.532489Z

I wonder, could the need for eval be alleviated by using SCI?

ethanc 2023-03-14T19:02:54.043519Z

I’d likely have to defer to @mikerod, but if i recall correctly the issue lies with the point in time when the arbitrary code forms have to be evaluated. On the CLJ/Java side, we are able to evaluate code on the fly at any point. The CLJS side is a little more of a blur to me, but i believe that it would likely attempt to try and eval code which isnt supported by default in CLJS but rather would have to require other workarounds/libraries that may/may not be ideal for consumers. Thus for the CLJS side of things, the current behavior requires the sessions to be defined at compilation time.

2023-03-14T19:11:30.962559Z

The CLJS side is special in clara indeed. On the JS env, there is no clara compiler available - since it in turn uses the CLJS compiler and eval. CLJS sessions are made at macroexpansion time during CLJS compilation. The resulting expansion is code suitable for CLJS’s JS compilation. I have had an open issue for some time to modernize this approach, but fundamentally I don’t think that’d break away from this constraint on how it works. See https://github.com/cerner/clara-rules/issues/388 A fully self-hosted sort of clara JS-env compiler would be interesting. It’d be quite a bit of work at this point though since the clara compiler would have to be written in cljc and have the host-specific parts written for the js-side.

Dave Russell 2023-03-14T19:22:52.603929Z

Thanks for the responses! I did some digging in this channel historically and am looking into doing server-side compilation of the network as a possible option. Client rule changes will not be particularly often, so it may not be altogether tons of overhead to build server-side and dump to the client. I will post back if I get it working!

👍 1
2023-03-14T19:23:26.506369Z

Ok. Yeah, I’d be curious what you come up with and if it works out well.