4 ms·
I used prolog in anger when I first started at a startup some years ago (why that was is another story) and while I found it interesting, it was really quite an
by barnacled 6y ago
I used prolog in anger when I first started at a startup some years ago (why that was is another story) and while I found it interesting, it was really quite an ineffective experience for me.
Firstly, by being so declarative if was very easy to end up with O(a^n) algorithms by mistake and secondly I found, at least in what I was doing, that for example the ordering of declarations would change program behaviour which made it imperative in a very non-ovvoous way.
I also found it hard to debug and diagnose the code or find decent resources online for it.
Perhaps I didn't do a good job with it or was missing details on exactly how best to use it but I found it was almost too declarative to the point of the rubber never hitting the road in a controllable way.
- xiphias2 6y agoI had the same problem when trying out Haskell: they give abstractions that are not constant multipliers in terms of speed or memory usage compared to a low level solution (like garbage collection and dynamic typing). Rust gives just the opposite type of abstraction over C++: memory safety without adding any unpredictability in execution (and of course updates in the language design). While relational algebra (SQL) is equivalent to logic algebra, it's easier to reason how it executes.
- barnacled 6y agoyou can still get tripped up on SQL (accidentally doing a table scan etc.) but there is explicit tooling to help you analyse that - e.g. looking at the execution plan. Haskell I can't comment on, though I can totally see that happening there, there might be better means of managing complexity and giving hints to actual implementation. With prolog the means of expression seems capable only of posing the 'question' rather than indicating that it should be not be implemented in the most naive possible way. As interesting and mind-bending a language as prolog is I just couldn't get past that and it has made me think it's just not a practical language to use for anything real. But I am happy to be proven wrong!