What are the axes on which different programming l...
# thinking-together
o
What are the axes on which different programming languages differ? So far, I have evaluation - eager or lazy abstraction mechanisms - classes, modules etc types - static, dynamic, strongly, weakly (I know first 2 and last 2 are different categories🙂) syntax primitives What else?
🤔 4
🧠 1
o
Perhaps paradigm, exceptions, or expressive power? (As measured by some formal heuristic, such as statement ratio or line ratio, often compared to C)
I don’t really like my contributions above so perhaps I can ask a useful question. Could you further define axes, in this context. Should they be formal properties? Should the options be mutually exclusive?
j
Size? There’s a lot of languages, i.e. Lua, where a major feature they espouse is being small in size and embeddable, for example
o
I mean something concrete that’s a property of the language not just what it affords. Like you can do functional programming in the broad sense in python for example but Haskell affords it better so I want to keep paradigms out since the programmer can decide to use different paradigms. I remember something Phillip Wadler said(I think he is the one who said it) that Haskell is the best imperative language. like a friend pointed out Memory management - Garbage collection. Though I wonder if garbage collection is going a bit into the implementation vs. what the language actually is.
Pointers or no pointers. Mutable variables
g
scope and name resolution!
👍 1
i
i
(There needs to be a sigh reaction)
1
Considering generics, one of the axes could be: how dynamic is polymorphism, and where is it handled? (Is it just based on data types, or are there protocols, or templates, or generics, etc) Also... how large is the type-level part of the language? Is it just primitive hints like Int / String, can you define new types, or is it basically a whole other execution context (a la Idris)?
👍 1
Another axis (or, rather, a space): what details of the underlying stack do they reveal, redefine, or obscure?
👍 1
How are they meant to be evaluated? Effectful statements in order? Some sort of tree with branches in parallel? Some sort of search through a possibility space? No notion of evaluation at all? (Not all programming languages are meant to "run" on a "computer")
🤔 1
👍 1
(Many of these points won't lie on a line unless you sort of... rank them from "totally chill and normal and boring" to "very eccentric, don't invite to the office", which I think is a wonderful way to rank ideas in computer science)
🤘 1
d
Instead of "mutable variables", I prefer 'pure functions and referentially transparent expressions' vs 'shared mutable state'. Curv is in the former category, but it supports mutable local variables and a
while
loop. Curv wants to be a better imperative language than Haskell.
👍 1
w
In my experience: • automatically garbage collected vs. not • statically vs. dynamically typed • inheritance-oriented vs. composition-oriented The three most useful high-level axes for comparing languages.
👍 2
d
The method by which garbage on the heap is collected affects what language primitives are available, what is efficient, and how you write code. There are multiple choices: tracing gc (most languages but originally Lisp), C, Rust, Swift, etc.