View Single Post
Posts: 254 | Thanked: 122 times | Joined on Nov 2009
#6
Originally Posted by DaSilva View Post
Is this similar to to the shepherd project?
Yes, it is similar. I didn't head about shephered before. But ET-Prolog is more powerful and allows to describe more complex rules. If I'm not mistaken shephered gives you:
  • predicates - which describe device state
  • logic operators over this predicates
  • predefined actions.

Et-Prolog gives you:
  • temporal terms. The same as values of predicates in shephered,
    but you can define your own terms.
  • guards. The same as predicates in shephered.
Additionally you get:
Temporal logic over temporal terms. So you can make decisions, which depend on history of temporal terms changes.
Instead of simple boolean logic over temporal terms you get full prolog power (which includes boolean logic). This is complete language, so you can script any behavior. You can also run any shell command by SWI-Prolog built-in shell/1 predicate, if you need.

So yes, it is similar. Bu shephered is just daemon, that performs actions when conditions are met and ET-Prolog is complete programming language. And I agree, that for most cases shephered could give enough functionality. But example with silent mode during sleeping can't be done with it, unless you would start scripts which would remember their state from shephered. Shephered can't describe things like "if something has happened not more than N minutes ago and some conditions are met now, do something once".

Originally Posted by mornage View Post
As a noon developer I really like the idea of easily being able to create my own scripts etc. However, this is still a little over my head. I can see that the code is much easier to write, but I do not know what to write still!
Actually, had to get used to it too to start writing scripts. But for simple ones you don't need to know much. I know less than ten prolog predicates and this is enough for me.
I believe, that it is possible to write short and clear documentation how to write basic scripts.
 

The Following 2 Users Say Thank You to KiberGus For This Useful Post: