Video není dostupné.
Omlouváme se.
Prolog Meta-interpreters
Vložit
- čas přidán 19. 08. 2024
- Interpretation is pervasive in computer science both from a theoretical and a practical perspective. Prolog is exceptionally well suited for writing interpreters and meta-interpreters, and this is the source of its unique power. Meta-interpreters allow us to change and extend all features of Prolog, and incorporate new logic dynamically in our applications. More information: www.metalevel....
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.
Why the programming languages are still not self-aware in the 21-st century !!!!
That should really trouble you all.
This is absolutely wonderful! Not only for Prolog learners, but in general for programming languages design. Thanks, Markus!
Thank you so much for your kind words, I'm very glad you like this! Enjoy!
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.
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.
@@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!
Really enjoyed this video. So lucid yet so deep. As with all your videos. But this is one of the best.
great channel, I'm watching your videos one after another. I wish there were more about warren abstract machine
Very good, 49:12 was a [startle moment] :) thank you.
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.
Thanks for a deep dive into a Prolog. Compared to that all my previous programs look like toys :)
great explanations for a quite hard and dry topic !
Do you know if anybody had implemented miniKanren's interleaving search strategy in the manner your described?
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.
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.
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!
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.
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.
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!
So could Prolog even be better than Lisp for this? In what regard?
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.
@@ThePowerOfProlog Thank you for the info