4 ms·
> One thing I've wondered about with such systems as performance: I would be nervous about pathological cases leading to really bad performance or even DOS atta
by aarroyoc 4y ago
> One thing I've wondered about with such systems as performance: I would be nervous about pathological cases leading to really bad performance or even DOS attacks. My understanding of Prolog in particular is that sometimes I get in your program to run to completion requires a nontrivial understanding of the backtracking algorithm them so you can judiciously place cuts, etc.
That depends on which constructs are you using. It's perfectly fine to write modern Prolog code without any cut, but the sad thing is that those constructs (once/1, dif/2, if_/3, tabling, ...) aren't taught in most books out there (the exception is The Power of Prolog) which still perpetuates these ideas about Prolog.
- Karrot_Kream 4y agoYou would probably need to do some testing before heading to production, but the easiest insurance would probably be to wrap every query in a timeout and just cancel the query after a max timeout. Most net systems work this anyway and it gives you insurance around a slow query saturating your business logic.