Rob Pike's Newsqueak - some good concepts

renoX renosky at free.fr
Fri May 18 15:35:43 PDT 2007


Dejan Lekic a écrit :
> Today I watched an excellent presentation by Mr. Rob Pike on Google
> Tech Talks. (Advanced Topics in Programming Languages:
> Concurrency/message passing Newsqueak -
> http://video.google.com/url?docid=810232012617965344&esrc=rss_uds&ev=v&q=user:%22Google+engEDU%22&vidurl=http://video.google.com/videoplay%3Fdocid%3D810232012617965344%26q%3Duser%253A%2522Google%2BengEDU%2522%26hl%3Den&usg=AL29H22XDZMMUfZudHDB2dqX9jtFEE4L9w
> ) There are several very interesting concepts in his Newsqueak

Ah, limbo/newsqueak, such a nice syntax..
In many ways, it's much better than D's syntax IMHO.

Of course when you pass everything by copy, the syntax is nicer (no 
const, final,.. mess), but the price to pay in performance must be 
awful; still it's probably the right choice to make for a scripting 
language.


That said I thought that the content of the presentation is a bit 'old': 
after all he was presenting 20+ old ideas.

renoX




> langauge which I would be very happy to see in D. One of such is the
> ability to execute ANY function as a new process (thread) via keyword
> "begin". An example: <code> // makes no sense, but should work begin
> int sum(int a, int b) { return a+b; }
> 
> begin int doConcurrently(int a, int b) { for (; a>0; a--) print(b);
> // prints in background }
> 
> // same, like lambda begin int doConcurrently2(int a, int b) { for (;
> a>0; a--) print(b);  // prints in background }(20, sum(23, 5)) 
> </code>
> 
> As You can see, begin makes expression/function work in a separate
> process/thread. It has been discussed about having lambda-functions
> here on these newsgroups, so I will not touch that topic in this
> thread...
> 
> Second very interesting concept is connected with the "become"
> keyword. With it you can replace function with it's execution, which
> basically generalizes tail recursion. This is better explained with
> an example: <code> // Any expression int function(int a, int b) {
> become a + b; }
> 
> int sum(int a, int b) { return a+b; }
> 
> // Any function invocation // Reuses sum's stack space! int
> difference(int a, int b) { become sum(a, -b); } </code>
> 
> There are more interesting things, I haven't had time to write about
> them, so I strongly recommend seeing this presentation! :)
> 
> Cheers!



More information about the Digitalmars-d mailing list