Fork me on GitHub
#clara
<
2023-03-14
>
mikerod00:03:56

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

jherrlin14:03:22

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

ethanc18:03:20

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.

jherrlin07:03:07

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.

staypufd12:03:20

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/

Dave Russell16:03:43

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

2
ethanc19:03:54

I’d likely have to defer to @U0LK1552A, 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.

mikerod19:03:30

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 Russell19:03:52

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!

👍 2
mikerod19:03:26

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

Jakub Holý (HolyJak)22:03:23

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

mikerod14:03:01

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.