Seperation of declaration from definition let's me share my code easily and seperate libraries out from application. Why? Best testing, documentation, and diagramming tools make it easy for me to understand my code and make sure it's working. I'm probably one of those fans of Logtalk you mention, I became such when (re)-writing and maintaining a ~10,000 line complex application in Prolog. Again, though, I am welcome to hearing what I may be missing here. However, this does not seem like a good mechanism for creating instances of abstract data structures because it is not a pure and declarative operation in particular, the last thing that I want to do in a language like Prolog is to bring in the need to manually manage instances of data structures like I would have to do in an imperative language without garbage collection! So this is the source of much of my confusion because it seems like LogTalk is trying to make it easier to work with data structures but in practice it seems like it does so by turning Prolog into an imperative programming language. This makes sense if it should be viewed as creating a module, because it is a bit like asserting new clauses in the database. The reason for me saying this is that, assuming I understand the documentation correctly, creating a new object is inherently a side-effectful act.
From it I get the impression that, rather than thinking of LogTalk as being about object-oriented programming, I should be thinking of it as being a system for writing composable modules, which makes a lot more sense.Īs for abstract data types, I agree that having a nice way to define them would be a boon, but I don't see how LogTalk really helps with this.