215 ms·
New release of Self programming language
- analognoise 9y agoNo Windows release. Hmm.
- deleted 9y ago[deleted]
- russellallen 9y agoIt's on the list but a big task because of the Unix assumptions build into the VM and the need to redo the graphics backend both as primitives and to hook it into the Self level GUI framework.
- krallja 9y agoSelf (along with Scheme) was supposedly one of the big influences on Brendan Eich when he was creating JavaScript. Neat to know it's still out there.
- goatlover 9y agoWonder how JS would have gone if it had fully embraced its prototypal nature instead of hiding it behind Java-like syntax. For as long as JS has been around, there were people clamoring for classes in the language, or thinking that it had classes, or implementing a class-like structure, until finally ES6. But it didn't have to be that way. And now the sentiment is that OOP is bad, and inheritance is evil, and classes are the worse, forcing one to predefine a taxonomy that's likely to need refactoring. But prototypal languages can be easily changed. Just change the parent slot(s), or modify the object itself, etc.
- protomyth 9y agoI wish JavaScript had been more like NewtonScript with Java influenced syntax instead of NS's Pascal-ish parts. Plus NewtonScript's frame and two parents was much nicer.
- goatlover 9y agoI wish IO or Self had been more successful, just to see how far one could push a pure prototyping language. IO is more flexible than JS, in that it has (almost) no syntax, just messages to objects, which means you can completely modify the syntax, making DSLs a natural fit for the language.
- deleted 9y ago[deleted]
- chubot 9y agoI honestly don't get what's better about prototypes than classes. In particular, I don't see that the prototypal style is supported empirically. Are there any codebases around 100K to 1 M lines of code written in a prototypal style, which are actually in production use? You can claim thousands of such systems for classes. In that sense, classes are a success. That people write horrible class-based code isn't a knock against them. People also write horrible procedural code. Most code is bad. But there is some code with classes that is very good. There was sentiment in the 90's and early 2000's that OOP is bad. I think the world has learned how to use classes since then -- e.g. no more large inheritance chains and fragile base classes. Not everything is an object -- some things are just functions, and some things are just data with no behavior. As far as I can see, prototypes are worse along all dimensions than classes.
- skybrian 9y agoOr perhaps neither? It's conventional wisdom these days that composition often works better than inheritance.
- hota_mazi 9y agoIt's even more conventional wisdom that these two things are absolutely not mutually exclusive and that it's actually recommended to use both. By the way, "composition" is ambiguous: - Composition of classes is usually a shortcut used to describe inheritance of interfaces and implementation through aggregation (there's only one mainstream language today that supports this natively: Kotlin). - Composition of functions, which is pretty much mainstream in most popular languages today.
- nostrademons 9y agoPrototypes and metaclasses are equivalent in power, and both are more powerful than straight classes. You can do things like dynamically change the set of methods that an object responds to with them, something that you have to fake in a class-based system with the State or Strategy pattern. Also, because prototypes are just ordinary objects, you can do even fancier stuff like store the set of possible prototypes in a data structure and dynamically change them based on a lookup. Things like Django's ORM (where all the object has to define are a set of fields as member variables, and then it magically gets a bunch of methods for DB query/insert/update) are trivially easy to define with a prototype-based object system, and you could do even fancier things like add another object to the prototype chain to get JSON serialization, or another one for protobufs, and swap these out at run-time. However, the flip side of this is that more freedom is not always good for more readable software. GOTO, for example, can express any control flow that for/while/do-while/if/switch can and a number that it cannot (coroutines/exceptions/etc.), but as an industry we've moved away from GOTO because most programmers can't hold this flow control in their heads. Prototypes are the same way: they grant a lot of freedom to implement fancy abstractions, but many programmers seem to be unable to understand the resulting abstractions, so they don't find widespread use. Asking for codebases of 100K-1M lines in prototype-based languages is the wrong question. Because prototypes let people define abstractions that other programmers find unreadable, they a.) let you write equivalent software in fewer lines of code and b.) get rewritten in class-based languages as soon as you have more than a handful of programmers working on the codebase. They're much more likely to be used by a small team of hackers who sells their startup for $40M or so and then vests in peace while another team rewrites all their code in Java than by a big company. If you broaden the question to "has anyone ever made significant money working on or with Self", the answer is yes: http://merlintec.com/old-self-interest/msg01011.html http://merlintec.com/old-self-interest/msg01011.html (Fun fact: Urs Hoelzle, Animorphic's CTO and sender of the second message in that thread, later went on to become employee #9 and the first executive hire at Google.)
- DonHopkins 9y agoI agree: I've always thought that Brendan misunderstood and didn't appreciate some of the most important aspects of Self: 1) that you can inherit from multiple parents, and 2) that you can easily change the parent slot(s) at runtime. Just as his misunderstanding of the meaning of equality [1] [2] and truthiness [3] manifested itself as quirks in JavaScript's design. [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equa... [2] https://www.theguardian.com/commentisfree/2014/apr/07/brendan-eich-has-the-right-to-fight-gay-rights-but-not-to-be-mozillas-ceo https://www.theguardian.com/commentisfree/2014/apr/07/brenda... [3] https://www.sitepoint.com/javascript-truthy-falsy https://www.sitepoint.com/javascript-truthy-falsy
- bonzini 9y agoIt's also one of the big influences on modern JIT compilation techniques, pioneering a lot of the tricks that (through Animorphic Smalltalk) ended up in Hotspot first and V8 later.
- i336_ 9y agoInteresting. So V8 isn't really innovating implementationally in terms of major new research ideas - it's just scrounging around and borrowing old, awesome research from decades gone past. Reminds me of the container-based virtualization renaissance that's happening right now. Hmm, and I've always thought Chrome's extra-thick titlebar was liberated from the Xerox Star UI (http://imgur.com/6h13MlP http://imgur.com/6h13MlP).
- masklinn 9y ago> Self (along with Scheme) was supposedly one of the big influences on Brendan Eich when he was creating JavaScript. That's really doubtful. Self's delegation-based inheritance was expedient for quickly implementing an object model instead of having to build a class system, the influence never seems to have gone any deeper. The one big influence on Javascript was Scheme, that was the original idea, when Netscape's execs asked for a more java-style language for marketing reasons, special-casing a single parent slot was an easy way to bolt an object system into the thing. From what little I looked at it, delegation (through parent slots) is everywhere in Self, it's used for inheritance but also for mixins and scopes chaining and… It's not just an object model, it's a core semantic principle and tool.
- saurik 9y agoThe global object in JavaScript is also a scope and serves essentially the same purpose as the lobby in Self, and you can feel the same mechanism in play in JavaScript's with() statement.
- russellallen 9y agoBrendan himself says: 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. The Java influences, especially y2k Date bugs but also the primitive vs. object distinction (e.g., string vs. String), were unfortunate. https://brendaneich.com/2008/04/popularity/ https://brendaneich.com/2008/04/popularity/
- bhk 9y agoCan we ever get away from the misnomer of "prototype-based OO"? In Self we have two ways of specialization: 1. Prototypes 2. Parents Prototypes are objects that are "cloned" to create instances, a very simple and direct notion of inheritance. We create an object (a "prototype") with properties that apply to a larger set of objects, and then for each instance we copy (clone) it and then add or modify properties as necessary for the instance. Self had optimizations to deal with this so instances did not end up being very fat. Parents are objects that other objects "inherit from". At run-time property lookups are delegated to a parent. The difference between a parent and a prototype is that changes to the prototype do NOT affect the derived instances. Changes to a parent DO affect the derived instances. So, when I read about "class-based" versus "prototype-based" languages, I cringe. It is really "class-based" versus "parent-based". How did cloning get confused with run-time delegation? Self introduced the notion of self-describing instances. That is the essential coolness. The simplifying notion. http://www.selflanguage.org/_static/published/self-power.pdf http://www.selflanguage.org/_static/published/self-power.pdf
- cadillackness 9y agoAnd to make it even worse, Object.create does parent-relationship, and Object.assign does the cloning(if you squint a little bit). Which seems like it should be flip-flopped, since "create" is closer to "cloning" than "assign" is. Even the es5 improvements ended up getting it wrong!
- goatlover 9y agoThe paper you linked to does mention prototypes as Self's alternative to classes. Edit: Oh I see. Cloning is the alternative to instantiation. Parent slots are the alternative to classical inheritance.
- endlessvoid94 9y agoAgree. I'd also like to direct interested viewers to this other neat paper, entitled "Annotating objects for transport to other worlds": https://pdfs.semanticscholar.org/61f1/14dce92b7a49dbb8f981f2269d5121e46ff6.pdf https://pdfs.semanticscholar.org/61f1/14dce92b7a49dbb8f981f2...
- 9y ago
- ChuckMcM 9y agoWow. For those who don't know, there was a big 'language bake off' at Sun between TCL, Java, and Self (all being funded by Sun Labs) and Bert Sutherland (then director of Sun Labs and brother of Ivan) required that the language changes stop and then we'd look at each one, and decide which one to move forward on. When the world sort of exploded at the WWW conference held in Darmstadt Germany in 1995, Java officially 'won' and both Self and TCL were de-committed. (not canceled per-se but not getting any more funding either). I like to think that all three languages benefited from the competition.
- pron 9y agoI believe that much of the work Sun had done on Self found its way to Java in the form of HotSpot.
- hipitihop 9y agoNot to take anything from Self, but in regards to HotSpot, a more accurate history attributes the lineage to Smalltalk and the Animorphic team. Some details here https://en.m.wikipedia.org/wiki/HotSpot https://en.m.wikipedia.org/wiki/HotSpot
- pron 9y agoRight. Sun incorporated Animorphic's work into Self, and later purchased Animorphic and the technology became known as HotSpot.
- saurik 9y agoDo you know what caused Java to "win" when the world exploded?
- ChuckMcM 9y agoAt the time it was the ability to construct executable content inside a web page. Javascript now dominates that space, but up until WWWC 2 pretty much everyone was stuck with page layout primitives. It made it possible to see a path to where we are today and so everyone wanted their browser to have it, and if their browser didn't have it they could run the HotJava browser and get it. Bottom line, it demonstrated an answer to a problem that a lot of people were having, and it promised to answer that problem in an 'open source' kind of way.
- patrec 9y agoHas someone here got some examples of things that are more neatly expressed in self than javascript and other obvious suspects (e.g. python, racket, common lisp, smalltalk)?
- doublec 9y agoI'm not sure about comparing to those languages but I did a post comparing other prototype based languages https://bluishcoder.co.nz/2009/07/16/prototype-based-programming-languages.html https://bluishcoder.co.nz/2009/07/16/prototype-based-program... For me though it's not about the Self language but about the combination of the language and environment. I did a screencast attempting to show some of how Self development is done https://bluishcoder.co.nz/2015/11/18/demo-of-programming-in-self.html https://bluishcoder.co.nz/2015/11/18/demo-of-programming-in-...