3 ms·
I'm surprised how hard I had to dig for an actual example of syntax[1], so here you go. [1]: https://www.lix.polytechnique.fr/~dale/lProlog/proghol/extract.htm
by upghost 7mo ago
I'm surprised how hard I had to dig for an actual example of syntax[1], so here you go.
[1]: https://www.lix.polytechnique.fr/~dale/lProlog/proghol/extract.html#htoc51 https://www.lix.polytechnique.fr/~dale/lProlog/proghol/extra...
- Antibabelic 7mo agoThere is also an implementation of 99 Bottles of Beer on Rosetta Code: https://rosettacode.org/wiki/99_bottles_of_beer#Lambda_Prolog https://rosettacode.org/wiki/99_bottles_of_beer#Lambda_Prolo...
- neuroelectron 7mo agoSo brainfuck x lisp
- tmaly 7mo agoI have written stuff in Prolog, but I find this lambda Prolog syntax very difficult to grok.
- cpill 7mo agoChrist... it's incomprehensible... I guess that ones staying in academia :P
- cess11 7mo agoThere are some examples in this tutorial PDF: https://www.lix.polytechnique.fr/Labo/Dale.Miller/lProlog/felty-tutorial-lprolog97.pdf https://www.lix.polytechnique.fr/Labo/Dale.Miller/lProlog/fe...
- Twey 7mo agoConstantly amused by the split in comments of any moderately innovative language post between ‘I don't care about all this explanation, just show me the syntax!’ and ‘I don't understand any of this syntax, what a useless language!’ If the language is ‘JavaScript but with square brackets instead of braces’ maybe the syntax is relevant. But in general concrete syntax is the least interesting (not least important, but easiest to change) thing in a programming language, and its similarity to other languages a particular reader knows less interesting still. JavaScript is not the ultimate in programming language syntax (I hope!) so it's still worth experimenting, even if the results aren't immediately comprehensible without learning.
- upghost 7mo agoIn Prolog the syntax is incredibly important. It is designed to be metainterpreted with the same ease in which a for-loop might be written in another language. https://www.metalevel.at/acomip/ https://www.metalevel.at/acomip/ mi1(true). mi1((A,B)) :- mi1(A), mi1(B). mi1(Goal) :- Goal \= true, Goal \= (_,_), clause(Goal, Body), mi1(Body). This can be arbitrarily extended in very interesting, beautiful, and powerful ways. This is extraordinarily hard to achieve and did not happen by accident. As a challenge, see how easy it is to write a metainterpreter in another language of your choice. Alternately, see if you can think of any way the metainterpretation system in Prolog could be improved. Finally, think of what would happen to this if we changed the syntax and introduced something like object.field notation. So while logical programming can be achieved with other syntaxes, the metaintrepretive aspect will be lost. I have yet to see a language that does this better.
- Twey 7mo agoNice link, thank you! I'm not sure it's super related to my comment but it is closely related to some other things I'm thinking about. I'll give it a read :)