Live data from Hacker News

Learn Prolog Now (2006)

lpn.swi-prolog.org

141–150 of 251 posts

Re: Learn Prolog Now (2006)

#141

I recently asked @grok about Prolog being useless incomprehensible shit for anything bigger than one page: Professionals write Prolog by focusing on the predicates and relations and leaving the execution flow to the interpreter. They also use the Constraint Logic Programming extensions (like clpfd) which use smart, external algorithms to solve problems instead of relying on Prolog's relatively "dumb" brute-force sear…

How many times are you going to "write" the same comment in one discussion?

Re: Learn Prolog Now (2006)

#142

Earlier quoted context omitted.

Right, Python is usually the second-best choice for a language for any problem --- arguably the one thing it is best at is learning to program (in Python) --- it wins based on ease-of-learning/familiarity/widespread usage/library availability.

I don't know if I would say its second-best. It just happened to get really popular because it has relatively easy syntax, and Numpy is a really great library making all of those scientific packages that people were using Fortran and C++ for before available in an easier language. This boosted the language, right when data science became a thing, right when dynamic programming became popular, right when there was a b…

That's not why Python is popular. Python is popular because universities don't provide technical support to researchers (which they should). So those researchers picked up the scripting language the sysops in the univ clusters were using. Those same researchers left academia but never learned any CS or other programming languages. Instead they used the 'if all you have is a hammer, everything is a nail' logic and used Python to glue together libraries, mostly written in C.

PS The big companies that actually make the LLMs, don't use Python (anymore). Its a lousy language for ML/AI. Its designed to script Linux GUIs and automate tasks. Its started off as a Perl replacement afterall. And this isn't a slight on the folks who write Python itself. It is a problem for all the folks who insist on slamming it into all sorts of places that it isn't well suited because they won't learn any CS.

Re: Learn Prolog Now (2006)

#143
post #85

Earlier quoted context omitted.

human brains are insanely powerful pattern matching and shortcut-taking machines. There's very little brute forcing going on.

Your second sentence contradicts your first.

Pray tell how it contradicts the first.

Just note: human pattern matching is not Haskell/Erlang/ML pattern matching. It doesn't go [1] through all possible matches of every possible combination of all available criteria

[1] If it does, it's the most powerful computing device imaginable.

Re: Learn Prolog Now (2006)

#144

I've recently started modeling some of my domains/potential code designs in Prolog. I'm not that advanced. I don't really know Prolog that well. But even just using a couple basic prolog patterns to implement a working spec in the 'prolog way' is *unbelievably* useful for shipping really clean code designs to replace hoary old chestnut code. (prolog -> ruby)

I wonder if there's examples of whole product architectures done in Prolog, seems like an elegant solution if done right. I've been looking for a concise way to model full architectures of my various projects, without relying on having a typical markdown file.

Which is separate from the actual types in the code.

Which is separate from the deployment section of the docs.

Re: Learn Prolog Now (2006)

#145

I remember writing a Prolog(ish) interpreter in Common Lisp in an 90's AI course in grad school for Theorem proving (which is essentially what Prolog is doing under the hood). Really foundational to my understanding of how declarative programming works. In an ideal world I would still be programming in Lisp and using Prolog tools.

> In an ideal world… I see this sentiment a lot lately. A sense of missed nostalgia. What happened? In 20 years, will people reminisce about JavaScript frameworks and reminisce how this was an ideal world??

It is not nostalgia. It is mathematical thought. It is more akin to to an equation and more provably correct. Closer to fundamental truth -- like touching fundamental reality.

Re: Learn Prolog Now (2006)

#146

What kind of problems is Prolog helping to solve besides GOFAI, theorem proving and computational linguistics?

Prolog's constraint solving and unification are exactly what is required for solving type-checking constraints in a Hindley-Milner type system.

Yes, absolutely...I just wish the people who wrote FP compilers knew this.

Re: Learn Prolog Now (2006)

#148

Earlier quoted context omitted.

> "4. Prolog is good at solving reasoning problems." Plain Prolog's way of solving reasoning problems is effectively: for person in [martha, brian, sarah, tyrone]: if timmy.parent == person: print "solved!" You hard code some options, write a logical condition with placeholders, and Prolog brute-forces every option in every placeholder. It doesn't do reasoning . Arguably it lets a human express reasoning problems bet…

Its a Horn clause resolver...that's exactly the kind of reasoning that LLMs are bad at. I have no idea how to graft Prolog to an LLM but if you can graft any programming language to it, you can graft Prolog more easily. Also, that you push Python and JavaScript makes me think you don't know many languages. Those are terrible languages to try to graft to anything. Just because you only know those 2 languages doesn't m…

We would begin by having a Prolog server of some kind (I have no idea if Prolog is parallelized but it should very well be if we're dealing with Horn Clauses).

There would be MCP bindings to said server, which would be accessible upon request. The LLM would provide a message, it could even formulate Prolog statements per a structured prompt, and then await the result, and then continue.

Re: Learn Prolog Now (2006)

#149
post #73

Hah. Found this book back at my dad's this past winter: https://imgur.com/a/CyG1E2P Had never heard of it before, and this is first I'm hearing of it since. Also had other cool old shit, like CIB copies of Borland Turbo Pascal 6.0, old Maxis games, Windows 3.1

Clocksin is the standard Prolog textbook used in universities. I studied from the 5th edition.

Re: Learn Prolog Now (2006)

#150
post #62

Earlier quoted context omitted.

What makes you think your brain isn't also brute forcing potential solutions subconciously and only surfacing the useful results?

Because I can solve problems that would take the age of the universe to brute force, without waiting the age of the universe. So can you: start counting at 1, increment the counter up to 10^8000, then print the counter value. Prolog: 1, 2, 3, 4, 5 ... You and me instantly: 10^8000

There's a whole lot of undecidable (or effectively undecidable) edge cases that can be adequately covered. As a matter of fact, Decidability Logic is compatible with Prolog.
Post reply on HN