Hacker News new | past | comments | ask | show | jobs | submit login
The influence of Self (dubroy.com)
81 points by mpweiher on Nov 8, 2022 | hide | past | favorite | 26 comments



> Lars Bak was of course hired by Google to build V8, which was released in 2008. Within a few years, most of the techniques pioneered in Self had made their way into the major JS engines.

Sort of coming full circle: After working on V8 for many years, Lars pitched Google on the idea to build a new language and VM. They felt they'd started to hit the wall with how fast they could make V8 because of JavaScript's fundamentally mutable nature.

That became Dart and one of the reasons they believed the Dart VM would significantly outperform JS VMs was because even though Dart 1.0 was essentially dynamically typed, it was class-based, and the inheritance hierarchy and field set of each class are fixed. Therefore, you don't need all of the clever "hidden class" optimization tricks they invented way back then.


Some of the Danish people behind V8 and Dart are now working on the impressive Toit language for embedded IoT:

https://github.com/toitlang


They left Dart after the whole DartiumVM failure and the pivot into Dart 2.0 with strong typing.

You'll notice that Toit is also dynamically typed.


Based on https://mrale.ph/dartvm/, it looks like there are two way Dart gets optimized now - either through a JIT like V8, or AOT compilation with a fallback for the methods that can't be devirtualized. The JIT still performs better, but the AOT code starts up faster. The next challenge is to combine them and eliminate cold starts with dynamic optimization.


> The JIT still performs better, but the AOT code starts up faster.

I should update that side note because a lot of things has changed. It should probably say something like:

> Theoretically, Dart VM JIT should have best peak performance, while Dart VM AOT has best startup time. In reality the comparison is quite complicated. AOT has seen a lot of work in the last few years, which made it faster than JIT in some aspects e.g. both direct and highly polymorphic method calls are usually faster in AOT. JIT's peak performance has been languishing in a state of neglect, but it still runs circles around AOT in some cases due to aggressive inlining.

Something like this.


Good article. Self was a research language; its output was papers and talks. Nobody ever tried to make it a "real" language in any sense. It's like Carl Hewett's development of Actors -- nobody tried to use his codebase other than him AFAIK, but the work was very influential.

Honestly these experimental languages are crucial for science and better off being left alone. C++ has suffered in being both a research language and a production* language, and the people in the latter camp are frustrated by the people in the former camp.

* I mean "production" in the sense of shipping code, not in the computer science sense.


I don't think they tried to make a product from Self, really, but it was definitely a real language with an extremely optimized runtime and a quite complete user interface. Many many hours of intense engineering went into that.

I remember being excited when it was open sourced, finally.. but nothing ever came of it. It was actually quite readable, the C++ VM implementation.


> I don't think they tried to make a product from Self, really, but it was definitely a real language with an extremely optimized runtime and a quite complete user interface. Many many hours of intense engineering went into that.

Well, the performance and the runtime were the point of the experiment, right?

I didn't mean to denigrate the effort that went into it, I just meant that I don't think anyone tried to make it anything beyond a research effort (in the sense that, say, the rust, clojure, or ruby folks have tried to do).

In our current world things that aren't been trumpeted widely are often not considered worthwhile. But I remember Self being incredibly influential, including on my own work. As in, how science actually works.


i tried getting it to compile with current c++ compilers for a few days but without great success. i understand others have now bridged that gap


I wrote this in a discussion with Tom Lord in 2006 (a couple years before Lars Bak developed V8 at Google), after I ran into Dave when he was interviewing at Laszlo Systems, and he showed a demo of his latest Self system:

