Hacker Newsnew | past | comments | ask | show | jobs | submit | davidgay's commentslogin

> In my experience, when one begins to program in Prolog, they pepper their code with cuts to try and stop unwanted bactracking, which can often be avoided by understanding why Prolog is backtracking in the first place.

This gets to the heart of my problem with Prolog: it's sold as if it's logic programming - just write your first-order predicate logic and we'll solve it. But then to actually use it you have to understand how it's executed - "understanding why Prolog is backtracking in the first place".

At that point, I would just prefer a regular imperative programming language, where understanding how it's executed is really straightforward, combined with some nice unification library and maybe a backtracking library that I can use explicitly when they are the appropriate tools.


> This gets to the heart of my problem with Prolog: it's sold as if it's logic programming - just write your first-order predicate logic and we'll solve it. But then to actually use it you have to understand how it's executed

Prolog is a logic-flavored programming language. I don't recall Prolog ever being "sold" as pure logic. More likely, an uninformed person simply assumed that Prolog used pure logic.

Complaining that Prolog logic doesn't match mathematical logic is like complaining that C++ objects don't accurately model real-life objects.


    I don't recall Prolog ever being "sold" as pure logic.
One of the guides linked above describes it as:

    The core of Prolog is restricted to a Turing complete subset of first-order predicate logic called Horn clauses

> The core of Prolog is restricted to a Turing complete subset of first-order predicate logic called Horn clauses

Does this sound to you like an attempt to deceive the reader into believing, as the GP comment stated, that the user can

> just write your first-order predicate logic and we'll solve it.


It absolutely does sound like "write your first order logic in this subset and we'll solve it". There's no reasonable expectation that it's going to do the impossible like solve decideability for first order logic.

> It absolutely does sound like "write your first order logic in this subset and we'll solve it".

No it does not. Please read the words that you are citing, not the words that you imagine. I honestly can't tell if you are unable to parse that sentence or if you a cynically lying about your interpretation in order to "win" an internet argument.

All programming languages are restricted, at least, to a "Turing complete subset of first-order predicate logic." There is absolutely no implication or suggestion of automatically solving any, much less most, first order logic queries.


Except it cannot decide all Horn clauses.

>> This gets to the heart of my problem with Prolog: it's sold as if it's logic programming - just write your first-order predicate logic and we'll solve it. But then to actually use it you have to understand how it's executed - "understanding why Prolog is backtracking in the first place".

Prolog isn't "sold" as a logic programming language. It is a logic programming language. Like, what else is it?

I have to be honest and say I've heard this criticism before and it's just letting the perfect be the enemy of the good. The criticism is really that Prolog is not a 100% purely declarative language with 100% the same syntax and semantics as First Order Logic.

Well, it isn't, but if it was, it would be unusable. That would make the critics very happy, or at least the kind of critics that don't want anyone else to have cool stuff, but in the current timeline we just have a programming language that defines the logic programming paradigm, so it makes no sense to say it isn't a logic programming language.

Edit:

>> At that point, I would just prefer a regular imperative programming language, where understanding how it's executed is really straightforward, combined with some nice unification library and maybe a backtracking library that I can use explicitly when they are the appropriate tools.

Yeah, see what I mean? Let's just use Python, or Java, or C++ instead, which has 0% of FOL syntax and semantics and is 0% declarative (or maybe 10% in the case of C++ templates). Because we can't make do with 99% logic-based and declarative, gosh no. Better have no alternative than have a less than absolutely idealised perfect ivory tower alternative.

Btw, Prolog's value is its SLD-Resolution based interpretation. Backtracking is an implementation detail. If you need backtracking use yield or whatever other keyword your favourite imperative language gives you. As to unification, good luck with a "nice unification library" for other languages. Most programmers can't even get their head around regexes. And good luck convincing functional programmers that "two-way pattern matching" (i.e. unification) is less deadly than the Bubonic Plague.


> renewal mechanisms

Conveniently, for individual sports like tennis there's a guaranteed renewal mechanism - the near-term likelihood of 50 year old tennis champions is low, and that of 80 year old champions is not really worth discussing.


And then there's Bulgarian, with no cases and definite articles, to throw that scale off...


> Quite the opposite. The benefits of rent control grow the longer you are in the same apartment without moving as the difference between what the tenant pays and the

You're assuming a form of rent control where new tenants pay market rate. That's not the only form, e.g., Berkeley's rent control used to continue "forever", until California forbade that (Costa Hawkins act in 1995).


The GRE vocabulary is actually based on French, Latin and Greek, not English. Much less rare and unusual once you realise that.


This is 100% incorrect as you’ve written it. The GRE is based on English vocabulary. It’s true that many words have Greek, Latin, or French roots but they are most certainly not Latin, Greek, or French.


He doesn't say the GRE is based on Latin etc. He says the GRE vocabulary is based on Latin etc. To me that sounds similar to what you're saying.


> Rent control in particular is an economic basket case policy

