Re: [GENERAL] Imperative Query Languages - Mailing list pgsql-general

From Merlin Moncure
Subject Re: [GENERAL] Imperative Query Languages
Date
Msg-id CAHyXU0wPPgYTWBvbeD4FCdyPtQeUnidfV1Nm4sb2fbnhp=GmdQ@mail.gmail.com
Whole thread Raw
In response to [GENERAL] Imperative Query Languages  (Jason Dusek <jason.dusek@gmail.com>)
Responses Re: [GENERAL] Imperative Query Languages
List pgsql-general
On Wed, Jul 5, 2017 at 12:22 AM, Jason Dusek <jason.dusek@gmail.com> wrote:
> Hi All,
>
> This more of a general interest than specifically Postgres question. Are
> there any “semi-imperative” query languages that have been tried in the
> past? I’m imagining a language where something like this:

huh.  Somewhat snarky answer, all of them? :-).  Most languages are
imperative including just about all the ones that are popular in "the
enterprise" (minus SQL).   You can for example code that looks
remarkably like that in pl/pgsql.  Since postgres is a SQL server, it
would have to get compiled down to boring SQL statements but it's
generally understood (at least by me) that this is an inefficient way
to write code.

Downthread, Tom mentions CODASYL, etc, but could have mentioned the
big daddy, ISAM, and all it's various flavors.  Virtually all business
code was written using it (and much of it still is) leading into the
SQL era.   Code generally looked exactly like your example, except it
was much more stupid looking being written in (generally) COBOL, and
added in error handling, which is where the technique tends to break
down.  SQL came about because some particularly smart people realized
that programmers were writing the same boiler plate code over and over
again and that perhaps access to data could be generalized and focused
down to the real problem being solved.   This fortunately came about
before "enterprise developers" and "enterprise tool vendors" were as
organized as they are today and so was able to germinate into
something incredibly useful...

This revolution in programming was IMNSHO the single greatest
innovation in computer science; so much so that legions of the
unenlightened have been tirelessly working (hibernate) to eliminate or
displace its benefits, without much success:
http://www.codingdojo.com/blog/9-most-in-demand-programming-languages-of-2016/

:-D

merlin


pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [GENERAL] pg_start/stop_backup non-exclusive scripts to snapshot
Next
From: Chris Travers
Date:
Subject: Re: [GENERAL] Strange case of database bloat