>I just ran into Dave Ungar (of Self fame), and mentioned how ironic it was that JavaScript pointed to Self as its inspirational prototype (vis-a-vis JavaScript's prototype based object system), but JavaScript totally missed the boat on efficient compile-ability, which is the most interesting thing about Self. (I mean, anybody can make a prototype oop system that runs slow, but it takes a fucking genius to come up all the brilliant stuff in Self, like the aggressive inlining compiler (it has no byte code interpreter, just a bad-ass compiler), incremental compilation, polymorphic inline cache, coupled with dynamic de-optimization to make it debuggable). He gave a cool Self demo of writing a straightforward factorial function, then editing the source to the system's multiplication operator, so it would return a different result if you multiplied something by 1,000,000. Then he showed how it affected the factorial function, as well as the rest of the system, which incrementally recompiled itself as needed. All that and perfect debuggability, too! About JavaScript, he retorted that it was actually possible to efficiently compile JavaScript if you were really devious enough. Too bad the art of designing languages so you don't have to be devious in order to compile them, was lost of so many popular bad language designers (PHP, JavaScript, Perl, etc).

https://en.wikipedia.org/wiki/V8_(JavaScript_engine)


I was fascinated by Self back in the day. The way any slot can be a parent and multiple slots could be a parent providing multiple inheritance seemed like magic. You could just change them at runtime as well, possibly massively changing the behavior of the system. In retrospect multiple inheritance wasn't the greatest in practice.

The LambdaMoo language was also prototype based, and I think both languages were designed around the same time. I wonder if there was any influence in any direction. LambdaMoo only had a single parent slot, but you could delegate a method to another utility object to achieve a kind of mix in functionality.

Then later there was a fork of LambdaMoo called Stunt that added multiple inheritance, maps, and json support. It sure seems like Stunt would be fun to program in even though I didn't do anything complicated in it.

There's also Io which is prototype based and very minimalistic. It has much better interoperability with C and could be a very light scripting language for something in C.


Re: prototype OO and LambdaMOO and so on, there was also CoolMUD (also by Stephen White, who wrote TinyMUCK, and then wrote the first version of MOO before Pavel Curtis took it over) and also ColdMUD by Greg Hudson, which was then forked into Genesis. Those two were more "pure" prototype OO languages, in the sense that they didn't have "magical properties" like permissions and locations built in like MOO, and they provided multiple inheritance and, in the case of ColdMUD, also had lambdas and lightweight objects ("frobs") and in the case of CoolMUD a simple form of federation/object distribution.

I recently dug up and archived the original ColdMUD sources at https://github.com/rdaum/coldmud. There's a link to the (still maintained and used) Genesis fork from there. CoolMUD may have been lost to time.

There was also FMPL, which was a nice and interesting scheme-inspired MOOish thing that was made by Jonathan Blow, who has since apparently gone on to become a famous game developer. (I messaged him a couple weeks ago asking if the sources were around anywhere and he thinks they're lost.)

I don't think there's necessarily any straight line from Self to LambdaMOO, but I always wanted to ask Stephen White about it. It may be more that he fell into the prototype model naturally just from how authoring in those kinds of MUDs work. (Then again LPmud/LPC looked nothing like that)

In a bout of unemployment after the .com crash I wrote my own language/server in a similar vein. But it had multiple dispatch and other stuff going on. Of course never finished.

Anyways, I could go on at length on this topic. You probably know all this already. Thanks for bringing this into this thread. I wonder if we knew each other?


Very cool, thanks. I don't know a lot about other MUDs besides LambdaMOO.


The weirdest part of self is how influential the runtime tech was compared to the langage.

Javascript is it’s most well known descendent and absolutely nothing like it, all the inheritance was clearly an implementation convenience rather than any sort of philosophical inspiration.


> all the inheritance was clearly an implementation convenience rather than any sort of philosophical inspiration.

I don't believe that's true. Eich said: "I’m not proud, but I’m happy that I chose Scheme-ish first-class functions and Self-ish (albeit singular) prototypes as the main ingredients." [1]

It doesn't look like philosophical inspiration because Eich was told to make the language's syntax resemble Java. But as I understand it, it was a very deliberate choice on Eich's part.

[1]: https://medium.com/@_benaston/lesson-1a-the-history-of-javas...


> It doesn't look like philosophical inspiration because Eich was told to make the language's syntax resemble Java.

It’s not just that, it’s also the inaccessibility (`__proto__` has only ever been an implementation detail), and the inability to copy what Self actually called prototypes (had to wait until Object.assign before that was a built-in feature).

Eich did not just provide a Java paint in the form of ctors, none of the prototypal features were easily and portably accessible until ES6. And since that also added class sugar, that’s what most everyone went with and the saviour of prototypal javascript was also its killer.

Not to mention Self built much of the langage features upon delegative inheritance, something JS very much didn’t do e.g. scoping in Self is handled through parent slots.


Scope in early JS was handled through a parent slot. Self was a big influence but I had no time to honor it properly. JS had ten days till a demo to prove to factions in Netscape and to most of Sun (Bill Joy was ally) that it had a role to play. See https://www.youtube.com/watch?v=krB0enBeSiE&t=2176s (earlier if you have time).


I can't find your quoted text on that page, but here is the primary source: https://brendaneich.com/2008/04/popularity/


Oops, sorry, I copy-pasted the wrong link. Thanks for the correction.



Related:

Organizing Programs Without Classes (1991) [pdf] - https://news.ycombinator.com/item?id=26888479 - April 2021 (6 comments)

Self – Fun Through Simplicity - https://news.ycombinator.com/item?id=24329910 - Aug 2020 (9 comments)

Call with David Ungar (2015) [video] - https://news.ycombinator.com/item?id=23800625 - July 2020 (4 comments)

Organizing Programs Without Classes (1991) [pdf] - https://news.ycombinator.com/item?id=22120836 - Jan 2020 (1 comment)

Environment and the programming language Self, part 4 - https://news.ycombinator.com/item?id=20782896 - Aug 2019 (1 comment)

Self Programming Language - https://news.ycombinator.com/item?id=20496570 - July 2019 (40 comments)

New release of Self programming language - https://news.ycombinator.com/item?id=14409088 - May 2017 (37 comments)

Morphic: The Self User Interface Framework - https://news.ycombinator.com/item?id=9858651 - July 2015 (2 comments)

David Ungar: Seven Paradoxes of Object-Oriented Programming Languages - https://news.ycombinator.com/item?id=9555710 - May 2015 (2 comments)

New release of Self programming language - https://news.ycombinator.com/item?id=7047953 - Jan 2014 (42 comments)

The status of the Self language - https://news.ycombinator.com/item?id=1957511 - Dec 2010 (23 comments)

Self language still alive - new release for Linux, Mac - https://news.ycombinator.com/item?id=1520246 - July 2010 (8 comments)

Dave Ungar at Stanford U: Self language creator on its history and influence - https://news.ycombinator.com/item?id=1091916 - Feb 2010 (1 comment)

Self: The Power of Simplicity - https://news.ycombinator.com/item?id=771222 - Aug 2009 (8 comments)

Really not that much. Others?


A Conversation with Bjarne Stroustrup, Carl Hewitt, and Dave Ungar

https://web.archive.org/web/20150403234147/https://channel9....

https://donhopkins.com/home/movies/BjarneCarlDaveLangNEXT_mi...

They have a fascinating (and polite, respectful) argument about shared memory, message passing, locks, synchronization, and lock free message passing!


There's probably a lot more in the 'influence on JVM things' side but it's pretty hard to search. There's also stuff like

https://news.ycombinator.com/item?id=14481339

Interestingly, you're the one and only person who has posted a url mentioned in the footnote of the current submission:

https://news.ycombinator.com/item?id=188325

At the time, it looks you were also (give or take) the one and only person who cared.


Self and Self: Whys and Wherefores

(September 30, 2009) David Unger, from IBM Research, discusses how his experience in computer science has led him to the conclusion that even if your ideas succeed, the real legacy is the people.

https://www.youtube.com/watch?v=3ka4KY7TMTU


Thanks dang, it's pretty difficult to find details of Self vs Smalltalk or the JVM.

As it is I was looking for one of the original videos demoing Self at Sun and it's basically impossible to find right now via YouTube's search.


It may help to know that Smalltalk and Java were implemented on top of Self in one of the last projects done with it; the Smalltalk implementation was faster than some of the main commercial ones.

https://bluishcoder.co.nz/self/substrate.pdf




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: