Fork me on GitHub

greetings! Is using clara for sessions as small as single UI form – an overkill in context of mobile applications (e.g. React Native apps, where performance is more expensive than on desktop websites or backend)?


@misha It could be. Even if not for performance, it may just be too complex of a tool for the job. What sort of reasons were you thinking that it may be helpful for a single form?


I guess I wouldn’t think a form would have enough complex control flow


by form I mean registration/billing/etc. form (just to clarify)


forms can get pretty complex, with all the fetching, autosuggesting, autocompleting, validation, etc.


but what I am really after, is a way to manage lots of state, it can be as complex, as entire application state: think many dependent and independent widgets on the same screen, or even many screens, but with routing implemented with rules too, instead of having it as a standalone thing with its own tools and approaches.


@misha yeah, that sounds interesting. I don’t know on the performance concerns. I’m not sure I’ve heard of someone using Clara on mobile applications to have anything to go off of.


Also, precept seems to be using Clara in a somewhat similar way as you describe. However, I’m not sure it is handling routing.


The space/time complexity of Clara is going to be reliant on the number of rules, complexity of the join conditions within the rules, and the size of facts in working memory.


So you can get a pretty large range of performance characteristics depending on your use-case


The tendency of the rules network is to favor time over space. e.g. intermediate match state is saved to avoid recomputing values later. So a space vs time tradeoff.


If your working memory state isn’t prohibitively large though, the space may still be reasonable


I am yet to read into precept, but guys do not hesitate to call it framework, so I am being "careful" there :)


as far as mobile apps performance concerns go, I am worried about cpu speed at the moment, since I was forced to move datascript to a separate RN thread because of pull calls speed on a somewhat large db.


But I am looking at rule based systems™ from an application state management pov, which might be only few hundred kvs at most, I think


EDIT: i need to read better


@misha well if cpu is your worry than at least Clara favors that over space usage


It’d be cool if you could try it out and report back with how it performs in this mobile case


Nothing stands out to me as being too prohibitive


@mikerod first, I need to start thinking in terms of rules, but as soon as will have something to show – I'll let you know.


sounds fun!