hlship 4 days ago

So close to describing the Dialog IF language it’s almost prescient.

https://linusakesson.net/dialog/index.php

Dialog is a Prolog dialect: it’s like Markdown and Prolog had a baby.

  • tannhaeuser 4 days ago

    It's neither Prolog nor a "dialect". From the intro:

    > Dialog is a domain-specific language for creating interactive fiction. It is heavily inspired by Inform 7 (Graham Nelson et al. 2006) and Prolog (Alain Colmerauer et al. 1972), and substantially different from both.

    • hlship 4 days ago

      It's based on unification, like a Prolog. It does backtracking, like a Prolog. It has something akin to Prolog "cuts". It's equally not Markdown. What it is, is the sensibilities of Prolog (for parsing words into player intent - actions) and for implementing a world model, and for inferring facts from other facts ... and also the text-foremost sensibility of Markdown.

      I love it. I've put considerable effort into building tools around it, and to building up a library of extensions.

      • YeGoblynQueenne 3 days ago

        Backtracking and unification do not make a languge Prolog. What makes Prolog, Prolog. is that programs are sets of definite clauses, executed by proving Horn goals with SLD-Resolution.

        There is so much confusion about that and I blame textbooks like Structure and Interpretation of Computer Programs and hackers like Gerald Sussman who have taught generations of programming students that Prolog is about backtracking with unification. It isn't and I've had many awkward conversations with folks who know about logic programming and Prolog from SICP and other similar texts until I realised that we are talking about completely different things.

        If I remember correctly SICP doesn't even mention SLD-Resolution, or Resolution at all and most people I've spoken to who have learned about Prolog and "logic programming" from SICP have not even heard the words "SLD-Resolution". It's like a Prolog from a parallel universe based on dictionaries and partial unification with LISP variables.

        As to Dialog in particular- it's a Domain Specific Language for writing IF games. Ver cool but not Prolog.

  • tunesmith 4 days ago

    First I've heard of this one. I never got into Inform7 because I didn't find the language very discoverable; it felt like writing AppleScript. Do you know of any links to larger examples of Dialog code, like a full open source game written in the language?

    • hlship 4 days ago

      That was my frustration as well; and it comes up in discussions. Simple to medium complex things are easy in Inform7, but when you start hitting the edges, you find out that its expressive English-like syntax is in the uncanny valley and exactly how you phrase things becomes vitally important and difficult to discern, even from the mounds of documentation it generates from your story file and from the standard library and extensions.

      • bawolff 4 days ago

        Lol, so its like playing an interactive fiction game.

  • Avshalom 4 days ago

    I feel like I knew about this at some point but thank you for reminding me especially now that I've got more prolog under my belt.

upghost 4 days ago

Strangely enough, IF7 was the first thing to make it "click" for me how declarative logic could be used for general purpose logic programming, which shortly thereafter led me to Definite Clause Grammars, Marcus Triska's work on Definite Clause Grammars[1], and (like this comment) was the gateway drug to (Scryer) Prolog, and Prolog used not just for niche applications but for general purpose computing.

Of course I since realized that was the tip of the iceberg.

[1]: https://youtu.be/CvLsVfq6cks

spencerflem 4 days ago

Just started getting into logic languages / Answer Set Programming!

Don't know much yet but some interesting things I've found:

Dusa, which promises an easier way to merge constraint languages and answer sets https://dusa.rocks/

Puzzlescript, which isn't exactly the same paradigm (its declarative but not a logic lang) that is beloved by the sokobon puzzle community. Sokobon itself is three lines of code in this and many other games only need to add one or two more. Its genius. https://www.puzzlescript.net/

My goal rn as an art project is to try to combine the two, so every puzzlescript game can be queried for interesting properties in Dusa / Potasscio / Some Logic Language.

  • MIA_Alive 3 days ago

    Wait, are you saying my hours poured into clingo/ASP mightactuallybe marketable?

    • spencerflem 3 days ago

      Idk about marketable, but I think it's cool :)

Jtsummers 4 days ago

https://www.clipsrules.net - CLIPS handles some of the things discussed in this presentation pretty well.

When the author gets to the portion on priorities, in CLIPS this is (primarily) handled with salience and modules.

Salience is a numeric value assigned to each rule, assuming only one agenda the rules with the highest salience will be processed first.

Modules group rules and there's a "focus" stack of modules. The module at the top of the focus stack has its agenda processed first before any other modules. Focus can be controlled by the programmer.

It then has other mechanisms (selectable by the programmer, default is "depth strategy") for when an agenda has multiple rules of the same salience. Depth strategy is LIFO (last in first out), treating the salience level as a stack. So if a rule with salience 10 is activated and later a second rule is activated with salience 10, the second one will run first.

https://www.clipsrules.net/documentation/v641/bpg641.pdf - Page 26 for conflict resolution strategies.

  • summarity 4 days ago

    Also CLIPS has an entire book on creating an interactive fiction game (Adventures in Rule based Programming)

duskwuff 4 days ago

Don't miss the tiny adventure game in the footers of each slide.

sethrin 4 days ago

I feel like the missing option is event handlers.

  • bluGill 4 days ago

    Maybe they are not better at the problem than anything else.