12 comments

  • naillang45 minutes ago
    The contextual reasoning angle is interesting. When designing effect systems for AI-native code, a core challenge is encoding &quot;what this function is allowed to do given its calling context&quot; -- classic first-order approaches force you to thread that context explicitly through every call site.<p>Higher-order hereditary Harrop formulas would express this more naturally: &quot;this predicate holds within this local context of assumptions&quot; without the boilerplate. The expert system example resonates beyond medicine. The same problem appears in AI agent orchestration: an agent needs to reason about which operations are permitted given its current session state, permission scope, and the calling chain. That&#x27;s deeply contextual reasoning, and it&#x27;s one reason I think λProlog is underexplored in agentic AI tooling.
  • boxfire4 hours ago
    I am a huge fan of the work towards putting this in kanren as λKanren:<p><a href="https:&#x2F;&#x2F;www.proquest.com&#x2F;openview&#x2F;2a5f2e00e8df7ea3f1fd3e86195aba6a&#x2F;1?pq-origsite=gscholar&amp;cbl=18750&amp;diss=y" rel="nofollow">https:&#x2F;&#x2F;www.proquest.com&#x2F;openview&#x2F;2a5f2e00e8df7ea3f1fd3e8619...</a><p>A few of my own experiments in this time with unification over the binders as variables themselves shows there’s almost always a post HM inference sitting there but likely not one that works in total generality.<p>To me that spot of trying to binding unification in higher order logic constraint equations is the most challenging and interesting problem since it’s almost always decidable or decidably undecidable in specific instances, but provably undecidable in general.<p>So what gives? Where is this boundary and does it give a clue to bigger gains in higher order unification? Is a more topological approach sitting just behind the veil for a much wider class of higher order inference?<p>And what of optimal sharing in the presence of backtracking? Lampings algorithm when the unification variables is in the binder has to have purely binding attached path contexts like closures. How does that get shared?<p>Fun to poke at, maybe just enough modern interest in logic programming to get there too…
  • abathologist1 hour ago
    I did a few days of AoC in 2020 in λProlog (as a non-expert in the language), using the Elpi implementation. It provides a decent source of relatively digestable toy examples: <a href="https:&#x2F;&#x2F;github.com&#x2F;shonfeder&#x2F;aoc-2020" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;shonfeder&#x2F;aoc-2020</a><p>(Caveat that I don&#x27;t claim to be a λProlog or expert.)<p>All examples showcase the typing discipline that is novel relative to Prolog, and towards day 10, use of the lambda binders, hereditary harrop formulas, and higher order niceness shows up.
  • llsf31 minutes ago
    Did some modest development on Lambda Prolog back in 1999. I still have a vivid memory of feeling my brain expanding :) like rewiring how I approach programming and opening up new territory in my brain.<p>It might sound weird and crazy, but it quite literally blew my mind at the time !
  • polairscience6 hours ago
    I think that might be my favorite department&#x2F;lab website I&#x27;ve ever come across. Really fun. Doesn&#x27;t at all align with the contemporary design status quo and it shows just how good a rich website can be on a large screen. Big fan.<p><a href="https:&#x2F;&#x2F;www.lix.polytechnique.fr&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.lix.polytechnique.fr&#x2F;</a>
  • upghost6 hours ago
    I&#x27;m surprised how hard I had to dig for an actual example of syntax[1], so here you go.<p>[1]: <a href="https:&#x2F;&#x2F;www.lix.polytechnique.fr&#x2F;~dale&#x2F;lProlog&#x2F;proghol&#x2F;extract.html#htoc51" rel="nofollow">https:&#x2F;&#x2F;www.lix.polytechnique.fr&#x2F;~dale&#x2F;lProlog&#x2F;proghol&#x2F;extra...</a>
    • Antibabelic6 hours ago
      There is also an implementation of 99 Bottles of Beer on Rosetta Code: <a href="https:&#x2F;&#x2F;rosettacode.org&#x2F;wiki&#x2F;99_bottles_of_beer#Lambda_Prolog" rel="nofollow">https:&#x2F;&#x2F;rosettacode.org&#x2F;wiki&#x2F;99_bottles_of_beer#Lambda_Prolo...</a>
    • tmaly3 hours ago
      I have written stuff in Prolog, but I find this lambda Prolog syntax very difficult to grok.
    • cess1138 minutes ago
      There are some examples in this tutorial PDF:<p><a href="https:&#x2F;&#x2F;www.lix.polytechnique.fr&#x2F;Labo&#x2F;Dale.Miller&#x2F;lProlog&#x2F;felty-tutorial-lprolog97.pdf" rel="nofollow">https:&#x2F;&#x2F;www.lix.polytechnique.fr&#x2F;Labo&#x2F;Dale.Miller&#x2F;lProlog&#x2F;fe...</a>
    • cpill43 minutes ago
      Christ... it&#x27;s incomprehensible... I guess that ones staying in academia :P
    • neuroelectron6 hours ago
      So brainfuck x lisp
  • Antibabelic6 hours ago
    There is a great overview of λProlog from 1988: <a href="https:&#x2F;&#x2F;repository.upenn.edu&#x2F;bitstreams&#x2F;e91f803b-8e75-4f3c-9bf5-10ce15fe8186&#x2F;download" rel="nofollow">https:&#x2F;&#x2F;repository.upenn.edu&#x2F;bitstreams&#x2F;e91f803b-8e75-4f3c-9...</a>
  • poppingtonic1 hour ago
    Learning how to implement Prolog in pg&#x27;s On Lisp was a fun way to spend multiple weeks programming. Doing this again this year should be a lot of fun.
  • TheRoque7 hours ago
    I remember learning it in univerisity. It&#x27;s a really weird language to reason with IMO. But really fun. However I&#x27;ve heard the performances are not that good if you wanna make e.g. game AIs with it.
    • pjmlp6 hours ago
      First of all, it helps to actually use a proper compiled Prolog implementation like SWI Prolog.<p>Second you really need to understand and fine tune cuts, and other search optimization primitives.<p>Finally in what concerns Game AIs, it is a mixture of algorithms and heuristics, a single paradigm language (first order logic) like Prolog, can&#x27;t be a tool for all nails.
    • tannhaeuser2 hours ago
      The term &quot;AI&quot; has changed in recent years but if you mean classic game logic such as complex rules and combinatorial opponents then there&#x27;s plenty of Prolog game code on github eg. for Poker and other card or board games. Prolog is also as natural a choice for adventure puzzles as it gets with repository items and complicated conditions to advance the game. In fact, Amzi! Prolog uses adventure game coding as a topic for its classic (1980s) introductory Prolog learning book Adventure in Prolog ([1]). Based on a cursory look, most code in that book should run just fine on a modern ISO Prolog engine ([2]) in your browser.<p>[1]: <a href="https:&#x2F;&#x2F;www.amzi.com&#x2F;AdventureInProlog&#x2F;advtop.php" rel="nofollow">https:&#x2F;&#x2F;www.amzi.com&#x2F;AdventureInProlog&#x2F;advtop.php</a><p>[2]: <a href="https:&#x2F;&#x2F;quantumprolog.sgml.net" rel="nofollow">https:&#x2F;&#x2F;quantumprolog.sgml.net</a>
    • laksjhdlka6 hours ago
      With λProlog in particular I think it probably finds most of its use in specifying and reasoning about systems&#x2F;languages&#x2F;logics, e.g. with Abella. I don&#x27;t think many people are running it in production as an implementation language.
      • OneDeuxTriSeiGo4 hours ago
        Yeah the main use of it is probably in ELPI which is a higher order structural reasoning and AST transform tool for Coq&#x2F;Rocq.
    • dyingkneepad2 hours ago
      I also learned Prolog in the university.<p>In the Classsic AI course we had to implement gaming AI algorithms (A*, alpha-beta pruning, etc) and in Prolog for one specific assignment. After trying for a while, I got frustrated and asked the teacher if I could do it in Ruby instead. He agreed: he was the kind of person who just couldn&#x27;t say no, he was too nice for his own good. I still feel bad about it.<p>Rest In Peace, Alexandre.
      • iberator27 minutes ago
        How is this fair to others?!
    • ux2664785 hours ago
      &gt; It&#x27;s a really weird language to reason with IMO<p>I know you likely mean regular Prolog, but that&#x27;s actually fairly easy and intuitive to reason with (code dependent). Lambda Prolog is much, much harder to reason about IMO and there&#x27;s a certain intractability to it because of just how complex the language is.
      • cubefox2 hours ago
        What would be some applications it handles better than regular Prolog? Something that naturally requires second or higher order logic rather first order logic?
        • ux2664781 hour ago
          Lambda Prolog isn&#x27;t a &quot;pure&quot; HOL. It&#x27;s a very restricted form of HOL using Higher-Order Hereditary Herrop formulas, granting us pretty solid generalized mechanisms of implication and universal quantification, which itself more or less means we get contextual reasoning and scoping rules baked into the grammar for free.<p>Implementing other programming languages and proving theorems are the low-hanging fruits since you get variable binding without name management, but I genuinely think it has profound implications for expert systems since it essentially removes a massive amount of complexity from contextual reasoning. Being able to account for patient history when providing a diagnosis, for example.
    • anonzzzies6 hours ago
      λProlog or Prolog? Probably Prolog I guess?
      • TheRoque4 hours ago
        My bad. Was regular prolog yeah
      • wbolt6 hours ago
        No. It is actually λProlog which seems to be an extension of Prolog.
        • anonzzzies5 hours ago
          I was responding to @TheRoque GP; I know λProlog quite well and I would be pleasantly surprised if they saw that in university, but I think they got taught Prolog. If you mean to say that they saw Lambda Prolog and it is therefor a lot more popular than I believed it to be, then excellent and ignore this reply.
        • ux2664785 hours ago
          Not at all, it&#x27;s a completely different language with a very different computational foundation. It&#x27;s an SML-Haskell type situation.
  • big-chungus43 hours ago
    when I downloaded the example programs, they open up in my music player but don&#x27;t play anything
    • dyingkneepad2 hours ago
      As usual, try mplayer. It can play anything.
  • big-chungus43 hours ago
    (1987)
  • yodsanklai6 hours ago
    I&#x27;m curious to see how AI is going to reshape research in programming languages. Statically typed languages with expressive type systems should be even more relevant for instance.
    • acjohnson555 hours ago
      Why do you think that?
      • yodsanklai4 hours ago
        Because the type system gives you correctness properties, and gives fast feedback to the coding agent. Much faster to type check the code than let say write and run unit tests.<p>One possible disadvantage of static types is that it can make the code more verbose, but agents really don&#x27;t care, quite the opposite.
        • butokai3 hours ago
          Funnily enough, when programming with agents in statically typed languages I always find myself in need of reminding the agent to check for type errors from the LSP. Seems like it&#x27;s something they&#x27;re not so fond of.