![Programming Programming](http://a.fsdn.com/sd/topics/programming_64.png)
![Announcements Announcements](http://a.fsdn.com/sd/topics/announcements_64.png)
![IT IT](http://a.fsdn.com/sd/topics/it_64.png)
![Technology Technology](http://a.fsdn.com/sd/topics/technology_64.png)
The Slate Programming Language 244
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."
It works! (Score:3, Funny)
Ah, great, Smalltalk (Score:4, Funny)
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.
Re:Ah, great, Smalltalk (Score:3, Insightful)
Re:Ah, great, Smalltalk (Score:2)
It would be nice if it only took five or ten minutes to integrate Smalltalk syntax into your intuitive understanding of program flow. Since it doesn't, though, it'll probably take a few days to a few weeks (depending on the programmer) to get used to it enough to program in it with any kind of efficiency.
Re:Ah, great, Smalltalk-The red zone is for the... (Score:2)
Wouldn't you have to defined all the things that you could do, and then wait for someone to send you messages telling you what to do next?
Re:Ah, great, Smalltalk (Score:2)
Re:Ah, great, Smalltalk (Score:2)
As for a smaller user base for Smalltalk and Lisp, true, but so what? It doesn't affect what I do in any way.
well, (Score:3, Funny)
Re:Ah, great, Smalltalk (Score:2, Funny)
So it is definitively not going to be very popular in Finland [scantours.com]. The Finns are known as the worst small talkers in the world.
Oh, wait...
Re:Ah, great, Smalltalk (Score:2, Interesting)
Re:Ah, great, Smalltalk (Score:2, Interesting)
Re:Ah, great, Smalltalk (Score:2, Funny)
Oh wait, sorry, Smalltalkers are gods among programmers.
Indeed. They are mentioned frequently on the literature, but no one has actually seen one living and breathing. :)
Re:Ah, great, Smalltalk (Score:2)
Hmmm, I knew there was a reason beyond supporting legacy code for taking that two week Smalltalk course. Divinity here I come.
Re:Ah, great, Smalltalk (Score:2)
Oh, please, spare us the cynicism. Smalltalk syntax is pretty straightforward. Yes, you, too, could learn it in a couple of hours, which is more than can be said for Java or C/C++ syntax. Does everything have to come down to braces and semicolons nowadays?
Objective C (Score:3, Informative)
Objective C borrows both syntax and semantics from Smalltalk (on top of C itself, of course). It's a nice small language.
Obligatory. (Score:3, Insightful)
Use what is best for the situation and don't whine.
Re:Obligatory. (Score:2)
Negative comments about the negative comments are insightful.
Re:What I use to satisfy my needs... (Score:2, Informative)
I can't believe they changed the goatse.cx layout.
Re:What I use to satisfy my needs... (Score:2)
Re:What I use to satisfy my needs... (Score:2)
Re:Obligatory. (Score:5, Informative)
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).
Re:Obligatory. (Score:2)
Anyhow, Autodesk has de-emphasized AutoLISP in favor of Visual Basic, which they also support. This is all secondhand - I haven't touched this stuff in years.
Re:Obligatory. (Score:3, Informative)
Your use of parentheses there is amusing and sad. You do know that those parentheses denote serialized lists, right? You've just made a list of a list of a list of a ...
Sheesh, learn a little about the language before you go making fun of it.
Re:Obligatory. (Score:2)
Too obscure (Score:3, Insightful)
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.
Re:Too obscure (Score:3, Interesting)
Re:Too obscure (Score:4, Interesting)
Re:Too obscure (Score:3, Insightful)
14.upto(19) do |i|
# do
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 t
Re:Too obscure (Score:4, Insightful)
Re:Too obscure (Score:2)
No, they are just following the Smalltalk tradition. Smalltalk is a language that people generally find easy to learn. The use of blocks in Smalltalk just makes things consistent and simple, and it lets you write your own control structures.
Check out "instance specific dispatch". Now that's designed to totally confuse maintainers.
That's
Re:Too obscure (Score:2)
I think you are confusing anonymous code blocks with closures. The map and sort functions can take an anonymous code block, but they aren't creating closures.
It is a closure if, when it executes, it refers to my variables that were in a visible scope at the time that it was defined. You might want to re-read Function Template [perldoc.com] from the perlref man page to become a little clearer on the subject.
The sort function doesn't use a closure, it created two new global called $a and $b. The map function doesn't
right! (Score:2, Funny)
The first thought that came to my mind... (Score:3, Funny)
why slate (Score:5, Informative)
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.
Re:why slate (Score:2)
Re:why slate (Score:2)
Re:why slate (Score:4, Insightful)
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!).
Re:why slate (Score:2)
Re:why slate (Score:2)
Deja vu (Score:5, Interesting)
Slate is a prototype-based object-oriented programming language based on Self, CLOS, and Smalltalk.
From a recent [slashdot.org] 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?
Re:Deja vu (Score:2)
Re:Deja vu (Score:2)
Yep: if you want publicity, send an article on a brand new language that isn't finished yet to Slashdot and wait. :-)
At least we're improving, though. The last one was "pre-alpha" (or vapourware, as it's technically known). This one is "beta" (or get-everyone-else-to-test-it-for-you, as it's technically known). One of these days, someone will write an article about a genuinely innovative language that really exists in usable form, and the eds will reject i
Re:Deja vu (Score:2)
prototype based languages (Score:5, Informative)
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 [dekorte.com].
Re:prototype based languages (Score:4, 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.
Inheritance in Prototype-based Languages (Score:3, Informative)
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 t
Re:Deja vu (Score:4, 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
So far your class has no properties
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();
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
You can merge objects
Regards,
angel'o'sphere
Re:Deja vu (Score:2)
No, just in a trend (of 2) in slashdot stories. No one really uses these languages.
In search of an appropriate unit of abstraction... (Score:4, Informative)
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.
what did python get wrong? (Score:2)
Yesterday I wrote a small python script (to learn some of it) and it included this (quicksort):
Re:what did python get wrong? (Score:2)
Anonymous functions should really be called anonymous subroutines - afte
Re:what did python get wrong? (Score:2)
The brief summary is that there are currently two problems, that I know of offhand, with lambda in Python:
These are both quite severe restrictions that limit the ability to use lambda effectively, i.e. in ways that it is common to use them in languages which support lambda correctly.
In languag
Re:In search of an appropriate unit of abstraction (Score:2)
What you likely want to say is static typing versus dynamic typing. Most prototype bases languages are dynamic typed
In case you want to "design" a larger system with a prototyped language, you of course "design" traits objects. They are just th
Re:In search of an appropriate unit of abstraction (Score:2)
No, I stand by what I said. Prototype-based languages typically allow the structure of instances to be modified arbitrari
Re:In search of an appropriate unit of abstraction (Score:2)
Indeed, I missed that. Thats right, point taken
April fools..I hope (Score:4, Interesting)
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: [|
newOC
].
"
How could someone argue with a straight face that this gobblygook is progress in programming languages?
Amazing. (Score:5, Funny)
Re:April fools..I hope (Score:5, Informative)
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.
Re:April fools..I hope (Score:2)
(new Integer(4) == new Integer(4))
would also return false.
Re:April fools..I hope (Score:3, Informative)
if (a == "value")
instead of
if (a.equals("value"))
Re:April fools..I hope (Score:2)
Re:April fools..I hope (Score:2)
Re:April fools..I hope (Score:2)
What happened to simplicity ?
Re:April fools..I hope (Score:2, Insightful)
What happened to simplicity ?
The point is that languages like SmallTalk Self and this those new beasts: ARE SIMPLE.
Look at it from a different point of view! Suppose you may use your favorite language and you are requested to implement a runtime system and compiler for such a language.
Agree full heartly: SmallTalk has a shitty syntax. So has LISP. Why do I say that? Because most people believe you can learn any syntax. But: a lot of people believe SmallTalk is the BEST language
Re:April fools..I hope (Score:2)
In the end when choosing a programming language the programmer asks themselves a few questions. Namely.
1) How does this programming language make me more pructive. How hard or easy is it attach to a database, pull some records out and display them in a GUI. How hard is it to create a simple server and client. How much effort does it take to express my ideas into a product.?
2) How does my program perform once it's done? Is
Re:April fools..I hope (Score:2)
Lisp is beautifully, terribly simple, but it may not be simple to write a useful program in Lisp.
C is "simple" with its mere 31 keywords, but the flip side is typing if(!strncmp(input_name, name, strlen(name))) when you really mean "if input_name = name".
Perl and Python are simpler for the programmer, at the cost of great complexity under the covers.
Re:April fools..I hope (Score:2)
Re:April fools..I hope (Score:3, Insightful)
As it has always been in the smalltalk family of languages (which includes basically Smalltalk and Self). This was once considered a necessity as smalltalk was interpreted strictly as a stream of instructions (much like forth is now), but now that it's always compiled, I rather wonder whether this isn't legacy baggage. Certainly flexible overloadable operators aren't inimical to the notions of operator precedence, as the ML language family shows.
I certainly don't get
Re:April fools..I hope (Score:2)
Re:April fools..I hope (Score:2)
Re:April fools..I hope (Score:2)
I bet the learn to spell in those ivory towers.
Re:April fools..I hope (Score:2)
"When a programming language is created that allows programmers to program in simple English, it will be discovered that programmers cannot speak English.
- Anonymous"
Wait a minute....... (Score:5, Funny)
Shhhtop it!
ain't nothin' wrong with prototype OO (Score:4, Interesting)
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
I'm going to create the Stale programming language (Score:2, Funny)
NewtonScript? (Score:4, Informative)
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/docum
For a discussion of prototype vs. class based programming consult Appendix C of the NewtonScript reference manual.
Re:NewtonScript? (Score:2)
A better smalltalk-like language (Score:5, Interesting)
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.
Re:A better smalltalk-like language (Score:2)
You missed a 'like'.
Re:A better smalltalk-like language (Score:2)
I'm not sure I get this.
This is far more readable than in languages like C.UI (Score:2)
Corrections from one of the language authors (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 [smalltalksolutions.com] in May.
Most often used prototype based language is... (Score:3, Informative)
You read right. JavaScript has a prototype based system for objects. I seldom see this mentioned in language design discussions.
Actually I like JavaScript and it's prototype system quite a lot. It's a nice and powerful little language.
But that's likely only the case because I never needed to implement any cross-browser stuff in it.
Slate? (Score:2)
RE: Theoretical computer scientists... (Score:3, Funny)
GNU Smalltalk (Score:3, Informative)
Eh (Score:5, Funny)
You code monkeys are nothing but low-skilled craftsmen, so when real scientists speak, please sit down and shut up, mkay?
Re:Prototyping OO is not a great paradigm (Score:2)
Re:Prototyping OO is not a great paradigm (Score:2)
Re:Prototyping OO is not a great paradigm (Score:2, Interesting)
Re:Prototyping OO is not a great paradigm (Score:3, Insightful)
"Object and inheritance management" is only an issue for those who don't bother to analyze the problem and architect a solution. Slapping together code without understanding the problem is not "prototyping" -- it's wasting time.
Prototypes are for understanding the application requirements, not for "scripting." If you compare prototyping tools to production applications, you are completely and thoroughly missing the point for their existance.
Re:Pretty Cool (Score:3, Interesting)
Re:Pretty Cool (Score:3, Interesting)
It did a great job at bringing all the power of Lisp with all the symplicity of HTML. All the equivalents of HTML elements were just lisp-like function calls. Something like
Since all markup was just a lisp-like function call like any other, extending the company to do more complicated things - lik
Dylan was hardly successful (Score:2, Insightful)
As elegant and admired as Lisp and Smalltalk are, they aren't exactly the most heavily used programming languages available (and I say that even though I love Smalltalk). Just because a language appeals to language designers, doesn't mean it's going to be embraced by the masses of programmers out there in the trenches. And the more of a mindshift necessary
Re:Dylan was hardly successful (Score:2, Interesting)
But Smalltalk couldn't rival Java in terms of marketing, and applets were supposedly the next big thing. If only ParkPlace had come up with a Smalltalk equivalent to applets...
Re:Dylan was hardly successful (Score:4, Interesting)
Re:Dylan is technologically successful (Score:3, Insightful)
Can we really make suck a strong claim about a language on its own? .Net--all of these help their target lang
These days, syntax and semantics are all fine and groovy. For any language, you expect variables and functions and such. One huge contributor to making or breaking a language in the marketplace, though, is its library support.
CPAN, the Python standard library, java.*, boost.org,
Re:Dylan is technologically successful (Score:2)
No way. Whether Dylan is or is not better in an absolute sense, C# is the biggest increment over Java the industry is willing to swallow, just like Java was the biggest increment over C++ the industry was willing to swallow. You can't introduce too many new things in a new programming language or people won't go for it.
Re:another one (Score:2)
Genda
Re:Maybe I'm just feeling cranky (Score:2)