this post was submitted on 21 Jul 2023
20 points (100.0% liked)

Programming

17474 readers
262 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

Any recommendations for learning (modern) prolog? Specifically looking at ishigo/prolog and trealla-go as a way to embed rules validation engines in a golang application. Am I insane? If not (or so) how do I best go about learning prolog?

top 6 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 1 year ago

I found the art of prolog 2nd edition and starting reading this...

[–] nibblebit 3 points 1 year ago (1 children)

The way I managed to get an intuition about the language is just building classic boardgames. Checkers, chess, diplomacy and go are great exercise to start working with lists and dimensions, declaring multiple predicates and have them interact with each other. Changing the state of the program and using the traces to branch out decisions. Remember to keep track of your interpreter. Different interpreters act in surprising ways. The order of operations of SWI is different than Tau.

After that, the honest truth is that Prolog isn't widely used enough to have a 'modern standard approach'. The best way is to treat it like any other embedded subsystem: light and concise scripts embedded in a grown-up language.

[–] [email protected] 1 points 1 year ago

Thanks that's helpful and maps to how I'm thinking it might be useful

[–] [email protected] 1 points 1 year ago (1 children)

I thought Erlang superceded it?

[–] [email protected] 6 points 1 year ago (1 children)

No, Erlang has a completely different paradigm than Prolog, it just looks superficially similar because the people who created Erlang liked Prolog's syntax so that's what they used as the basis for Erlang instead of the more standard ALGOL-derived syntax that most of us are used to.

[–] [email protected] 2 points 1 year ago

Thanks this matches my understanding too (erlang is all about actor model is my understanding, similar to akka)