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.
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
An easy way to find out if your implementation works is to try out the `likes.pl`[1] example found in the SWI-Prolog "Getting started quickly"[0] documentation.
0 - https://www.swi-prolog.org/pldoc/man?section=quickstart
1 - https://raw.githubusercontent.com/SWI-Prolog/swipl-devel/mas...
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...
> 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...