Hi,
I've recently become interested in metaprogramming with Visual Prolog. in Turbo Prolog 2, there was an excellent chapter on it in the reference manual Appendix. Does such a thing exist for Visual Prolog? Perhaps an updated version??
- Thomas Linder Puls
- VIP Member
- Posts: 1398
- Joined: 28 Feb 2000 0:01
Re: Metaprogramming?
I have never read that book. I do not recall having seen it here either. The "thing" does not exist in any updated version, in fact the letters "meta" does not appear in the Vip 5 manuals. So it had vanished before I got involved. But I am familiar with Turbo Prolog 2 (I wrote my masters thesis using it, but I (for "some" reason) didn't have the book).
Meta-programming is "something" about a program manipulating itself. Often this is used to achieve some behavior that is otherwise very difficult to achieve. But on the downside such programs can be quite tricky to deal with in terms of debugging and maintenance. As a consequence of this downside programming languages are often improved in ways which make it possible to achieve the goals without using meta-programming "things".
Turbo Prolog 2.0 is something like 35 years back, so my guess is that I would advice different approaches today.
Anyway, if you sketch-out the things from the chapter, I will assist the best I can (most likely with completely different approaches
).
Meta-programming is "something" about a program manipulating itself. Often this is used to achieve some behavior that is otherwise very difficult to achieve. But on the downside such programs can be quite tricky to deal with in terms of debugging and maintenance. As a consequence of this downside programming languages are often improved in ways which make it possible to achieve the goals without using meta-programming "things".
Turbo Prolog 2.0 is something like 35 years back, so my guess is that I would advice different approaches today.
Anyway, if you sketch-out the things from the chapter, I will assist the best I can (most likely with completely different approaches
![Wink :wink:](./images/smilies/icon_wink.gif)
Regards Thomas Linder Puls
PDC
PDC
-
- Posts: 3
- Joined: 26 Aug 2021 20:41
Re: Metaprogramming?
Thomas,
Thank you for your reply!
As it happens, I have a digital photograph of each page of that Appendix. I”d be happy to send you a copy, though I’m not sure if there would be any copyright issues. You might want to check with your legal department to see if anyone still owns the copyright to that manual and if it would be okay for me to send you a copy. In my experience, copyright laws can be sticky and problematic especially in commercial environments. I wouldn’t want to put anyone in legal jeopardy. Just let me know. . .
More generally, the chapter concerns itself with justifications for design choices in VIP and making meta-interpreters, basically like “PIE”. it kinda recreates a prolog compiler based Warren abstract machine as well as commonly used meta-interpreter features (Like proof-tracing, debugging, explanations, etc). I’m not interested in writing any hairy self-modifying code, just making a beefed up interpreter. Perhaps I should have asked you if there is anything written about “PIE” for VIP10. Consider it asked.
I guess my reference to Turbo Prolog 2 dates me, but yeah, it was about 35+ years ago that I had a (professional) interest in Prolog language and environments. Now, in my retirement, I find it interesting all over again.
Thanks, Again,
Chuck
Thank you for your reply!
As it happens, I have a digital photograph of each page of that Appendix. I”d be happy to send you a copy, though I’m not sure if there would be any copyright issues. You might want to check with your legal department to see if anyone still owns the copyright to that manual and if it would be okay for me to send you a copy. In my experience, copyright laws can be sticky and problematic especially in commercial environments. I wouldn’t want to put anyone in legal jeopardy. Just let me know. . .
More generally, the chapter concerns itself with justifications for design choices in VIP and making meta-interpreters, basically like “PIE”. it kinda recreates a prolog compiler based Warren abstract machine as well as commonly used meta-interpreter features (Like proof-tracing, debugging, explanations, etc). I’m not interested in writing any hairy self-modifying code, just making a beefed up interpreter. Perhaps I should have asked you if there is anything written about “PIE” for VIP10. Consider it asked.
I guess my reference to Turbo Prolog 2 dates me, but yeah, it was about 35+ years ago that I had a (professional) interest in Prolog language and environments. Now, in my retirement, I find it interesting all over again.
Thanks, Again,
Chuck
- Thomas Linder Puls
- VIP Member
- Posts: 1398
- Joined: 28 Feb 2000 0:01
Re: Metaprogramming?
I can't imagine that we would have any legal problems having our own book in whatever format. But you may have a problem with Borland (doubt they will do anything about it, though).
Anyway, in relation to PIE (and the like) there is a the "complication" that we have removed "reference domains" (many years ago). See How To Remove Reference Domains from a Project.
You may also look at the pieDemo (among the examples from the installation) concerning how PIE integrate with/automate your own code.
And of course the pie demo itself.
But we do not really have any new documentation on how to write interpreters or compilers for that matter. (Well, there is also something about writing parsers: LALR Parser Generator).
Anyway, in relation to PIE (and the like) there is a the "complication" that we have removed "reference domains" (many years ago). See How To Remove Reference Domains from a Project.
You may also look at the pieDemo (among the examples from the installation) concerning how PIE integrate with/automate your own code.
And of course the pie demo itself.
But we do not really have any new documentation on how to write interpreters or compilers for that matter. (Well, there is also something about writing parsers: LALR Parser Generator).
Regards Thomas Linder Puls
PDC
PDC
-
- Posts: 3
- Joined: 26 Aug 2021 20:41
Re: Metaprogramming?
THOMAS,
I will look at the references & examples you recommend. thanks for the pointers. . .
I thought y’all (PDC) might have been the authors of that book. Is Borland even still a corporate entity? Please contact me with instructions to electronically deliver to you the 60MB+ document. I assume you can access my email address from the forum records. . .
I will look at the references & examples you recommend. thanks for the pointers. . .
I thought y’all (PDC) might have been the authors of that book. Is Borland even still a corporate entity? Please contact me with instructions to electronically deliver to you the 60MB+ document. I assume you can access my email address from the forum records. . .