Java Lambdas Finalised!

T____T

Smalltalk had SI and Interfaces, so it’s not like Java chose a deviant way to implement Inheritance. Most MI implementations have ugly problems. Mixins or ‘Traits’ from Scala are one possible (clean) solution. Straight MI as done in C++ is pretty crap really.

Mixins look just right from the sound of them.

Cas :slight_smile:

Maybe we should ask the prototype based kids how they deal with this?

Wait!

Oh yeah, you don’t needs classes, interfaces, mix-in, etc…nevermind.

Please continue with your regularly scheduled program.

Self was a prototype based language, possibly the first one to become at all mainstream (at least as mainstream as Self could get), and it more or less had multiple inheritance. Specifically, you could mark any number of slots as a parent slot, and it would potentially traverse all of them when receiving a message. Self in fact coined the term “traits”, which were parent slots that would mix in their values when cloning as well as become parent delegates. Or possibly traits would copy methods instead of delegating them, thus making them true “mixins” – I can’t remember exactly how it worked.

You can always just take it from the proverbial horse’s mouth:
http://selflanguage.org/_static/published/organizing-programs.pdf

A remarkably dry and wordy paper which made little sense to me, mostly I think through lack of being interesting enough to read or even scan properly :slight_smile:

You know what bothers me about prototype stuff like this? It’s that it looks remarkably like runtime self modifying code. It seems to be very difficult to look at a program and know exactly what’s defined and where.

Cas :slight_smile:

If done properly, it’s not so much self modifying code, it’s code that defines the code ahead of it.

I think you made my brain cry. I’m going to go and drink GIN and GINGER. Tis the season to be jolly etc.

Cas :slight_smile:

While you’re out, let me uncry your brain.

The difference is that self modifying code changes its behaviour over time, while runtime code generation typically means you compose prototype/objects out of function(ality) that was previously defined/generated - once created, you leave them unchanged. This keeps it manageable IMHO, not quite maintainable, no - manageable.

In the tradition of its Smalltalk parentage (or perhaps we should say its prototype), Self’s environment was certainly made to be extremely malleable. Redefining the behavior of any core object’s methods was always just a few clicks away. I’m always amazed that they were able to optimize this kind of environment, but I suppose that’s the rationale for JIT in the first place: you can’t assume everything is set in stone, so only optimize what you know has held true so far.

Much of Hotspot’s JIT technology was originally written for Self.

And seriously, that paper is 20 pages long including title and footnotes, and it’s full of pictures. What do you need, balloonimals?