Programming PLCs sometimes feels like going to, say, Australia or New Zealand, and being immersed in an environment which went down a different evolutionary tree very on in its development.
For the signal transformation ones, there are also the hardware definition languages on the same category as LabView and animation languages.
I can't really attest to whether that's a better choice for learning logic programming, though. It's easier to "run programs" in Prolog. SQL wants to be a cog in a machine where Prolog is more freestanding.
I would absolutely love to take a set of logic/set-oriented problems and solve them both in Prolog and SQL, just to see which ones are ergonomic in each language. Maybe this summer at the cabin...
https://technology.amis.nl/it/solving-a-sudoku-with-one-sql-...
SQL and Prolog are both relational. That's very unique to both. But SQL is all about querying databases. Prolog can also be used and understood as a database querying language but it's also very strong for
- parsers
- interpreters
- expert systems
- solving combinatorial problems
If you really want to you can probably use SQL for that too. Or any language for that matter. But going out and learning SQL won't naturally expose you to these applications and how well the logic paradigm lends itself to them.
Recursive common table expressions are part of the SQL standard (since 1999) and are quite frequently used to traverse hierarchical data (aka "adjacency list").
It is part of basically all (good) SQL tutorials - at least in the "advanced" part.
WITH RECURSIVE thread(id, parent_id, user_id, post_id, timestamp, text, depth) AS (
SELECT id, parent_id, user_id, post_id, timestamp, text, 0
FROM comments
WHERE user_id = 1
AND parent_id IS NULL
UNION ALL
SELECT c.id, c.parent_id, c.user_id, c.post_id, c.timestamp, c.text, t.depth + 1
FROM comments c
JOIN thread t ON c.parent_id = t.id
WHERE c.user_id != t.user_id
)
SELECT * FROM thread ORDER BY timestamp ASC;They do come up!
But lacking those general features makes it an even purer "learning example" of the group.
And, not to put too fine a point on it, being extremely proficient will give you a massive competitive edge in the industry.
This is one of those things that seems to keep coming back - recently in the Ruby world with Cucumber.
COMPUTER, SELECT COURSE WHERE MINIMAL PROBABILITY OF KLINGON ENCOUNTERThere have been very few non-English programming languages. There was a French version of COBOL once. I'm surprised that something hasn't come out of China. There's a Chinese dialect of Python. Does anyone use that?
Way to age yourself old man.
I would maybe add SQL as an ur-language as well. It's not quite general purpose like most of these, but it should have a place in this list, I think. It has some kinship with Prolog and the declarative style, but it's really it's own thing.
You could also maybe argue for something like LabView. Many programmers look down on purely graphical programming languages, but with Houdini, Unreal's Blueprints and the various node-based shader/material systems in gamedev, I think it probably deserves it's own little branch of this family tree.