2

A bit of background (in case I'm mistaken)...

I think I understand that (it's an oversimplification):

  • manually entering codes into memory (or on a punchcard) is "first generation language"
  • using mnemonics corresponding to CPU instructions would be a 2GL (like assembly language)
  • C/C#/Java/Objective-C are all 3GLs
  • SQL is a 4GL

Where would Clojure stand in such a classification?

I'm particularly confused by this Wikipedia sentence:

The archetypical example of a declarative language is the fourth generation language SQL, as well as the family of functional languages and logic programming.

This sentence seems to imply that all functional languages are declarative. Is that correct?

Then Clojure can be used in a functional way (and it is probably recommended to use it "as much as possible" in a FP style), so is Clojure a declarative language ?

Also, I can see that Clojure make it really easy to create 4GLs (e.g. as embedded DSLs, like core.logic reproducing logic programming in about 200 lines of code) but is Clojure itself a 4GL?

6
  • 2
    "as well as" does not imply "is the same as" - it means the opposite..
    – Izkata
    Commented Jan 13, 2013 at 0:07
  • 1
    @Izkata: but it can mean both depending on the sentence, right? Reading the Wikipedia in more details, I find this "Functional programming is a subset of declarative programming"... So I think my interpretation of the sentence is correct. I'm still confused as how to classify Clojure regarding 1GL, 2GL, 3GL and 4GL. Commented Jan 13, 2013 at 0:25
  • 1
    Also, downvote without explanation... :-/ Commented Jan 13, 2013 at 0:27
  • 10
    imho the whole 3GL/4GL question is obsolete terminology, I don't feel that those terms have been in serious currency since before the turn of the century. But certainly there is nothing about Clojure which would make me consider calling it anything other than a 3GL, thinking back to how we used those terms in the 90s. Commented Jan 13, 2013 at 0:49
  • 1
    @Carson63000: Quite interestingly I just read an article that got published two days ago (i.e. 22 january 2013) by Neal Ford, in which he talks specifically about 4GLs. So even if the term is "obsolete", it's still useful to understand where we're coming from and... To read blog entries by great authors: nealford.com/memeagora/2013/01/22/… : ) Commented Jan 23, 2013 at 23:24

1 Answer 1

8

Clojure is a 3GL

First, some definitions for the avoidance of doubt.

A first generation language (1GL) is a machine level programming language. No automated translation is in place so programming is through a bank of switches on the front panel.

A second generation language (2GL) is a categorization of assembly languages. This normally targets specific chipsets and allows for source code to be used.

A third generation language (3GL) is a refinement of a 2GL and are termed "High level languages". This introduces logical structure to source code and makes the language more programmer-friendly. Examples include C/C++/C#/Java etc. They usually have an interpreter or compiler.

A fourth generation language (4GL) was in favour between 1970-1990 and is commonly understood to be a programming environment. This tends to be read as a collection of applications that support the creation of 3GL source code. Often this is a visual workbench environment such as an IDE, or perhaps a table-driven system configuration environment (Oracle middleware for example). There is also the possiblility that a 4GL could be considered a domain specific language (DSL).

In light of the above definition, Clojure would appear to fit much more closely within the frame of a 3GL since it is only the rather loose domain specific language interpretation that would lift it to a 4GL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.