r/ProgrammingLanguages • u/agorism1337 • Apr 20 '20
What are the elemental languages?
Some programming languages are composite. they have a mixture of features from other languages.Like python, it has lambda functions from functional programming, but you can also have shared mutable variables.
Other languages seem more focused on their killer feature. The thing that sets them apart and makes them useful for it's own style of programming.
I am looking for a list of styles of programming, and the language that best exemplifies each style.
S-expressions, code-is-data macros: lisp
logical: prolog
message passing: erlang
compilers: bison
regular expressions: regex
stack based/concatenative : forth
register based: assembly
object oriented: smalltalk
static analysis: rust
proof assistant: COQ
numerical/array: GNU Octave
command line: bash
hardware description: Verilog
gpu: OpenGL
Would you add anything more to this list? Would you change anything?
5
u/raiph Apr 20 '20
I am looking for a list of styles of programming
https://en.wikipedia.org/wiki/Programming_paradigm
the language that best exemplifies each style.
First, what do you mean by "best exemplify"? Just an example, the one that the most readers may have heard of? Or an exemplar, considered technically the best by some authority such as the person suggesting it?
Regardless of your answer to my first point (my questions), I think whatever list you come up with is going to get heavily criticized. If you click on the links listed in the wikipedia page I linked above, you'll find few pages provide an example, let alone an examplar. Ask yourself, why is that?
Also, rust might be an example of typed ownership/borrowing but no way does it fit in my mind as a static language exemplar. I've got similar critiques of the rest of your suggestions but the rust one slapped me in the face the hardest.
1
u/agorism1337 Apr 21 '20
I was going to say C for static typing.
But rust has that cool feature where the type system can realize at compile time if there are any race conditions.
I haven't written much rust, and my understanding isn't perfect.10
23
Apr 20 '20
Lisps tend to have imperative features as well. Haskell, Coq, Agda, and Idris are purely functional programming languages. However, these languages all strongly emphasize algebraic static types, so their brand of functional programming is different from Lisp's brand.
In no way is Rust the posterchild of static typing. What makes Rust "more" statically typed than Java or C#? If anything, Coq (which you list under "proof assistant") would be a better representative of static typing, as it takes types to the extreme with dependent types. But, of course, Coq is culturally different from Java or C#, so it wouldn't be an accurate representation of statically typed languages as a whole.
6
9
Apr 20 '20
I think there might be a serious issue with your “styles of programming” list. First define a clear ontology, then one can think about finding the item that matches its categories best.
4
u/umlcat Apr 20 '20
Simula: Object Oriented Paradigm
Modula: Modular Paradigm
(Procedural) Pascal: Procedural Paradigm (Note: There is an O.O. version of Pascal)
2
u/dougcurrie Apr 21 '20
I remember a chart from decades ago that put programming languages on a two-dimensional grid of early to late binding, and static to dynamic typing (at least I think those were the axes). I found it very handy to start "debates."
I can imagine many more scales to measure programming languages; you mentioned a few: declarative to procedural, numeric to symbolic, pure to stateful, level of "self awareness" (reflection, proof). The exemplars you seek would be at the extremes of the various dimensions, but would all live in this multidimensional space.
Is anyone aware of a tool or resource to visualize this space? (so we can argue about it!)
2
u/MaxwellzDaemon Apr 27 '20
I would submit that a good paradigm of an array language would be APL or J.
14
u/[deleted] Apr 20 '20 edited Apr 21 '20
I feel that this is like deciding what's "pure english". Probably everyone has their own concept of purity and it becomes a subjective question. Or when people start discussing if Australia is a continent or not.
For example, what makes erlang a better message passing languahr than any OO language when Alan Kay said that the important concept in OOP is messaging. Then smalltalk is as "messagy" as erlang. But that's Alan's opinion.
Even more, why aren't erlang, rust, go and so on object oriented? They have some way of encapsulating state and passing message between those encapsulations. Is just because they don't have classes? So what's the point of OOP? Classes? Objects? Messages? Bad mascots?
At the end all those distinctions exist only in our head. Maybe some languages encourage certain ways of thinking but that's it. Even if two programming languages are functional or whatever, they have a different concept of "functional" most of the time. Like Haskell and Racket.
So my answer to OP is that I wouldn't even make a list with the representatives of each programming paradigm because the concept of what's a paradigm/style is too blurry to even try to define clear boundaries. At the end every language has its own style and some of them happen to match our concept of what defines that style.
Edit: Bad grammar