Search code examples
haskelllanguage-agnosticfunctional-programmingjparadigms

How are J/K/APL classified in terms of common paradigms?


I've just started learning J, which is very interesting, but I was wondering what kind of language it is exactly, in relation to common paradigms and classifications. For example, you could say that F# is a strongly typed, mainly functional (it supports OO and procedural programming, but it's considered to be "functional") language which belongs to the ML family. For J, however, I couldn't find much on how to classify it "conventionally", or find anything on Stackoverflow confirming that it's a functional programming language. Wikipedia says that it "is a very terse array programming language", "supports function-level programming", and "is not a Von Neumann programming language", none of which are more helpful.

I have a couple of questions:

  1. What main paradigm (procedural, OO, functional, logical) do J/K/APL fall under? If their paradigm is only "array programming", what paradigm does that fall under or is most similar to?

  2. What well-known programming languages are J/K/APL most similar to? For example, I'd guess that they're like Lisp, since they operate on arrays (lists) and have minimal, no comma syntax.

I'm just trying to categorize these languages in my head according to what I already know. Thank you.


Solution

  • While other tags could also apply (as with other languages), J is certainly a functional language. It has most major attributes attributed to functional languages, such as functions being 'first class citizens,' currying, higher order functions, etc. Furthermore, if it means anything to you, I have read articles where the language creators themselves described the language as 'functional.'

    You could also say that it is an array programming language, as all functions operate on arrays vs. single elements.

    I think the short answer you are looking for is that J is a functional array programming language. You could also throw other descriptors out there, such as non-statically typed, etc.

    As to your numbered questions:

    1. Functional and array programming.
    2. As far as array programming goes, they are not similar to any other well-known language; rather they are in their own category of 'array programming languages.' As far as functional aspects go, they'd be in the functional category.