3

There is a kind of beauty in supervening relationships. Consider the following examples:

  1. Atoms are composed of subatomic particles, molecules are composed of atoms, cells are composed of molecules, organs are composed of cells, people are composed of organs, societies are composed of people.
  2. The complex strategies of the game of Go are built upon the need to make structures with "two eyes" so that they'll survive - however the "two eyes" thing is never stated in the rules, but is itself an emergent property of the very simple rules of Go.
  3. The Turing completeness of Conway's_Game_of_Life can be proven in terms of gliders, guns and spaceships, which are in-turn based upon the concept of on and off and very simple set of rules.

In all cases, a minimal set of objects and a minimal set of rules ultimately lead to very complex structure.

My first question: Is it possible to outline a small and minimalistic set of programming "objects" and "rules" which can be used to build up a OOP language?

Now, the clever computer scientist will probably point to the Turing completeness of rule 110 and say that this is all you need! But that's not quite what I'm looking for. Rather, at the risk of posing an ill-defined questions, what are the simplest, human-understandable concepts that can be built into an object oriented programming language?

For a bad and incomplete example that hints at what I want, define three conceptual objects: a reference, a function, and an information holder. Then (level 2?) define a structure to be be an information holder that holds other information via references to other information folders. A rudimentary class (level 3?) would augment structures with a references to functions, but additional structure would have to be built to handle concepts of private vs. public functions. Ultimately we should arrive at a full-featured OOP language that was built solely upon fundamental concepts and nowhere did we cheat by hardcoding optimizations or syntactic salt with machine code. And ideally, the end result would still be attractive and readable code.

My second question: Are there any OOP languages out there that already approach this?

4
  • This has been done before (amazon.com/Anatomy-Lisp-McGraw-Hill-computer-science/dp/…), more than once. A professor of mine created a language that defined all discrete mathematics starting with a boolean algebra over 0/1; I might be able to find a reference if you're interested. Commented Feb 1, 2011 at 14:46
  • @Apalala If it's not difficult to find the reference, then I would be interested. But don't take too much time. And you gave me a Lisp reference. I was wondering if Lisp was going to show up in this conversation. Commented Feb 1, 2011 at 15:28
  • Berryman I found the reference. The paradox is that to define a language you have to do it in some language. The reference uses predicate logic, so I don't think you would be interested. Commented Feb 18, 2011 at 14:51
  • If it's a web reference, I would still be interested. I anticipated requiring a language (such as predicate logic) to describe such a language as I'm looking for here. Could there ever be a way around this? Probably not! Commented Feb 18, 2011 at 15:26

4 Answers 4

1

Prototypes

The IO language reference gives a good hint - the simplest approch to OOP seems to be prototype based programming. All you need is basically associative arrays and first-class functions.

Since many data structures including the dictionary can be implemented in terms of functions, we're soon down to some syntax sugar and lambda calculus, which covers a whole turing-complete model of computation.

Sign up to request clarification or add additional context in comments.

Comments

1

io is probably the closest language out there to what you're looking for.

1 Comment

at first glance it looks interesting and simple
0

Interesting question, but I'm not entirely sure it is sensible.

Consider that 1's and 0's are our atoms in computer science. They are strictly indivisible. And varying combinations of them give rise to programs with all sorts of amazing properties. But, it isn't appropriate to write in 1's and 0's, as the level of abstraction is too low.

I think the same issue would befall your language. If it was flexible enough to allow for the construction of anything, it would be unusable, and if it wasn't, it wouldn't be meeting your requirements.

1 Comment

Anything written as 0's and 1's will always only serve as serializations of the ideas and concepts that we are most interested in. So maybe we can get above this by saying that during the construction of this language, we can only talk about concepts, not implementations. After we have defined the basic axioms and built them up into an OOP language, we can then go back and talk about implementing the base concepts. - Ultimately, perhaps you're right though. I'm not sure the problem is perfectly well defined yet.
0

Smalltalk is built upon a very limited set of primitives, but OO ideoms are atomic there. In theory, you can build an arbitrary complex language on top of a base as simple as SK logic or lambda calculus. OO features are not any different, they can be reduced to a more primitive set. Any OO system on top of a primitive Lisp macros can be a good example.

Update: and take a look at Term Rewriting Systems in general, it's a powerful technique for defining complex semantics on top of simpler things.

I'd also recommend reading a book http://www.cambridge.org/gb/knowledge/isbn/item1132720/?site_locale=en_GB

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.