[HN Gopher] Why Logtalk?
___________________________________________________________________
Why Logtalk?
Author : Tomte
Score : 103 points
Date : 2022-12-11 10:53 UTC (1 days ago)
(HTM) web link (logtalk.org)
(TXT) w3m dump (logtalk.org)
| kamaal wrote:
| Stuff like this is always fascinating to me since I read 'The
| Reasoned Schemer' and worked my way through Clojure core.logic.
|
| So as I understand this leverages and extends Prolog, and yet it
| is very dry on showing your average programmer how they could use
| this to solve their real world every day problems. If such a
| segment of user being the intended audience here at all?
|
| Either way resources to learn something like this to do something
| useful are welcome. Can somebody who is more familiar with the
| ecosystem give some pointers?
| rad_gruchalski wrote:
| One reason could be having oop-style objects available in
| Prolog. Prolog modules are global, they're like a singleton, or
| like s bunch of namespaced functions. Once you import a module,
| it is like a singleton. Prolog doesn't have anything what could
| store a state of a module so functions inside of a module can
| operate on some common state. One way would be to use a global
| database but that's really discouraged because of performance
| impact it can have.
|
| Modules being a Prolog construct can be basically created at
| runtime. So if you need multiple _instances_ , you could create
| and load multiple modules at runtime. But that's pretty verbose
| and quite a bit of work.
|
| Logtalk gives you this out of the box using your standard
| Prolog.
| harperlee wrote:
| I think one of the use cases for lambda-prolog (a prolog for
| higher-level logic instead of first-level logic) was the
| ability to implement modules in a logical-native way.
| infradig wrote:
| Logtalk is an impressive piece of work. Development of Trealla
| Prolog would not have gotten to where it is without the impetus
| to support Logtalk and the feedback from Paulo.
| mangecoeur wrote:
| why indeed
| dsabanin wrote:
| As someone who've tried to use Logtalk for real project, my
| impression is that it's extremely verbose and feels like an
| attempt to create C++ or Mozart/Oz on top of Prolog.
| Unfortunately, I believe that doing this without introducing
| extra syntax, you end up with a lot of boilerplate in a language
| like Prolog without any decent tooling to help you handle it.
___________________________________________________________________
(page generated 2022-12-12 23:01 UTC)