Re:We need less powerful languages
by icebraining on Saturday November 14, 2015 @06:35PM
(#10567782)
SQL is actually Turing-complete; using recursive CTEs, you can build a cyclic tag system, which has been proven to be Turing-complete.
[ Parent
| on HN ]
Yeah the reason there aren't many sub-turing-complete languages is because it's actually really hard to prevent turing completeness.
SQL in its original incarnations is not Turing complete. It's mainly the bastardized, enterprised, heavily-extended versions built by people who have to sell it that are Turing complete.
Re:We need less powerful languages
by colanderman on Saturday November 14, 2015 @08:16PM
(#10568083)
To be fair, recursive CTEs are somewhat a blessing when you need to compute transitive closures. It is just unfortunate that they were designed as generative constructs (= you can create and recur on rows out of thin air rather than only products of other finite relations).
Re:We need less powerful languages
by colanderman on Saturday November 14, 2015 @08:07PM
(#10568063)
You are very correct. I think there is still much to gain even from Turing-complete languages, where the Turing-completeness is relegated to one particular rarely needed construct. Beside the rest of the language being completely analyzable, that one piece that isn't easily stands out as a code smell.
Recursive CTE's aren't universally present in SQL engines (e.g. MySQL doesn't have them)
Re:We need less powerful languages
by bordercases on Saturday November 14, 2015 @07:39PM
(#10567960)
Turing-hard then?