Switzerland has had rent control for a long time, and seems to have (rather successfully) avoided this economic basket case fate.


> > History shows people are also very resilient at moving on from trauma

> i’m extremely skeptical that people move on

Historically, essentially everyone who lived long enough to have children had some of those children die [1]. So either:

- that wasn't traumatic

- they managed to deal with that trauma

- or they didn't move on, and everyone was somewhat traumatised

You can take your choice from the above, but on the whole this was the normal state of affairs for most of human history and prehistory.

[1]: from https://acoup.blog/2025/07/18/collections-life-work-death-an..., 50% of children died by age ~5


IMHO the death of a child was rarely traumatizing. Intense grief and trauma are different things.

Warfare however was more common or at least more unavoidable than it is now, and would have been a potent source of traumatic experiences.

Ditto attacks by wild animals.


Grieving heals trauma. Death of a child is traumatic but we allow room for this in society. We provide instinctive support to others going through this.

Death in general is an inevitable part of life that can be dealt with in a healthy way. It's still individual but generally there are outlets.

Traumatic disorders are specifically where the symptoms caused by trauma interfere with daily life and are measured in severity and longevity.

We should actively grieve traumatic experiences by paying attention to them where necessary.


When an animal is attacked, e.g., by a lion, it will sometimes completely freeze (which often causes the predator to lose interest). Many different species and families of animals do this, but according to Peter Levine writing a few decades ago, in no species except human is there any evidence that having undergone this freezing response has long-term consequences. There seems to be something about the human mind (or the human lifestyle in modern times) that makes the freezing response tend to have very persistent effects.

I would like to call this freezing response psychological trauma. I think many experts use the phrase that way. Certainly the OP is using the term this way. But if people are going to use "traumatic experience" to refer to any very aversive experience or any experience that makes the person very sad, like you just did, then that is kind of a drag because most very aversive experiences, e.g., death of one's child, do not cause the freezing response or do so only rarely. Must those of us who wish to discuss the human version of this freezing response come up with a different term?


I mean, most of human history sucked major ass and people were drinking themselves to death.


This is a big point that really blows my mind in the discussion. It is basically indisputable that we are exposed to less trauma than people in the past. To a laughable degree.

And it wasn't just children. Before the advent of antiseptics, a prick from a briar could basically kill you. Before modern supply chains, you almost certainly had parasites. Before modern vaccines... The list is remarkably large.

I suppose there is an argument that it is the reduction of traumatic events that makes them more traumatic? Feels like a shaky reason to think "focus more and make sure you fully grappled with how traumatic it was" is the default correct approach.


I think it’s exactly why we can now look at and face trauma because some of us are not as severely traumatized and in denial like previous generations. We can decide to work on it, rather than just passing it on by mistreating those around us and redirecting our rage towards imagined enemies and threats. Well, some us.


But not everyone reacted to trauma by going into denial? Some people had really crappy things happen to them. They did not deny this, necessarily. They just found a way to move to the next things.

And note, that it wasn't everyone. Some people did not find a way to move on. Worse, some people likely perpetuated their trauma on to others.


"Denial" typically refers not to the denial that something bad happened to you, but to not see how you act it out on others (or yourself). It is exactly those in denial that would claim that they "have moved on", and try hard to make it look like they did also to those around them. It then shows up in violent tendencies, lashing out against kids, enemy images, patterns of avoidance, psychosomatic symptoms, burnout, addictions, obesity, sports injuries due to overdoing it, inability to sit still and listen, etc. - not necessarily PTSD symptoms.


> It is basically indisputable that we are exposed to less trauma than people in the past. To a laughable degree.

And standards of living and life expediencies have gone up and to the right.

That 100 years ago people managed to cope with the traumatics of daily life doesn't translate to their coping being healthy or their lives being better (consider the massive drinking culture of the mid 1800s that ultimately led to prohibition)


True that standards of living have gone up. I'm... not clear where you were going with this, though?

You are using the word "cope" in a way that implies people did not grow after their trauma in the past. I do think I've been sloppy and said grown from trauma a few times. I meant that to be a time marker, not a cause of growth.

Do I think some people did not manage healthy growth after some events? Absolutely! But I also think many people did find ways to continue to grow.


I think, in the past, yes - most people did not grow, they just coped. They merely distracted themselves with working 12 hour days, drinking their lives away, and beating their wife and children.

Think about it this way - how many passion projects did people have back then? When they weren't working, what were they doing?


I'd write code after work if I wasn't writing code at work ;) But...


> ... memory and cpu performance have improved at completely different rates.

This is overly simplified. To a first approximation, bandwidth has kept track with CPU performance, and main memory latency is basically unchanged. My 1985 Amiga had 125ns main-memory latency, though the processor itself saw 250ns latency - current main memory latencies are in the 50-100ns range. Caches are what 'fix' this discrepancy.

You would need to clarify how manual memory management relates to this... (cache placement/control? copying GCs causing caching issues? something else?)


The quote is referring to fights between people who already have tenure.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: