Show HN: Vibe Prolog

github.com

44 points by nl 6 days ago

Like a lot of people I got the $250 Claude Code credit and didn't use it up.

I decided to try to use it up over the weekend using (mostly) my phone and vibe coded a Prolog interpreter.

Now I'm seeing how far I can push it.

AdieuToLogic 3 days ago

Here's an idea.

There have been over a dozen commits in the last 2 hours. If you are actually "vibe coding" a Prolog, then post the prompts you have used in the last 2 hours here.

If it helps to have a specific starting point, commit 7bbe652[0] is as good as any.

0 - https://github.com/nlothian/Vibe-Prolog/commit/7bbe652eaf0b0...

  • nl 4 hours ago

    Wait, you think I'm coding this by hand! That is amazing. I love it!

    I don't remember when which part happened, but I've been gradually moving over to the tools in https://github.com/nlothian/Vibe-Prolog/tree/main/ai-tools for most of the development. Most of the coding itself there is done with kilocode.

    Most of the early conversations don't seem to be available in Claude code now (is there a way to see complete history?), but here's a typical session:

    > can this interpreter pass command line arguments to the prolog program?

    [no]

    > add these as missing to @FEATURES.md

    [done]

    > use `gh issue` to create an issue to address this.

    > - Explain comprehensively what needs to be done > - Note that new test cases must be created > - Note that @FEATURES.md needs updating

    > Do not provide estimates

    That raised: https://github.com/nlothian/Vibe-Prolog/issues/75

    Here's the PR for that: https://github.com/nlothian/Vibe-Prolog/pull/92/files

    That PR was generated using my fix-issue-with-kilocode command. The source code for that is all in here: https://github.com/nlothian/Vibe-Prolog/tree/main/ai-tools.

    The code reviews were done with Codex and Gemini, and responded to using my address_pr_comments command in that same directory.

andai 4 days ago

What are the odds :) I made this two weeks ago, also with Claude.

This one's a straight port, paip-python's[0] Prolog interpreter. (Itself based on Norvig's Paradigms of Artificial Intelligence Programming book, originally in Lisp.)[1]

https://github.com/a-n-d-a-i/prolog.js

It was in the web ui, so I expected it to give me a code block, but it spun up a vm, set up a npm project, generated tests... ran them. I was quite surprised.

Your version is the opposite of mine, in a very good way. Your one is mostly tests! My version's tests are... well, you'll see ;)

Both are surprisingly short. 700-ish for mine, ~1200-ish for yours (as far as the actual interpreter goes), right?

That seems like a lot of bang per buck for something as powerful as a Prolog interpreter! I don't know very much about Prolog though, so maybe there's a lot of crucial parts missing here.

At any rate the original is a teaching device, and the book[1] goes into some length on the limitations of Prolog, both this version and in general.

[0] Original source in Python: https://github.com/dhconnelly/paip-python

[1] Original original source in Lisp: https://norvig.github.io/paip-lisp/#/chapter11

forgotpwd16 6 days ago

If the project is about testing Claude's capabilities, the prompts will be more interesting to have.

  • nl 6 days ago

    It's not like it's a single shot generation or anything.

    • AdieuToLogic 4 days ago

      >> If the project is about testing Claude's capabilities, the prompts will be more interesting to have.

      > It's not like it's a single shot generation or anything.

      Since you've submitted a "Show HN: Vibe Prolog" and shared in the repo:

        I was working on something else and as a side effect 
        accidently vibe coded a prolog interpretor on my phone over 
        the weekend.
      
      The GP's observation of the prompts being highly relevant is substantiated. Arguably even more so than the Python code committed.

      Especially since there have been 82 commits in the span of 3 days.

      EDIT:

      And I am really interested in how you "vibe coded" the commit[0] which made this singular change:

         - uv run pytest tests/ttest_additional_builtins.py -v
         + uv run pytest tests/test_additional_builtins.py -v
      
      
      0 - https://github.com/nlothian/Vibe-Prolog/commit/0bf4beba70dea...
      • nl 5 hours ago

        Yeah I think I modified the Github action though the web interface for that or something? I don't recall.

        I don't think this is a violation of my (self-imposed) rules - it's supporting config, not code.

      • johnisgood 3 days ago

        I do not think that [0] was vibe coded. Vibe coding something does not mean that everything is vibe coded, or at least I would have never expected it to be the case.

        • AdieuToLogic 2 days ago

          > I do not think that [0] was vibe coded. Vibe coding something does not mean that everything is vibe coded ...

          The author claims in the project README.md[0]:

            I was working on something else and as a side effect 
            accidently vibe coded a prolog interpretor on my phone over 
            the weekend.
          
          And has yet to show any evidence of "vibe coding", to the point where I chose one of many commits challenging this position.

          So there are two reasonable explanations:

            A) There is no way to show prompts used when "vibe coding".
            B) This claim of "vibe coding" a Prolog is disingenuous.
          
          Which do you think is the case?

          0 - https://github.com/nlothian/Vibe-Prolog

          • johnisgood a day ago

            README.md is definitely an output of an LLM.

            As for the rest of the code, it could be. Are there any obvious patterns you have found to be LLM generated?

            In any case, my point is that a typo probably does not have to use LLM to fix that single typo.

            So you can use LLMs but it is probably not used for everything, for example this typo.

tmaly 6 days ago

Have you considered asking for a version in assembly?

  • nl 6 days ago

    Not really. Do you mean targetting assembly output or written in assembly?