37

As it is often classified at school/college level, popular programming languages (C#, Java, C++) are all 3rd generation languages (with higher level of abstraction from the machine's physical parts). Also, assembly languages are classified as 2nd and machine languages as 1st generation languages.

Initially I was thinking SQL should be considered 4th generation language cause it is more abstract and far away from details of looping and more descriptive.

Just now I found out there are 4th generation and 5th generation languages, but what is the basis for any programming language or technology to be categorized as a 4th or 5th generation language?

Also, are there 6th or 7th generation languages as well?

Ali
  • 1,222
  • 2
  • 13
  • 27
  • 21
    http://en.wikipedia.org/wiki/Programming_language_generations – Robbie Dee Jan 05 '15 at 12:42
  • 12
    Oh, if only people could agree on what makes an nth Gen language that n... There is no criteria one can truly tie down (except from stating that higher gen languages are further removed from bare metal than lower level - by what degree is not agreed upon). – Oded Jan 05 '15 at 12:50
  • 5
    Which "generation" is C? Can you give some examples of 4th& 5th generation languages & tell us what makes each generation? I.e. what criteria define a language as generation 'n'? – Mawg says reinstate Monica Jan 05 '15 at 13:30
  • 1
    C is 3rd generation. 1st is bare machine code, 2nd is assembler, all the popular programming languages are 3rd. The only ones I can think of that I would call "4th generation" are a handful of domain-specific languages (for instance the one used by Drools). – Simon B Jan 05 '15 at 14:01
  • @Oded There appears to be general consensus as to what constitutes 1st, 2nd & 3rd generation languages, but beyond that, I agree - it does seem a little arbitrary... – Robbie Dee Jan 05 '15 at 14:09
  • @SimonB If C—a language frequently described as “portable assembly”, with pointers, manual memory management, and all kinds of low-level stuff—is a 3GL, then where do we place Haskell? Surely you'd think twice before placing a language with closures, a cutting edge type system, builtin laziness, and powerful abstractions into the same 3GL category as portable assembly. But if Haskell isn't a 3GL, where do we draw the line? Maybe at automatic memory management? Nah, you state “all the popular programming languages are 3rd”, and most of those feature GC. Maybe, 3GL vs. (n > 3)GL is meaningless. – amon Jan 05 '15 at 14:26
  • 3
    Tbh I don't think the concept of Xth generation language is really relevant. – Pieter B Jan 05 '15 at 14:27
  • 1
    related (possibly a duplicate): **[Are there any ultra high level languages out there?](http://programmers.stackexchange.com/questions/225054/are-there-any-ultra-high-level-languages-out-there)** – gnat Jan 05 '15 at 17:08
  • 5
    I'm making a 14th generation language, and it's going to be pure wizardry, because it's the seventh son of a seventh son.... – David Conrad Jan 05 '15 at 21:10
  • 2
    Like Pieter B, I don't think the concept is particularly relevant in this day and age. I believe that at the time it was formulated, there was an expectation that we would largely move away from general purpose 3GLs quite quickly. – Carson63000 Jan 06 '15 at 03:12
  • 1
    Every designer of a new language (or, if not him, the marketing department at his company) is going tag his language as "Nth+1 generation". Beyond 3rd or maybe 4th generation it's all meaningless marketing hype. – Daniel R Hicks Jan 06 '15 at 16:56
  • I think that when we get to the point where the simple statement DoIt(); results in the computer doing exactly what you intended it to do without error or crashing, then we'll have reached singularity. – Salsero69 Jan 06 '15 at 20:42
  • 1
    @DavidConrad: Will it be "*the language that must not be named*"? :-) – JensG Jan 06 '15 at 21:58

2 Answers2

88

“nth-generation language” is a buzzword. It is a marketing term. There is no universally accepted definition of what exactly defines the “nth generation” for n > 2. Some people categorize “scripting” languages such as Perl or Python as 4GLs because they are much more high-level than C, while others think the defining characteristics of 4GLs is that they're domain-specific, e.g. SQL. Some nitwits even think that Java (a mid-90s language full of object orientation and garbage collection and reflection) belongs in the same “3GL” category as Fortran (from the 50s) and C (from the 70s).

A categorization so confused such as “4th generation language” is of no use. You may see it in old textbooks, or hear it from people that started programming in the 80s, but a tag such as “4GL” is worthless without an accompanying explanation of what exactly the author means by that.

Since no one immediately understands what you mean by “4GL”, you should not use such categorizations. Instead, use specific terms to communicate precisely what you mean. E.g. all of NASM, LLVM IR, and Jasmin are assembly languages, but the latter two target VMs, and the last one is also an object-oriented programming language. Are all of those 2GLs? SQL is a partially declarative, domain specific language for database queries from the 80s. And TeX is a domain specific language for typesetting from the 70s. Are they both 4GLs since they are both more or less domain specific?

svick
  • 9,999
  • 1
  • 37
  • 51
amon
  • 132,749
  • 27
  • 279
  • 375
  • 22
    I'm developing an 8G language. It's going to be mind-blowing. ...it'll even julienne fries. I'll sell licenses for three easy payments of... ;) – BrianH Jan 05 '15 at 15:13
  • 10
    I think programming language generations SHOULD somehow correspond to [jet fighter generations](http://en.wikipedia.org/wiki/Jet_fighter_generations). This amount of awesomeness seems sufficient to justify an RFC on the subject. – toniedzwiedz Jan 05 '15 at 15:27
  • 11
    Ah, this brings back memories, back when fifth generation languages would soon be so easy to use that most programmers would be out of a job. – Gort the Robot Jan 05 '15 at 16:45
  • 1
    "There is no universally accepted definition of what exactly defines the “nth generation” for n > 2." - Okay, so, what are 1 and 2? – Izkata Jan 05 '15 at 17:03
  • 5
    @Izkata A 1GL is binary machine code (e.g. the amd64 instruction set). A 2GL is an textual assembly language that provides mnemonics for machine code (e.g. GAS). A 3GL is something that abstracts over machine instructions. Fortran was the first to do this by allowing programmers to use expressions and variables such as `(I + 7) * 3`. However, there's no consensus on where the 3GL category ends, and what 4GL and 5GL are specifically supposed to mean. – amon Jan 05 '15 at 17:17
  • Interesting that you should mention NASM in the same sentence as object-oriented assembly: back when I was vaguely working on it and Simon Tatham was doing most of the work, we had a lot of discussions about extending assembly language in interesting ways, which ended up with one of the design goals being that the macro processor should be powerful enough that you can use it to implement a rudimentary object-oriented language. – Jules Jan 05 '15 at 18:27
  • Steven Burnap: Ah, yes. I sorta remember some of the great 5th-generation languages that I studied in my undergrad programming languages course - Prolog, SNOBOL, Forth, Modula-2, Oberon... Don't see them used much any more. for some reason. – jamesqf Jan 05 '15 at 18:52
  • 1
    @BrianDHall I would like to subscribe to your newletter. Here is my first payment of... ;) – Michael Jan 05 '15 at 19:17
  • Forth was more of a 2.5th generation language. – Gort the Robot Jan 05 '15 at 20:46
  • 1
    Steven Burnap: Well, whether Forth was a 5th or 2.5th generation language kinda depends on whether you believed its promoters, or what you saw of the language itself. But I'm prejudiced: I haven't yet discovered a higher-level language that will do anything I need to do better than C with a good selection of tools and libraries. – jamesqf Jan 06 '15 at 01:20
  • @BrianDHall it'll even julienne fries? Good, I have some fries that need julienning. – user253751 Jan 06 '15 at 01:35
  • Well, what I mean by that is that Forth is in many ways lower level, "closer to the machine", then C is. – Gort the Robot Jan 06 '15 at 04:31
  • 5
    "Some nitwits even think that Java ... belongs in the same “3GL” category as Fortran ..." -- whereas other nitwits believe that if two things appear very different to them, then there cannot exist a classification scheme which groups them together according to whatever criteria are relevant to that scheme? ;-p – Steve Jessop Jan 06 '15 at 12:46
  • @Jules: ah yes. My former employer, now defunct, did that (https://en.wikipedia.org/wiki/Tao_Group), although the assembler primarily targeted a virtual instruction set. The resulting language plus macros was in some ways nicer to write than C, and in other ways less nice. We also had macros to emit what amounted to a natively-compiled Java class. – Steve Jessop Jan 06 '15 at 13:02
36

Simple generations overview: a language is n'th generation when it's building blocks are

  1. bits
  2. instructions
  3. Abstract operations
  4. Domain objects
  5. Program Goals

Hence even languages as new as Google Go or Apple Swift are still solidly 3rd generation. Regex is a text matching language, which makes it an early 4th generation language. By this definition, 4th generation closely aligns with DSL's. However, note that languages such as C++ can have real-world types such as Length and Weight in addition to float and double, which makes them hybrid 3rd/4th generation.

5th generation languages do not practically exist, as they generally require a level of AI that never materialized. The fact that we programmers still are needed is exactly because non-programmers cannot tell a computer with sufficient precision what exactly they want.

MSalters
  • 8,692
  • 1
  • 20
  • 32
  • 1
    N.B. about the last paragraph: [J.Pitrat's blog](http://bootstrappingartificialintelligence.fr/WordPress3/) have interesting stuff related to AI & programmers – Basile Starynkevitch Jan 05 '15 at 14:42
  • 5
    The `DONALD problem` on that blog problem highlights how far we're still away from `sudo make me a sandwich`, and worryingly how much progress we've made over the last 50 years. – MSalters Jan 05 '15 at 14:50
  • @MSalters I think thats probably because we 'software engineers' aren't really engineers. We don't develop software the same way that real engineers develop structures. Ask a programmer to build you a chair and the nails that hold the chair together will have to each be The Correct Nail v1.3.65 – Andrew Hoffman Jan 05 '15 at 16:23
  • 1
    @AndrewHoffmann What's wrong with that? If you're building a bridge, you better have the right kind of material for your structure, and rivets better be the right size (and how many sizes there are?). – didierc Jan 05 '15 at 17:13
  • 1
    @AndrewHoffman: AI has been mostly a CS topic in academia, not a software engineering topic. It may be argued that real engineering would have been a benefit. There's probably a good reason the first self-driving car seems to be Google's. – MSalters Jan 05 '15 at 20:33
  • 6
    @AndrewHoffman - speak for yourself. I am a software engineer and I use pretty standard engineering practices every day. Also, I'm a certified engineer. I think that your entire comment is nonsense based on your personal experience rather than based in fact. – Software Engineer Jan 06 '15 at 05:53
  • 1
    @didierc Using standardized components like a #6-32 machine screw or **a** nail is great. If only more code were more standardized. However, what is the reality? Actual software *engineers*, or an industry full of duct-tape heroes that assume the title engineer and hotglue it to their nametag? – Andrew Hoffman Jan 06 '15 at 14:12
  • 1
    @AndrewHoffmann The title of engineer is well standardised in France at least, where you need to have at least a master in CS (either 1 or 2, though 1 is usually not *considered* as such), or have graduated from so called engineering schools (*Grandes Écoles*), which gives you the master 2 equivalence. As for the rest of the world, maybe it is so. As for code standardisation, I don't have much knowledge about it, I should admit. What would it mean? I guess process standardisation has some meaning for me, but code? It's already formal. – didierc Jan 06 '15 at 14:21
  • Couldn't a rules engine like Drools be considered a quasi 5th gen language based on your definition. – Salsero69 Jan 06 '15 at 20:44
  • 1
    @Salsero69: Rules engine have "rules" as building blocks, which are the sort of abstract operations that you find in 3rd generation languages. Some implementations are domain-specific and include environment support, so that they can be classified as a 4th gen language, and Drools appear to fall in the lather category. But you can't describe the properties of a prime number, and then expect Drools to find all prime numbers under 1000. In fact, I am not aware of any language which is capable of that. – MSalters Jan 06 '15 at 21:17
  • @MSalters: I think you could actually get Prolog, potentially an implementation extended with constraints programming, to do the prime problem. See this nice sudoku solver: http://www.swi-prolog.org/pldoc/doc_for?object=transpose/2 — all it does is it declares in few loops which sets of variables should have distinct values, and then runs the inference engine to find valid solutions. – liori Jan 06 '15 at 21:27
  • @liori: Of course you can get it to find primes. But not by stating that the goal is to find primes; you will need to supply the algorithm. – MSalters Jan 07 '15 at 01:13
  • @MSalters: all you need to state is that you want an integer from some interval that has only two divisors, ie. the definition of a prime number. No explicit searching algorithm. – liori Jan 07 '15 at 01:23
  • @MSalters is .NET's LINQ a 4th generation language? – Den Jan 07 '15 at 09:49