Better HN
topnewbestaskshowjobs
Log inSign up

chrisworden

3 karma · joined Apr 27, 2011 (15y ago) · 3 submissions

Submissions

comment 3y ago · link · parent

There is at least one language that does this as a form of its core mechanism of execution- Mercury Language, a declarative/logic programming language.

Its type system is fairly complex. To accomplish the goal you describe, functions must be declared as deterministic, non-deterministic, or multi-deterministic. Meaning, they always have a solution, sometimes have a solution, or multiple solutions for the same input.

Armed with that information, the compiler will throw an error if you haven't thought of all possibilities in your logic flow. The fact that the type system required you to be very descriptive in many different ways compounded the number of bugs that the compiler would catch before your program ever runs... I think someone said "if you can get your code past the compiler, it will work on the first try."

I wish Mercury were more popular, it's an awesome project!

comment 4y ago · link · parent

I think it's more interesting that this poorly-worded "riddle" managed to find its way onto wikipedia:

A section titled "The Language Paradox" was removed on October 2:

> Careful wording must be used to ensure that the "paradox" is correct.

With the explanation: "This is 100% original research, which as noted contains errors"

So the only thing that makes the "paradox" interesting is that it's badly worded, but any commentary to that effect is original research, so in the end we're just left with a fairly unremarkable riddle on Wikipedia and grumpy people like myself complaining about it.

comment 10y ago · link · parent

I once overheard: "Not sure if you want to take your own life? Call the police and they'll help that right along."