News for hackers. Stuff that matters.
Re:Bare metal Smalltalk-80 port to the Raspberry Pi by endlessvoid94 on Saturday July 18, 2020 @12:17AM (#23878866)
This is so cool.

We know that smalltalk message passing was inspired by biology, and the ultimate design vision was for objects to be ephemeral machines themselves.

Would it be possible to create a farm of Pis, where some objects were on some subset of them, and some objects on another? Even a simplistic example with two Pis, with the object space split between them? Can we use the network to perform language-level message passing?

Re:Bare metal Smalltalk-80 port to the Raspberry Pi by johndoe0815 on Saturday July 18, 2020 @01:03AM (#23879105)
Btw., the biological inspiration is now in a way reversed and a huge networked cluster of ARM nodes is currently used to simulate the brain in the SpiNNaker Project [1]. This project is headed by Steve Furber at Manchester University, one of the inventors of the ARM processor (with Sophie Wilson).

With more than a million ARM9 cores and about 7 TB of distributed memory this is a bit of a different scale than a cluster of Raspberry Pis, though ;). SpiNNaker also reminds me of Dan Hillis' Connection Machine [2], but taking advantage of 40 years of progress with Moore's Law...

[1] http://apt.cs.manchester.ac.uk/projects/SpiNNaker/architectu... [2] Hillis, William Daniel, The Connection Machine, Ph.D. Thesis, MIT Dept. of Electrical Engineering and Computer Science, 1988 - https://dspace.mit.edu/handle/1721.1/14719

Re:Bare metal Smalltalk-80 port to the Raspberry Pi by masklinn on Saturday July 18, 2020 @05:36AM (#23880225)
> Would it be possible to create a farm of Pis, where some objects were on some subset of them, and some objects on another? Even a simplistic example with two Pis, with the object space split between them? Can we use the network to perform language-level message passing?

That's a distributed erlang setup, and I'm rather certain erlang runs on raspi. Pretty sure I even saw Erlang on Xen worked on raspi at one point, so your raspi could be a bare-metal erlang node. Not sure that's maintained / still working though, EoX seems dead.

Re:Bare metal Smalltalk-80 port to the Raspberry Pi by nsomaru on Saturday July 18, 2020 @12:55AM (#23879059)
This sounds a lot like Erlang
Re:Bare metal Smalltalk-80 port to the Raspberry Pi by johndoe0815 on Saturday July 18, 2020 @12:55AM (#23879060)
That idea crossed my mind, too - in fact, I have a SOPINE cluster here [1] (built by Pine64) that would be a good platform for experiments with distributed objects. The Turing Pi is a very similar product for Raspberry Pi Compute Modules [2], just a bit more expensive. Of course, this approach would work as well with a bunch of Raspberry Pis connected via an Ethernet switch.

There was some research in the late '80s on building a distributed Smalltalk [3,4] which is a nice inspiration for such a project. So it's definitely possible to build a distributed Smalltalk and it would be interesting to investigate how well such a system would work given today's hardware performance and networking throughput.

Distributed Smalltalk is just one of the ideas for building distributed non-shared-memory systems from the 1980s. This was an interesting time in general, people experimented with different approaches for distributed systems hardware and software. Some examples include the inmos Transputer, which had bit-serial communication links [5] and support for CSP-based (paper [6] and book [7]) communication in the instruction set (later these ideas were picked up again by David May and his colleagues for the XMOS embedded processors [8]); on the operating system side there were systems such as Plan 9 and Inferno [9], invented by the Unix team at Bell labs, Tanenbaum's (the Minix guy) Amoeba [10] and Ousterhout's (otherwise known for tcl/tk) Sprite [11].

Some of these ideas seem to be gaining popularity again (e.g., CSP-based communication for goroutines [12]) and I hope my students here are interested in investigation these approaches to building distributed systems, e.g. as an alternative platform for IoT applications.

(edit: links reformatted)

[1] https://www.pine64.org/clusterboard/

[2] https://turingpi.com/

[3] Marcel Schelvis, Eddy Bledoeg, The Implementation of a Distributed Smalltalk, ECOOP 1988 - www.lirmm.fr/~ducour/Doc-objets/ECOOP/papers/0322/03220212.pdf

[4] John K. Bennett. 1987. The design and implementation of distributed Smalltalk. SIGPLAN Not. 22, 12 - http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.61....

[5] http://www.transputer.net/

[6] Hoare, C. A. R. (1978). "Communicating sequential processes". Communications of the ACM. 21 (8): 666–677 - https://www.cs.cmu.edu/~crary/819-f09/Hoare78.pdf

[7] Hoare, C. A. R. (1985). Communicating Sequential Processes. Prentice Hall. ISBN 978-0-13-153289-2 - http://www.usingcsp.com/

[8] https://en.wikipedia.org/wiki/XMOS

[9] Pike, R.; Presotto, D.; Dorward, S.; Flandrena, B.; Thompson, K.; Trickey, H.; Winterbottom, P. "Plan 9 from Bell Labs". Bell Labs Technical Report - https://css.csail.mit.edu/6.824/2014/papers/plan9.pdf

[10] Andrew S. Tanenbaum, M. Frans Kaashoek, Robbert van Renesse and Henri E. Bal (1991). The Amoeba distributed operating system — a status report. Computer Communications 14 - https://www.cs.vu.nl/pub/amoeba/Intro.pdf

[11] Ousterhout, John (1992). "Sprite Retrospective". University of California at Berkeley - https://www2.eecs.berkeley.edu/Research/Projects/CS/sprite/r...

[12] James Whitney, Chandler Gifford and Maria Pantoja, Distributed execution of communicating sequential process-style concurrency: Golang case study, The Journal of Supercomputing volume 75, pages 1396–1409(2019)

Re:Bare metal Smalltalk-80 port to the Raspberry Pi by endlessvoid94 on Saturday July 18, 2020 @01:03AM (#23879107)
Thank you for this synopsis! It's been several years since I've had the time to really dig into the (extensive) prior work in this area. You've given me some great links!

I have the smalltalk blue book on my shelf and have always, always wondered about the possibility of bringing back some of the radical ideas from the 60s/70s/80s in a language like Ruby (being popular). Live objects and snapshots are the two that I was most enamored with way back in the day, but I'm sure there are lots of others.

This isn't terribly old (2014) but would love thoughts on it (if you have any!). It's a prototype of a smalltalk-like "System Browser" implemented in Ruby and Qt on OS X:

https://www.youtube.com/watch?v=2xC5B5t5Rq8

The idea is that in the same way that Clojure is a sort of "improved" lisp on the JVM for performance reasons, syntax enhancements, and access to the standard library of Java, I see no reason why Ruby couldn't be the same thing for Smalltalk. Access to the ruby standard library, bringing an interactive live environment to a vibrant programming community and prioritizing interoperability with the modern world (as opposed to much of the smalltalk world which still sort of sits a "world" apart)

Re:Bare metal Smalltalk-80 port to the Raspberry Pi by johndoe0815 on Saturday July 18, 2020 @02:39AM (#23879540)
Thanks for the link - that looks really interesting! I will have to give it a try to make some informed statement, but I think it's definitely worth looking at. Some parts of Ruby also seem to be inspired by Smalltalk, so that might be a good fit. There's also a Smalltalk-80 VM by Rochus Keller based on the Lua JIT compiler [8] (and a very nice Qt-based Smalltalk browser), that might also go in the same direction.

In general, I think there are two major interesting aspects in systems like the Ruby system browser and Smalltalk. On the one hand one can discover the system - you can dig into the implementation without using a disassembler or reverse engineering - and on the other hand it is possible to change the system behavior at runtime (though this is, of course, dangerous).

I would love to see at least the discoverability aspect to be more pervasive in standard operating systems. There are already partial approaches to this, such as DTrace/systemtap and the proc filesystem, but having discoverability as a first class concept - which might fit well to Plan 9's (and to some extent Unix's) "everything is a file" approach - would be nice.

The ability to change the system at runtime is also fascinating. I already mentioned the research of Stephen Kell in another comment [1] and there's a great video of one of his talks [2] in which he shows his approach to dynamically alter a program's behavior on Unix using shared library mechanisms (you can find the code on github [3]). I worked on related ideas in my PhD thesis 15 years ago, maybe it's time to dig these out again ;-).

However, these dynamic modifications should also be safe and accessible. I'm thinking of something related to AppleScript here, which allows to automate/scripts an amazingly large number of functions on OS X. Combining this with a browser that enables a user to discover the accessible OS functionality seems to be a good idea.

The persistent image ideas might also be useful again in the context of persistent main memory systems, which are becoming available now, e.g. with Intel Crosspoint [6]. There's so much prior work in persistent object systems also on the OS side that is almost forgotten nowadays, such as the Eumel/L3 system by Jochen Liedtke [4] (the inventor of the L4 microkernel) and the BirliX OS [5]. Sounds like a good time to re-evaluate these 1980's-era approaches.

I see some more recent work, such as Ksplice [7], as interesting related technology. What is really missing is an integration of many of these ideas into a consistent system.

  [1] https://www.cs.kent.ac.uk/people/staff/srk21/
  [2] https://www.youtube.com/watch?v=LwicN2u6Dro
  [3] https://github.com/stephenrkell/liballocs
  [4] Jochen Liedtke, A Persistent System in Real Use - Experiences of the First 13 Years, Third International Workshop on Object Orientation in Operating Systems 1993 - http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.53.7112
  [5] W. E. Kühnhauser, H. Härtig, O. C. Kowalski, W. Lux, Mechanisms for Persistence and Security in BirliX, International Workshop on Computer Architectures to Support Security and Persistence of Information 1990, https://link.springer.com/chapter/10.1007/978-1-4471-3178-6_22
  [6] https://en.wikipedia.org/wiki/3D_XPoint
  [7] Arnold, Jeff and Kaashoek, M. Frans, Ksplice: Automatic Rebootless Kernel Updates, EuroSys 2009 - https://ksplice.oracle.com/doc/ksplice.pdf
Re:Bare metal Smalltalk-80 port to the Raspberry Pi by scroot on Saturday July 18, 2020 @09:06AM (#23881156)
> However, these dynamic modifications should also be safe and accessible. I'm thinking of something related to AppleScript here, which allows to automate/scripts an amazingly large number of functions on OS X. Combining this with a browser that enables a user to discover the accessible OS functionality seems to be a good idea.

I have been thinking a lot lately about HyperCard and Applescript. They represent a line of thinking that has more or less been abandoned by the commercial side of personal computing, which is really too bad. Applescript still exists, sure, but they've really let it die on the vine. Back in the late 90s I hoped they would make the whole front end of the OS in a HyperCard like system, so that everything could be manipulated by the user. Don't like how this part of the Finder works? No problem, just peel back a layer and see what's going on.

Re:Bare metal Smalltalk-80 port to the Raspberry Pi by johndoe0815 on Saturday July 18, 2020 @10:28AM (#23881588)
That's definitely a shame - and, as far as I know none of the open source Unix(-like) systems has exposed a similar functionality. I think D-bus should enable something like it, but I haven't had a closer look at that...
Re:Bare metal Smalltalk-80 port to the Raspberry Pi by endlessvoid94 on Saturday July 18, 2020 @11:49AM (#23882166)
The possibilities of bringing back this way of thinking are tantalizing to me. The intersection of end user programming a discoverable system with the pervasiveness of the cloud could be really awesome. Something like a mashup of Automator, Hypercard, Heroku, and Smalltalk.

The only reason this doesn't exist is simply that nobody has decided to build it yet.

Re:Bare metal Smalltalk-80 port to the Raspberry Pi by scroot on Saturday July 18, 2020 @02:06PM (#23883378)
> The only reason this doesn't exist is simply that nobody has decided to build it yet.

It also takes a lot of time and effort, and so needs to be funded along with minimal interference from the bureaucracy of a business. Smalltalk and Hypercard came out of precisely those kind of environments. Today the goals of businesses are much different -- much more short term and quarterly focused. I don't have much faith that FOSS can come up with it either, since so much depends on part time work of loosely connected people.

I hope I'm wrong though!

Re:Bare metal Smalltalk-80 port to the Raspberry Pi by hhas01 on Sunday July 19, 2020 @02:40PM (#23891388)
Re:Bare metal Smalltalk-80 port to the Raspberry Pi by endlessvoid94 on Tuesday July 21, 2020 @10:47PM (#23913440)
this is really cool! thank you for sharing
Re:Bare metal Smalltalk-80 port to the Raspberry Pi by marianopeck on Tuesday July 21, 2020 @05:20PM (#23911131)
That's pretty cool. Congrats to the author!

I'm really interested in these types of topics too, so I'll add some more info to this thread.

I agree that things like Smalltalk could be a great alternative platform for IoT and edge computing. [1][2]

With GPIO access [3], very cool debugging abilities [4], and some capabilities for on-device AI/ML with TensorFlow [5], Smalltalk already has some real potential in this area. I've even tried Smalltalk on Amazon AWS (ARM) and it worked really well there too [6] with the ability to make a Docker Swarm if desired [7].

Full disclosure, I work with Instantiations (the company that develops VA Smalltalk), and they have developed a really cool VM that runs on ARM. Their interpreter VM is working on both ARM 32 / ARM 64 platforms at this point, and we've been doing a lot of testing of the LLVM-based VM with JIT compiler, PICs, and everything. And yes, it works for ARM v6, v7 and v8 so far. Small runtime images (around 1MB) or even the full blown VM with full IDE/language can be run on Linux ARM platforms (not bare metal yet...but maybe at some point.)

Feel free to reach out to me for more details or discussion.

Keep up the good work!

[1] https://dev.to/martinezpeck/why-is-smalltalk-a-good-fit-for-...

[2] https://dev.to/martinezpeck/sensor-process-and-transparently...

[3] https://dev.to/martinezpeck/accessing-raspberry-pi-gpios-wit...

[4] https://dev.to/martinezpeck/it-s-2019-stop-reading-text-and-...

[5] https://dev.to/martinezpeck/getting-started-with-nvidia-jets...

[6] https://dev.to/martinezpeck/deploying-vasmalltalk-on-amazon-...

[7] https://dev.to/martinezpeck/docker-swarm-cloud-on-a-arm64-di...