How many types of programming languages are there?

  • Basically, I want to learn lots of programming languages to become a great programmer. I know only a handful to depth and I was hoping someone could elaborate on how many classes or types of programming languages there are. Like how you would lump them together if you had to learn them in groups.

    Coming from a Java background, I'm familiar with static typing, but I know that in addition to dynamic typing there has to be such variety in available languages that I would love to see a categorical breakdown if possible.

    Wouldn't it better to say "Which type .. " instead of how many?

    Well I have learned that something like Prolog and C are fundamentally different, so I was thinking each of them corresponds to a different kind of programming language, and I was hoping to get a grasp of _how many_ kinds.

    2: the type that does what you want and the type that doesn't

    Learning about different types of programming languages _absolutely_ **is constructive**! You could potentially argue this should be closed as a duplicate of this but I think they're distinct enough questions to remain separate.

    I feel this is a constructively subjective topic. It certainly meets guidelines 1,2,3,5, and 6. It may be debatable which languages fall under a paradigm, but the existence of certain paradigms isn't really in question, just what they are.

    Here is a nice wiki list of programming languages divided into categories tl;dr "Learn at least a half dozen programming languages. Include one language that supports class abstractions (like Java or C++), one that supports functional abstraction (like Lisp or ML), one that supports syntactic abstraction (like Lisp), one that supports declarative specifications (like Prolog or C++ templates), one that supports coroutines (like Icon or Scheme), and one that supports parallelism (like Sisal)."

    @Sova, I'd recommend making your first choice of new languages to try out something that doesn't use c-based syntax. That will get your head focused more on how it works vs. how it's different from the one you know best.

    "Your questions should be reasonably scoped. If you can imagine an entire book that answers your question, you’re asking too much." ([help/dont-ask])

    @PeterBoughton, 404 link?

    Just reporting in years later: Clojure is amazing. Learn something lisp-like, or even just read McCarthy's paper on LISP (from the 60s I think) and you will understand that lisp is the alpha-language from which all other possible languages descend. Very good to learn functional programming, check out Rich Hickey's videos on infoq. Unlock the potential

  • mipadi

    mipadi Correct answer

    10 years ago

    It depends on how you want to classify languages. Fundamentally, languages can be broken down into two types: imperative languages in which you instruct the computer how to do a task, and declarative languages in which you tell the computer what to do. Declarative languages can further be broken down into functional languages, in which a program is constructed by composing functions, and logic programming languages, in which a program is constructed through a set of logical connections. Imperative languages read more like a list of steps for solving a problem, kind of like a recipe. Imperative languages include C, C++, and Java; functional languages include Haskell; logic programming languages include Prolog.

    Imperative languages are sometimes broken into two subgroups: procedural languages like C, and object-oriented languages. Object-oriented languages are a bit orthogonal to the groupings, though, as there are object-oriented functional languages (OCaml and Scala being examples).

    You can also group languages by typing: static and dynamic. Statically-typed languages are ones in which typing is checked (and usually enforced) prior to running the program (typically during a compile phase); dynamically-typed languages defer type checking to runtime. C, C++, and Java are statically-typed languages; Python, Ruby, JavaScript, and Objective-C are dynamically-typed languages. There are also untyped languages, which include the Forth programming language.

    You can also group languages by their typing discipline: weak typing, which supports implicit type conversions, and strong typing, which prohibits implicit type conversions. The lines between the two are a bit blurry: according to some definitions, C is a weakly-typed languages, while others consider it to be strongly-typed. Typing discipline isn't really a useful way to group languages, anyway.

    Was going to pose something similar, but will +1 and add comments instead. Each category or combination also has numerous spin-offs created by focusing on particular elements. OOP, for example, begets: Prototype-based OOP, Aspect-Oriented Programming, Component-Based Programming, and so on. Functional paradigms also have spin-offs, such as languages where an asynchronous process or thread is the base unit and you program by composing parallel processes together.

    How would scripting languages,e.g. VBScript, fit into this? It can be a bit procedural and a bit OO as one can create various types, so would that make it a hybrid?

    This is exactly what I was looking for. Thank you very much.

    @CodexArcanum could you give me an example of a language where you program by composing parallel processes together? This sounds fascinating.

    @JB King OOP languages usually are procedural, at least within the method bodies. Also, it's a common misconception that OOP means "objects". Lots of languages have data types and objects. There's a lot of debate on what the exact definition of OOP is, but it usually includes inheritance and/or encapsulation (private state) as major themes. A language without either in some form would be difficult to classify as an OOP language.

    @sova I can only think of two languages that work kind of like that. Erlang is based heavily on parallel processing, but if you want more like what I was talking about exactly, you should look into Polyphonic C#. It's a research language (now folded into C-omega) based on Pi-Calculus (like how FP is based on lambda calc) Pi-calc is based around the unit of a process, and you declare processes and a combination of synchronous and asych calls into them. Also look into Arrows in FP, especially Haskell. Arrows are very much like that.

    @CodexArcanum thanks I will have to check all of these out!

    @sova also HDLs such as VHDL or verilog

    @CodexArcanum: I think a weak case can be made for Go as also being a programming language where you (can) compose multiple interacting processes (well, goroutines), with explicit support for that in the language definition.

    @Vatine Sure, Go even includes explicit support for the same operations that I described as part of Polyphonic C# through the use of Channels and the arrow operator. Something like Channels is also a part of the next iteration of C# (4.5 I think?) It's great to see these concepts getting out of research languages and into real world use.

    Hmm... are people misusing 'declarative' when they describe HTML and CSS as declarative languages?

    @ErikReppen: No, they're still declarative. They're not *programming* languages, though.

    It's interesting that the declarative wiki seems to say anything that isn't procedural is declarative.

    I definitely get the sense when people use the term for HTML and CSS it's meant to point out that they aren't programming languages. Not that it means they're right to. 99% of he English-speaking planet doesn't know what decimate and sarcasm mean either but those get misused all the time.

License under CC-BY-SA with attribution

Content dated before 6/26/2020 9:53 AM