Newsqueak

A mention of Squeak in a comment on my last post reminded me of Newsqueak, an interesting little language by Rob Pike. Newsqueak has nothing to do with Squeak. Newsqueak implements Hoare’s idea of Communicating Sequential Processes.

The interesting part of Newsqueak is the channel data type. A channel is a two-way communication path. Given a variable v of type chan of int, the assignment c< - 3 sends 3 on the channel, and the expression < -c receives the next value on the channel.

Thus a channel is basically a Unix pipe, represented as a fundamental data type. It can be used for synchronization as well as communication. This should make it easier to write safe multi-threaded programs.

I've never programmed in Newsqueak, and I don't know if there are even any implementations out there outside of Plan 9. And of course it's possible to use Unix pipes to communicate between threads today, although the required kernel calls and marshalling may make them less efficient than in-process channels. Still it's interesting to think about threading using channels.


Posted

in

by

Tags:

Comments

5 responses to “Newsqueak”

  1. Sed Avatar

    In the family of concurrency-centered languages, there is also erlang. See http://www.erlang.org/white_paper.html for some quick intro. The website has some tutorials for a more in-depth look. Quick history of the language at http://www.erlang.org/course/history.html.

  2. faried Avatar
    faried

    Rob Pike’s video on concurrency and Newsqueak is here: http://video.google.com/videoplay?docid=810232012617965344

    An implementation of Newsqueak for Unix is on his website, at http://herpolhode.com/rob/newsqueak.tar.gz

  3. echristo Avatar

    It does seem interesting – I’ve found recently that implementing odd languages makes you appreciate the really well designed ones :).

    Isn’t Gilad Bracha working on that as well? I seem to recall that he makes some regular posts to his blog about it as well.

  4. Ian Lance Taylor Avatar

    Thanks for all the links. I was actually at that talk by Rob Pike—that’s where I heard about the language.

  5. fche Avatar

    Look up Occam, implemented with hardware support on Transputer chips; late 80’s, good stuff.

Leave a Reply