> [!note] > In the past, [[Programming Languages]] were categorized in many different ways, but these categorizations are less relevant today. # Nth generation language > [!thought] For me, this always felt to be a marketing term, and at best, propaganda to show the constant progress of the technology. - 1GL - Machine Code - 2GL - Assembly - [3GL](https://en.wikipedia.org/wiki/Third-generation_programming_language) - Popular High level languages ... this is where it stops making sense ... - [4GL](https://en.wikipedia.org/wiki/Fourth-generation_programming_language) - SQL, Matlab, ??? - [5GL](https://en.wikipedia.org/wiki/Fifth-generation_programming_language) - Prolog, ??? > [!thought] Why it stopped making sense after a while > After a certain point, the language became expressive enough to encompass extensions within the language. ([[DSL|Domain Specific Language]], especially in the context of [[Ruby]]). Thus, there was less need to either create a new language or extend it ([embedded SQL](https://en.wikipedia.org/wiki/Embedded_SQL), for example). > > Higher level abstractions that were attempted for the 4GL and 5GL were either [[Dead Evolutionary Paths]] or better articulated as libraries instead. Some concepts, such as logic programming, visual programming, or proof checker, were too different for general purpose use. > > [[SQL]] and [[Matlab]] are perhaps the most successful 4GLs. Ideas from both - a) abstracting out the 'how' of computation and b) convenient syntax for mathematical operations - live on as important ideas (Most databases have query languages, even if they are [[JSON]] based; Dataframe manipulation syntax has been popular ever since, being present in [[numpy]], [[polar]], etc). One can argue either list comprehensions ([[Python]]) or [[Csharp|Linq]] are 4GL concepts, too. > > However, the best system is where the majority of the code is in 3GL, with some 4GLs sprinkled in it. Another related concept is the "**low vs high level language**". Along with the generation divide, this is subjective and time-of-reference dependent. [[COBOL]] and [[Fortran]] were considered high-level, but not anymore from the modern standards. There are some objective criteria around the "level" of the language, such as the existence of the [[Garbage Collection]]. However, especially within the modern 3GLs that are still updated and heavily utilized, the abstractions provided by the language (or the runtime) are powerful enough to support higher-level abstractions via libraries. # Scripting versus Compiled languages Once upon a time, "scripting languages" were used as derogatory term. As if they are not a "real" language, and their usage should be limited to non-serious code. However, this changed greatly. Many so-called scripting languages without an explicit compilation step - [[PHP]], [[Python]], and [[Ruby]] took over the industry (as they took over the world, they preferred the term *dynamic* instead). Dynamic languages offered big advantages; they naturally supported metaprogramming (`eval` is very crude, but it gets the job done) and offered fast iteration cycle in an era compilers were not designed with developer experience in mind. C/C++ compilation speed is / was notorious, and even now, other than [[Go]], most compiled languages suffer from long compilation time (ex: [[Rust]]). Moreover, the distinction between these blurred over time. Bytecode and JIT introduced intermediary languages ([[Java|JVM]]). Even compiled languages started to offer REPL support. Everyone collectively agreed that `eval()` does not yield good code, while compiled languages adding more robust metaprogramming (bytecode manipulation, templates, or compile-time computation (ex: [[Zig]] or [[Rust]]'s procedural macro)). # Other Categorization - typing - static vs dynamic typed - gradual typing is added in the spectrum. - strong vs weak - perhaps most ambiguous concept. - if languages like [[bash]] and [[C]] or [[Python]] didn't exist; this would not be a concept. - in general; some weak typing is convenient (`+` for string concatenation between non-string types), but introduces room for gotchas. ([[Leaky Abstraction]]?) - more academic concepts (linear, dependent, ownership, higher-order, Hindley-Milner, ...) - "system" programming language. - [[Go]] initially marketed itself as a system programming language, but it got pushbacks from the traditional folks; how can one do systems programming in a [[Garbage Collection|Managed Language]]? - via concepts. due to [[Death of an idea]]; this is not as relevant. - procedural vs functional programming languages - this made sense before [[Objects vs Closures|closures]] and higher-order functions. but now most languages have some support for this. - there are still "FP" features, regarding typing, structural typing, currying, etc... but it's debatable whether these are strictly positive (i hate [[ramda]], for example) - [[Purely Functional Programming]] - [[OOP]] - most languages have some OOP concept, unless they are vehemently opposed. [[Wide Pointers vs Classical OOP|Traits]] have replaced much of this. - various X-oriented languages don't live anymore. like [[Eiffel]]'s design-by-contract, is embedded into a language as assertion statements. ([[TypeScript]]'s typing, especially with control-flow based typing, type guards, and type assertions, could be considered design-by-contract).