Prolog Meta-interpreters

Поделиться
HTML-код
  • Опубликовано: 6 ноя 2024

Комментарии • 27

  • @remyclarke4020
    @remyclarke4020 3 года назад +30

    1:02:46
    -
    "of course these languages these languages have their valid use cases, for instance C is good for adding security problems in your applications, Pascal is probably also good for something, ..."
    Absolute savage, I love it.

    • @reasonerenlightened2456
      @reasonerenlightened2456 3 года назад

      Why the programming languages are still not self-aware in the 21-st century !!!!
      That should really trouble you all.

  • @teucay7374
    @teucay7374 3 года назад +2

    This is absolutely wonderful! Not only for Prolog learners, but in general for programming languages design. Thanks, Markus!

    • @ThePowerOfProlog
      @ThePowerOfProlog  3 года назад +1

      Thank you so much for your kind words, I'm very glad you like this! Enjoy!

  • @sklingberg
    @sklingberg 3 года назад +3

    Really interesting! I once made a meta-interpreter in XSLT, because I needed it, so I understand the importance of it. Prolog is obviously a better language for a meta-interpreter.

    • @reasonerenlightened2456
      @reasonerenlightened2456 3 года назад

      The problem of Prolog is that the meaning is assigned by the human .
      loves (stacy, chad).
      for Prolog is different than
      l ( s, c).
      Basically, the meaning remains in the head of the human and Prolog is completely void of capturing the meaning of 'Stacy loves Chad'.
      The same applies to any other programming language I am aware of. THEY ALL FAIL TO CAPTURE MEANING, AWARENESS, CONTEXT, etc. !
      Why the programming languages are still not self-aware in the 21-st century !!!!
      That should really trouble you.

    • @GeoffreyChurchilley
      @GeoffreyChurchilley 3 года назад +2

      @@reasonerenlightened2456 Just write a Prolog meta-interpreter and toss in a meaning(Expression, Meaning) predicate:D Also, I think self-awareness would be a property of a stateful machine rather than a language, but the homoiconicity and reflective facilities of Prolog might make implementing that machine a lot easier!

  • @McSwey
    @McSwey 3 года назад +1

    great channel, I'm watching your videos one after another. I wish there were more about warren abstract machine

  • @mikeamy4649
    @mikeamy4649 3 года назад +2

    Really enjoyed this video. So lucid yet so deep. As with all your videos. But this is one of the best.

  • @HakanKjellerstrand
    @HakanKjellerstrand 3 года назад +1

    Excellent, Markus!
    It was really interesting, especially the clause/2-less versions! And almost all your examples works in Picat as well, which is really great.

  • @AleksyGrabovski
    @AleksyGrabovski 3 года назад +1

    Thanks for a deep dive into a Prolog. Compared to that all my previous programs look like toys :)

  • @Kakadu18
    @Kakadu18 3 года назад +4

    Do you know if anybody had implemented miniKanren's interleaving search strategy in the manner your described?

  • @harrykaradimas857
    @harrykaradimas857 3 года назад +1

    great explanations for a quite hard and dry topic !

  • @smithinus
    @smithinus 3 года назад +1

    Very good, 49:12 was a [startle moment] :) thank you.

  • @morphles
    @morphles 3 года назад +2

    What about writing compilers in prolog? To me seems like it should be "best s* ever". Admittedly I'm super mega noob in prolog, inspired very much by your videos.
    My thinking is that basically all compiler optimizations and stuff are in essence logic rules, and prolog can work on them, thus should be able to apply them easily, possibly even same rules could decently easily be applied to compiling multiple significantly different (say imperative like C vs declarative like haskell) languages without too much work? Then we make it compile prolog, we get "Self optimizing prolog" -> singularity :). The thing is I do not see all those compilers written in prolog and that is mildly weird.

    • @ThePowerOfProlog
      @ThePowerOfProlog  3 года назад

      Yes, absolutely! Prolog is great for writing compilers and optimizers. See for example Stefan Kral's PhD thesis "FFT Specific Compilation on IBM Blue Gene", the Prolog part starts around page 67 and continues from there:
      repositum.tuwien.at/bitstream/20.500.12708/10227/2/Kral%20Stefan%20-%202006%20-%20FFT%20specific%20compilation%20on%20IBM%20Blue%20Gene.pdf
      All these optimization steps are easily represented as relations between terms, defined as Prolog rules.
      I expect to see a lot more Prolog code to become publicly available when free Prolog systems become more mature and feature-rich. Thank you a lot for your interest!

  • @sefirotsama
    @sefirotsama 3 года назад +1

    I am familiar with prolog syntax and concepts but by not having any real-world experience with it I feel quite lost watching this video, even if I conceptually understand it. I guess it is time to review all the foundations and gain some real experience.

  • @ngruhn
    @ngruhn 2 года назад

    49:10 😅 that sounds like a lot of frustration has piled up, trying to teach Prolog to students. But seriously, I think it's sad that few people appreciate Prolog. Everyone I know, who had to learn it in university, was just annoyed by it. I feel like, if they would just spend a bit more time to overcome the initial confusion, they would have recognized the elegance.

  • @DaveRoberts308
    @DaveRoberts308 2 года назад

    Great video, as always, but I have a quibble. At the 5 min mark, you claim that the combination of properties 1 through 3 is unique to Prolog. I think Lisp also shares these properties, which is why so many meta-interpreters are also written in Lisp. But yes, Prolog also has these properties.

    • @ThePowerOfProlog
      @ThePowerOfProlog  2 года назад

      Thank you a lot! I also have a quibble: I do not claim that the combination of these properties is unique, but rather that the specific alignment of the points is unique to Prolog. As a specific example, Prolog's implicit mechanisms allow much shorter Prolog meta-interpreters than Lisp's implicit features allow Lisp meta-interpreters. It is true: Lisp also has implicit features (example: garbage collection), but they are not as well aligned as Prolog's features for building short meta-interpreters. Thank you again for your kind words, enjoy!

  • @filiperocha1465
    @filiperocha1465 3 года назад

    So could Prolog even be better than Lisp for this? In what regard?

    • @ThePowerOfProlog
      @ThePowerOfProlog  3 года назад +3

      Prolog admits a very short meta-interpreter, much shorter than it is possible in Lisp. The reasons for this are that we can absorb the binding environment, because variables on the object-level are also variables on the meta-level, and we can use Prolog's implicit search and backtracking also in meta-interpreters, a powerful implicit mechanism that is not available in Lisp.

    • @filiperocha1465
      @filiperocha1465 3 года назад

      @@ThePowerOfProlog Thank you for the info