Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the different programming language concepts and which languages show them in a pure way

I am no language expert but I'm recently into languages and trying to get an overview of major concepts and "their" languages. This is similar to another question about books. So first, what are the major programming language concepts, e.g.

  • structured
  • procedural
  • object orientated
  • object orientated - prototype based (e.g. Java Script)
  • functional (e.g. Haskell)
  • logic orientated (e.g. Prolog)
  • meta (if a pure concept of it's own?)
  • stack based (e.g. Forth)
  • math based/array oriented (e.g. APL)
  • declarative
  • concatenative (e.g. PostScript)
  • (definitely incomplete list...)

and second to get a good crasp of these concepts, what would be the programming language that's based on/implementing its core concept most naturally and pure?

  • For example Java is OO, but it's not a good example because it's not pure OO due to atoms.
  • Lisp is a known to be a functional language, but it's multi-paradigm, so it's not pure. But Lisp may be a pure implementation of "list-based" (if it counts as concept).
  • Is there a language that's structured (no GOTO) but not procedural? (Maybe XSLT v1.x)
like image 645
Peter Kofler Avatar asked Nov 02 '10 21:11

Peter Kofler


People also ask

What are programming languages concepts?

Programming Language Concepts covers practical construction of lexers and parsers, but not regular expressions, automata and grammars, which are well covered elsewhere. It discusses the design and technology of Java and C# to strengthen students' understanding of these widely used languages.

What are the different types of programming language?

There are three types of programming languages: machine language, assembly language, and high-level language. Machine language is easier for the computer to understand but harder for the programmer to understand. This is because machine language is simply the language of machines—bits.


2 Answers

The term you're looking for here is "programming paradigm" and there are a whole lot of them out there. You can get a list of languages which support each from that Wikipedia page and its follow-up links.

For "pure" renditions of any of these, that's harder because it depends on what level of purity you're looking for.

  • For pure structured (under any sufficiently-loose definition of "pure" here) you can look, for instance, at Modula-2.
  • For pure object-orientation you're looking primarily at Smalltalk and its ilk if you want absolutely everything to be uniformly treated (not actually necessary under the most common definitions!) or you're looking at languages like Java and Eiffel if you'll accept primitive types under that heading.
  • For functional you're looking most likely at Haskell.
  • For logic programming the archetypical language is Prolog, but it's not really pure. The only (mostly-)pure logic language I know of is Mercury, and that only if you view its functional chunks as being essentially compatible with its logical chunks.

...and so on and so on. You get the idea.

like image 55
JUST MY correct OPINION Avatar answered Sep 28 '22 07:09

JUST MY correct OPINION


I think Pascal is the canonical procedural language.

I also think Lisp (ironically not ML) is the canonical "meta" language.

For one, a macro is a program fragment which modifies a data structure that represents a program fragment---so you use the language to tweak the language. Secondly, it's considered common practice to write self-hosting interpretors, traditionally called metacircular evaluators: they are programs which programs and run them.

Of course, any other language can do that. In Python you have access to the python compiler, and PyPy is a python implementation in python. But Lisp has, I think, the strongest tradition of doing this.

But I'm a Lisp outsider, so what do I know... 'hope-this-helps ;-)

like image 29
Jonas Kölker Avatar answered Sep 28 '22 08:09

Jonas Kölker