Slashdot Mirror


The Slate Programming Language

An anonymous reader writes "I know that we have had an influx of new programming languages of late, but I feel that this one merits special attention. Theoretical computer scientists and long-time Squeak and LISP contributors Brian Rice and Lee Salzman have been rapidly developing a language called Slate. It draws on the various strengths of the Self, Smalltalk, and LISP languages. To quote from the website: 'Slate is a prototype-based object-oriented programming language based on Self, CLOS, and Smalltalk. Slate syntax is intended to be as familiar as possible to a Smalltalker, rather than engaging in divergent experiments in that respect.' The beta release is currently being written in Common LISP."

31 of 244 comments (clear)

  1. It works! by Timesprout · · Score: 3, Funny

    I prototyped this mail using it

    --
    Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
    What truth?
    There is no dupe
  2. Ah, great, Smalltalk by Deraj+DeZine · · Score: 4, Funny
    Slate syntax is intended to be as familiar as possible to a Smalltalker

    And for the rest of the world? Oh wait, sorry, Smalltalkers are gods among programmers. So foolish of me to think of myself before the Smalltalkers.

    --
    True story.
    1. Re:Ah, great, Smalltalk by hding · · Score: 3, Insightful

      I suppose the rest of the world can take the five or ten minutes that it takes to understand Smalltalk syntax.

  3. Obligatory. by hot_Karls_bad_cavern · · Score: 3, Insightful

    If the new language doesn't support your needs, shut up and don't use it.

    Use what is best for the situation and don't whine.

    1. Re:Obligatory. by 11223 · · Score: 4, Informative
      Sure. I'm not good of thinking of Haskell and Smalltalk examples, but since I know Lisp, I can throw out a few. If you've:
      • Played Jak & Daxter or any of its sequels
      • Played Abuse
      • Booked a reservation on Orbitz
      • Visited the campaign web sites of Bill Clinton in '96 or Howard Dean in '04
      • Used the Mirai facial-animation software or watched Gollum in Two Towers / RoTK
      • Used an AMD processor, parts of whose logic is validated via the ACL2 theorem-prover software
      • Used GNU/XEmacs
      • Used AutoCAD
      • Used the lisppaste pastebot on a bunch of channels on Freenode
      You've used or seen a program that was written in a Lisp variant (all but Emacs and AutoCAD were done in ANSI Common Lisp). To find out more, visit CLiki.

      Not all the world is a desktop application with a GUI. Lisp and the other languages aren't going away in this space anytime soon. It's just too cumbersome to do many of these things in C++, and too slow to do them in Java (Common Lisp is usually native compiled).

  4. well, by bsDaemon · · Score: 3, Funny

    at least you admit it. that's the first step to recovery.

  5. Too obscure by Animats · · Score: 3, Insightful
    By paragraph 2 of the manual, we're here:
    • Block closures

      A block closure is an object representing an encapsulable context of execution, containing local variables, input variables, the capability to execute expressions sequentially, and finally returns a value to its point of invocation. The default return value for a block is the last expression's value; an early return can override this.

    This is a language for people who like obscure semantics.

    Yes, closures are useful. I've used them in LISP. I even used one once in production code in Perl, to do some error handling cleanly. But when the manual starts out with closures, it's clear that somebody is getting too cute.

    This is a language for "l33t haxxors", of the old MIT AI Lab persuasion. Check out "instance specific dispatch". Now that's designed to totally confuse maintainers.

    1. Re:Too obscure by Anonymous Coward · · Score: 3, Interesting

      In Smalltalk, closures are fundamental. Without them you can't do if statements or whiles or anything else.. Smalltalk closures are very simple.. in Lisp their are a bit more intimidating to the unitiated.

    2. Re:Too obscure by Animats · · Score: 3, Interesting

      Well, it's one solution to the "how do I return a temporary" problem. There's elegance there. But it's expressed in an unnecessarily obscure way. The reference-counted Perl model is equally powerful but more comprehensible.

    3. Re:Too obscure by quigonn · · Score: 3, Insightful

      No, it's not obscure. Please have a look at Ruby, where closures are the natural way of doing most things. For example, there is no for-loop, but it is implemented as method for Integer objects (literals are also objects in Ruby):

      14.upto(19) do |i|
      # do ... end is the closure
      end

      so, the closure is executed 6 times, the first time with i = 14, the next time with i = 15, the third time with i = 16, up to i = 19.

      Just have a closer look at Ruby, and you will see that the whole standard library is built on top of this simple and elegant concept. The book "Programming Ruby" can even be read online and downloaded from www.pragmaticprogrammer.com.

      --
      A monkey is doing the real work for me.
    4. Re:Too obscure by be-fan · · Score: 3, Insightful

      Closures are everything! All the crap that modern languages do with special-purpose features, like generators, iterators, etc, can be done with closures. Hell, OOP can be done on top of closures.

      --
      A deep unwavering belief is a sure sign you're missing something...
  6. The first thought that came to my mind... by Rahga · · Score: 3, Funny

    Even though, admittedly, this looks is a joke post, I couldn't help but think this the moment I noticed the article: "I don't really need a programming language that hates Catholic, can't grasp the realities of free-market economics, and is determined to write-in Howard Dean on the 2004 elections ballots..."

  7. why slate by larry+bagina · · Score: 5, Informative
    From the faq: Why did we decide on a new programming language?
    • Smalltalk-80 is over 20 years old. We don't think the original team intended for the model to last this long (well, from discussions on the Squeak mailing list, they've said so).
    • Smalltalk doesn't adequately express many design possibilities that show up often in good complex programs. Requiring classes, not allowing multiple dispatch, and not including some form of multiple inheritance is limiting for a lot of interesting cases.
    • The Common Lisp and Dylan communities have created some powerful interface toolkits which Smalltalk cannot easily take advantage of.
    • Cecil is statically-typed and not very dynamic. Dylan suffers from a case of too much syntax, and not enough emphasis on live environments.
    • Common Lisp is not object-centered or generic enough with its functions.
    • Goo uses the unfriendly Lisp syntax, and isn't quite suited to object-centered thinking.
    • Self turned out to be too strange an environment for Smalltalkers, and never had a decent implementation. Strongtalk was bought up.
    • Bytecode virtual machines and chunk format are old hat. It'd be worth at least trying some different run-time setup.
    • The Squeak system is very powerful in terms of some experimental libraries and user interface ideas, but is based on an aging architecture and a license that is partly troublesome.

    i think smalltalk++ would be a better approach than inventing a new language. Look at C++: it's backwards compatable with C, so a C coder is already a C++ coder and can slowly start making use of new C++ features.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

    1. Re:why slate by Anonymous Coward · · Score: 4, Insightful

      "i think smalltalk++ would be a better approach than inventing a new language. Look at C++: it's backwards compatable with C, so a C coder is already a C++ coder and can slowly start making use of new C++ features."

      Or maybe, just maybe for once we could acknowledge that programmers are smart people and can learn new things. Lets get off trying to bend over backwards and make a broken language better -and- backwards compatible. This is exactly why C++ is the horror that it is today. Write a new clean language and just make sure that it links well with others. Then you can call functions from your old programs written in whatever the hell language you want, nobody knows and the code slowly moves over to a codebase that doesn't rape the programmer (like trying to use exceptions in a C++ program without the exception killing you!).

  8. Deja vu by spellraiser · · Score: 5, Interesting

    Slate is a prototype-based object-oriented programming language based on Self, CLOS, and Smalltalk.

    From a recent post:

    Prothon is a new industrial-strength, interpreted, prototype-based, object-oriented language that gets rid of classes altogether in the way that the Self language does.

    Does this point to a trend in language design?

    --
    I hear there's rumors on the Slashdots
    1. Re:Deja vu by angel'o'sphere · · Score: 3, Informative


      What's a "prototype-based object-oriented" language and how does it differ from C++ and Java?


      In Java and C++ you have classes. In a prototyped language usually not, there you only have objects.

      To make it simple, lets look at the java.util.Hashtable.

      Suppose if you write this:

      class MyClass {} the compiler would do this:
      Object MyClass = new HashTable();

      So, instead of defining a class, you just created an empty object ... I used a Hashtable, because that makes the later explanations more easy, it could have been simply an object of course.

      So far your class has no properties ... no data and no methods.

      So you likely would write something like this:
      class MyClass {
      Object start;
      Obejct end;
      }

      As prototyped languages are usually typeless you would only need to write this:
      class MyClass {
      start;
      end;
      }

      Our hypotetical compiler makes this from your typed code:
      Object MyClass = new Hashtable(); // define a "new class"
      MyClass.add("start", null);
      MyClass.add("end", null);

      So, instead of "defining" a class, like you did in Java or C++, you only created an object in the most global namespace. That object is called "MyClass" just as your class would have been called.

      That object has two "slots" with the names "start" and "stop", just like a class would have two attributes of type Object.

      So: the concept is called prototyping, because you would usually initialize the MyClass object more properly, so that "start" and "end" would have a value and would not be empty.

      Now comes the interesting point: we know how to make classes now. How to make objects from them?

      Well, all Objects have a method called "new".

      In java you would write new MyClass(). But you could of course asume a class had a static method called NEW().

      So MyClass.NEW() would create a new object of type MyClass. That method is usualy build into the language and every "class" has it. So, what does NEW() do? It "clones" the object MyClass.

      In Java we have a class MyClass, and with new we create objects. The objects have some kind of poitner to their class.

      In a prototyped language you only have objects. If you say new to them, they simply create a clone from themselves. The original object is called "prototype" or "traits". Instead of calling a constructor to initialize such a new created object it is fully initialized with default values during teh cloning.

      Why did I use a Hashtable as example? Well, you simply can tell a Hashtable to clone itself ... if the Hashtable describes a prototype. The slots in a Hashtable are similar to teh slots in an object of an prototyped language. Suich a slot usualy has a name and can hold any object ... methods are objects as well :D

      You can merge objects ... and so you do not only get a new object but also a new "class". Thats one way how inheritance could be implemented. But usualy you use nested Hashtables for inheritance, as yoou most often want single inheritance only .. and merging is used for mixins .... another term wixh would need an explanaition as long as this one.

      Regards,
      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  9. Eh by Anonymous Coward · · Score: 5, Funny

    Who gives a shit about the real world. None of the tools you cubicle-dwelling corporate serfs love so much ever came from the real world. All your programming tools come from research labs -- mere leftovers thrown away by academics once they grow bored of playing with them.

    You code monkeys are nothing but low-skilled craftsmen, so when real scientists speak, please sit down and shut up, mkay?

  10. April fools..I hope by rufusdufus · · Score: 4, Interesting

    Confusing things like:

    3 + 4 * 5 " ==> 35 (not 23) "

    and

    (3 / 4) == ( 3 / 4) "==> false"

    give pause for concern.

    But the example code snippet for the curious @ dispatch operator uncommented and unexplained takes the cake:

    "
    oc@(OrderedCollection traits) copyFrom: start to: end
    [| newOC |
    end start ifTrue: [^ oc newEmpty].
    newOC: (oc traits newSize: end + 1 - start).
    start to: end do: [| :index | newOC addLast: (oc at: index)].
    newOC
    ].
    "

    How could someone argue with a straight face that this gobblygook is progress in programming languages?

    1. Re:April fools..I hope by Chinju · · Score: 5, Informative

      I don't know much about Slate, or Smalltalk, or anything, for that matter, but a quick look at the article shows that both of your "confusing" examples are not that confusing...

      As someone else already pointed out, "3 + 4 * 5" ==> 35 (not 23) because Slate has no differences in binary operator precedence and therefore always associates to the left.

      And as for "(3/4) == (3/4)" ==> false, this is because "==" tests for _object_ equality, and the two different instances of "(3/4)", while representing the same numerical value, are distinct objects. It appears that "=" tests for numerical equality.

  11. Wait a minute....... by MasterSLATE · · Score: 5, Funny

    Thats MY nick..... So, they're saying I'm a smalltalker with a lisp?

    Shhhtop it! :(

    --

    [sig]www.masterslate.org[/sig]
  12. Amazing. by warrax_666 · · Score: 4, Funny

    And they say its syntax is easier to understand than LISP? I wonder what they're smoking...

    --
    HAND.
  13. prototype based languages by Jecel+Assumpcao+Jr · · Score: 5, Informative
    When running a program, it is very likely that you will want to create new objects as you go along. You have some alternatives:
    • call a magic constructor fucntion (C++ and friends)
    • send a message like "new" to a factory object (like a class in Smalltalk)
    • send a message like "copy" or "clone" to an object that is like the one you want to create

    In the third case you might find out that you can get by with a set of "prototype" objects to copy from and you don't need classes at all. But to actually eliminate classes you will have to find solutions to the other things they do for you like hold the behaviors for the objects (you can put them in the objects themselves, for example) and reflection (Self uses special "mirror objects" for that).

    There are several different styles of prototype based languages.
    1. Re:prototype based languages by Piquan · · Score: 3, Interesting

      Being a Lisp programmer, I'm always looking for new ideas to bring into my Lisp programs. It looks like Lisp-- possibly even CLOS-- could support prototype-based programming without extensive pain.

      One thing that I'm wondering about in prototype-based OOP is redefining stuff. In Smalltalk and CLOS (I don't know Self), you can redefine methods over classes on the fly, or change member variable definitions, or whatever. I take advantage of this to have a production server running for months while I make improvements.

      But in a prototype language, this looks, well, difficult. If your methods are associated with prototype objects, then if you have existing non-prototype objects and change a method, then would the non-prototype objects get the method def passed down, or what?

      It seems like a prototype language would also have problems with multiple inheritance and multiple dispatch, but it looks like they've licked those too. Interesting.

  14. ain't nothin' wrong with prototype OO by Laxitive · · Score: 3, Interesting

    Man, and here I am writing my own little VM for a prototype OO system.. seems to be all the rage nowadays :D. I'm liking the recent trends of languages evolving to use simpler and simpler higher level semantics. I am a fan of smalltalk and self, but not their syntax. Their language environment and semantics, though, are worth pursuing.

    One of the reasons I like prototype OO (specifically, delegation-based prototype OO, as opposed to languages that use embedding), is that a lot of _other_ dynamic language models fit well on top of it. For example, it would be very simple to make a Python -> Self compiler, because constructs that self exposes can be used directly to implement more specific class-oriented pythonic constructs. It leads me to beleive that a prototype-oo oriented base-vm can serve as a good abstract platform environment for several dynamic 'scripting' languages.

    I'm not sure about the multiple dispatch though. I think multi-dispatch can be confusing.. especially in languages like these where the notion of runtime types is muddled quite a bit of the time.

    -Laxitive

  15. NewtonScript? by Archibald+Buttle · · Score: 4, Informative

    Yet another language turns up that claims its virtual parents are SmallTalk, Lisp, and Self...

    It would seem that Apple may have had it right ten years ago when they made NewtonScript, the native language of their Newton computers, since that language too claimed SmalllTalk, Lisp and Self as its antecedents.

    Having had a brief look though at the documentation for Slate, and yesterdays Prothon, I can't help but feel that Apple did a much better job with NewtonScript and the Newton environment. NewtonScript seems to me to be much more mature and better thought out than these two examples.

    As for comments that I read here about prototype-based languages not being suitable for application development and are effectively only the domain of accademics, I say bullshit. Class-based programming really isn't the only method of OO development, and prototypes can be equally effective. Many thousands of applications were written for the Newton, and they all used NewtonScript and its prototype-based object model. Prototypes can usually be used in a very similar way to classes, and most class-like behaviour can easily be simulated.

    If you're interested in finding out more about how NewtonScript worked and functioned there reference manual can be found here:
    http://www.unna.org/unna/development/docume ntation /NewtonScriptProgramLanguage.pdf
    For a discussion of prototype vs. class based programming consult Appendix C of the NewtonScript reference manual.

  16. A better smalltalk-like language by cryptoluddite · · Score: 5, Interesting
    There are other Smalltalk-based languages that are far better than this, for example SmallScript. The guy behind it, David Simmons, is trying to learn from Smalltalk's mistakes:
    • Isolated, all-in-one environment creates a with-us or against-us situation. Smallscript can plug into .NET, and you can embed C++ or other language code directly into the program and link to external code.
    • Slow performance. Smallscript is targeted more at scripting, where performance is less critical. Even the best Smalltalks average about 1/10th the speed of C on common codes. All Smalltalks are significantly slower than Java.
    • Complete lack of security. Smalltalks allow dynamically loading and running code (there are even smalltalk-lets like applets), but have no provisions for Java-like sandbox security. Smallscript has some provisions for security and can leverage .NET's security.
    • Unnatural language syntax for programming. Smalltalkers claim their language is more like English, but most programmers just don't like it. Smallscript has added a few C-like keywords and syntax.
    • Lack of solid, stable core. One of Java's strengths is a huge core library that is unmodifiable by applications. This means that everybody knows what the core does and what is available in it. Smalltalk core is flexibly, where developers add methods to objects on a whim and re-writing the actual code for the core objects. This means that apps are not portable to future language runtime versions and can't co-exist with other applications.

    This new Slate language looks just like Smalltalk only with new features that nobody actually wants, such as prototypes instead of classes. AFAICT, it hasn't improved on any of the above problems and has actually made some of them worse. IOW, it's doomed.

    Scallscript is a start. It's definitely the best of the breed. Personally, I think the greatest barrier to acceptance of Slate / Smalltalk / Smallscript / Squeak / Whatever is the language syntax. Programmers just don't yoda talking like, and a slightly-off Germanic style of grammar just doesn't fit well with an activity like programming that is more mathematical and logical than like communication.

  17. In search of an appropriate unit of abstraction... by alienmole · · Score: 3, Informative
    There does seem to be a fair amount of interest in prototype-based languages lately. Javascript's object system is also prototype-based, also inspired in part by Self, as well as Lisp/Scheme. Javascript may have helped trigger the current wave of interest in this subject.

    Purely prototype-based languages don't really compete with their more structured (class-based) cousins, though. One of the main benefits of prototype-based langauges is that they give a lightweight way to create an abstraction - you don't necessarily have to create a class first. This isn't necessarily a pure win. The structure provided by classes can be useful, too. A good language should provide both capabilities, no matter what mechanisms it uses to do that. It's possible Slate does this, I haven't looked.

    Another good candidate mechanism for lightweight abstraction is first class anonymous functions, i.e. lambda, as found in Scheme, Lisp, Javascript, Perl (Python got it wrong, unfortunately). Having real lambdas tends to eliminate a lot of the problems which other languages find themselves trying to solve. Although it helps to also have macros, which limits the list to Scheme and Lisp.

  18. Corrections from one of the language authors by water451 · · Score: 5, Informative

    This took me by surprise, and I'm not a usual poster here, so I don't have the energy to reply to each person in turn. So I'll summarize some points I've seen:

    This post is entirely misleading; we are not researchers, and we do intend to do business based on this language. However, what the language itself is is entirely mis-represented. Note: the original submitter is not affiliated with our project in any way, and in fact does not actually know or use the language.

    First, we are not in a project mode of self-promotion or public representation at all. Nothing on that site claims to be a real tutorial, and the current efforts have mostly been about experimentation. We are still preparing the really usable implementation, and have a huge set of ideas and environment enhancements in backlog waiting for this. What's mentioned on the front page is actually a mere fraction of what we're working on.

    The project name, "Slate", is short for "Clean Slate Smalltalk". If you don't know Smalltalk, very little of it will make sense; what's at issue is that we mean what Alan Kay would say in that Smalltalk currently means Smalltalk-80, just a certain quirky snapshot of a whole range of ideas that he and others were working on. We're interested in that whole range.

    Slate is only about prototypes insofar as this was an initial language stage that was simple to play with and powerful enough to explore without too many limitations. Further revisions of the language will feature higher-level facilities for more type-safe programming and more declarative consistency (declarative in the sense of (re-)defining a class and having its instances track that consistently).

    Slate's environment is about 0.001% of completion of what we intend, and we have a huge body of experience and code and ideas to draw upon which are already largely mapped-out. What you see on the site is not representative of what we want in those terms.

    The syntax is definitely odd. At issue is the fact that we kept a minimal Smalltalk syntax core and optimized it for "phrase value" and added various annotation mechanisms, which wind up being very hard to understand until you crack open the 40-page programmers' manual which explains this all. Although it is no tutorial, everything is explained there, and improved with feedback from early users.

    Slate is eventually going to be a full environment, and be very flexible at a large scale, so that questions of prejudice about design choices will not matter, because we actively take part in designing the system so that users can make the choices: whether image-style live interaction or C-embeddable, highly-optimized, low-overhead, no-IDE deployment. And make it so you can make these choices independently; current Smalltalks, Lisps, Dylan, and hundreds of other languages (especially the more common ones) don't have this.

    There are a number of issues brought up here which are addressed but not advertised on the front page; for example, Slate will handle security at the language level, using capability analysis and the subjective programming feature mentioned. Our project has no marketting team (see Smallscript), and has actively avoided public claims until we have the demonstration at-hand. I am giving a presentation and demonstration of the next major release, featuring a self-hosting (C-friendly) setup in Seattle at Smalltalk Solutions 2004 in May.

  19. Inheritance in Prototype-based Languages by ingenuus · · Score: 3, Informative
    If your methods are associated with prototype objects, then if you have existing non-prototype objects and change a method, then would the non-prototype objects get the method def passed down, or what?
    Your use of the term "(non)-prototype object" is a bit confusing since every object is a "prototype" which can be cloned... but I think I understand your question.

    In prototype-based languages, creation of new objects occurs by copying (cloning) existing objects. After copying, the clone is independent from the original -- changing one has no effect on the other (there is no Inheritance relationship between them).

    Inheritance-style call (message) dispatch is handled through a slot named "parent" that every Object has. A call (message) that does not have an object-local slot (handler) is deferred to the objects referenced in the parent slot. In this way, objects can share the same parent and thus the same behaviour (unless locally overridden).

    Note that when a clone is made, all slots in the original are copied to the clone, so the clone has the same parents as the original. Of course, after cloning, you can change any of the clone's slots independently from the original, including the "parent" slot.

    Prototype languages are really not much different from class-based languages... they just split up the responsibilities a bit differently (and perhaps more uniformily).
  20. Re:Dylan was hardly successful by be-fan · · Score: 3, Interesting

    So what? At this point, I've given up ever hoping that the "programmers out ther ein the trenches" will ever wise up to the superior tools that are out there. There is no point in bringing those people into discussions about languages, because they'll never accept something unless its almost exactly the same as what they are already using. Witness C#, which is ever so slowly absorbing Lisp techniques. So far, it has GC, and in 2.0 will have lambda. In another decade, it'll get multimethods, another decade later it'll get macros. By about 2030, they will have matched Lisp circa 1980.

    --
    A deep unwavering belief is a sure sign you're missing something...
  21. RE: Theoretical computer scientists... by Ignominious+Cow+Herd · · Score: 3, Funny

    I wonder what Real computer scientists have been working on.

    --
    Lump lingered last in line for brains, and the ones she got were sorta rotten and insane.