Skip to main content

Posts

Showing posts with the label smalltalk

Emulating Smalltalk-76

If you got as excited as me about Dan Ingalls' live Smalltalk-76 demo on an actual 1970's Xerox Alto, you may have wanted to try it yourself.  For one, you could try my Smalltalk-78 VM. Smalltalk-78 is a leaner version of Smalltalk-76 but very much identical in syntax semantics.  It is also possible to run the full Smalltalk-76 environment, and here is how: First, you need an emulator for the Alto computer. Ken Shiriff posted a nice piece on how to run ContrAlto on Windows . It is written in C# and I got it to work on my Mac using Mono. So here's a step-by-step: Install Mono from  http://www.mono-project.com/download/ Download ContrAlto-mono.zip from https://github.com/livingcomputermuseum/ContrAlto/releases Download this Smalltalk-76 disk image: http://www.bitsavers.org/bits/Xerox/Alto/disk_images/chm/xmsmall.zip Unzip both  ContrAlto-mono.zip  and  xmsmall.zip  in the same folder. In a terminal, change to the ContrAlto directory and run...

Deconstructing Floats: frexp() and ldexp() in JavaScript

While working on my  SqueakJS VM, it became necessary to deconstruct floating point numbers into their mantissa and exponent parts, and assembling them again. Peeking into the C sources of the regular VM, I saw they use the  frexp ()   and ldexp () functions found in the standard C math library. Unfortunately, JavaScript does not provide these two functions. But surely there must have been someone who needed these before me, right? Sure enough, a Google search came up with a few implementations. However, an hour later I was convinced none of them actually are fully equivalent to the C functions. They were imprecise, that is, deconstructing a float using frexp() and reconstructing it with ldexp() did not result in the original value. But that is the basic use case: for all float values, if [ mantissa , exponent ] = frexp (value) then value = ldexp ( mantissa , exponent ) even if the value is subnormal . None of the implementations (even the complex ones) re...

SqueakJS runs Etoys now

TL;DR:  Try Etoys in your web browser  without a plugin (still buggy, but even works on iPad). Feedback from more platforms is very welcome, and fixes to improve the compatibility, too. — Half a year has passed since my initial release  of SqueakJS. Now I can report on some significant progress since then. For one, I adopted a UI layout similar to Dan’s Smalltalk-72 emulator, where the debugger interface is only visible when the system is stopped. Now that the basics are working, there is no need to show the debugger all the time. Try it yourself at the Lively page . But more importantly, many more subsystems are working now. BitBlt is almost complete (all the important modes are implemented), WarpBlt works (for scaling and rotating morphs), the image can be saved, an emulated file system supports reading and writing of persistent files. This now is enough to not only run the very old and undemanding “mini.image”, but SqueakJS now can even run the very lat...

SqueakJS: A Lively Squeak VM

I'm proud to announce SqueakJS, a new Squeak VM that runs on Javascript: SqueakJS project page It was inspired by Dan's JSqueak/Potato VM for Java, and similarly only runs the old Squeak 2.2 mini.image for now. But I developed it inside the Lively Kernel, which allowed me to make a nice UI to look inside the VM (in addition to all the Lively tools): It represents regular Squeak objects as Javascript objects with direct object references. SmallIntegers are represented as Javascript numbers, there is no need for tagging. Instance variables and indexable fields are held in a single array named "pointers". Word and byte binary objects store their data in arrays named "bytes" or "words". CompiledMethod instances have both "pointers" and "bytes". Float instances are not stored as two words as in Squeak, but have a single "float" property that stores the actual number (and the words are generated on-the-fly w...

Smalltalk Bindings for Minecraft Pi

The Raspberry Pi is a cute little computer. Quite cheap at $35, you plug in USB keyboard+mouse and a TV as monitor. And it is surprisingly capable, even for running 3D games. One particularly interesting game is Minecraft: Pi Edition . As in other Minecraft versions, the main goal is to create a world. But unlike other versions, you can not only use the tools provided by the game, you can make your own tools! That's because it comes with a programming interface. The Minecaft world is made of little cubes, and you normally place or remove these blocks by hand, one after another. This is fun, but for larger structures also quite cumbersome. For example, this rainbow here might take a long time to construct manually: But I did not make the rainbow by hand. I programmed it, using the Smalltalk programming language. It's just these dozen lines of code in the Squeak programming environment: Squeak is already installed on the Raspberry Pi, because Scratch was made in Squea...

Squeak Etoys running on OLPC XO-3 tablet

SJ brought a hand-assembled XO-3 prototype to the OLPC Community Summit in San Francisco (mass production only starts when someone puts in a large-scale order), and of course I tried to run Etoys on it. It's pre-installed (as on all XOs) and worked right out of the box. I was able to paint and drag objects, but since there is no right-click support yet there was no halo to bring up a new viewer. Also, touch targets are rather small for my adult-sized hands, and since there are no hover events, some features don't work correctly (as we found out with the iPad version two years ago). So more work is needed, as well as for the XO-4 which has a multitouch screen in addition to a keyboard and touchpad. Help welcome :)

Squeak Etoys on ARM-based OLPC XO-1.75

First post this year, yikes! The last one was about ESUG 2010 in Barcelona, now I just returned from ESUG 2011 in Edinburgh. While I was there, a package with the shiny new XO-1.75 prototype arrived. Incredibly, the pre-installed Etoys simply worked! Never mind the change in processor architecture, the Fedora folks have done a great job compiling the Squeak VM for ARM and so Etoys just works. Of course that's just as it should be, but it's still awesome. And e.g. Squeakland's own Etoys-To-Go would not have worked, as it only includes binaries for Intel-compatible processors. Another great addition is a 3-axis accelerometer. The Linux kernel's driver exposes it as a file at /sys/devices/platform/lis3lv02d/position . Gotta love the unix design of exposing devices as files. All it took to make this usable from an Etoys project was just an object with ax, ay, and az variables that get set with one simple textual script: Another simple script can use this to control a b...

ESUG 2010 in Barcelona

This year's conference logo was designed by my good friend Patty Gadegast . I just returned from the European Smalltalk User Group conference in Barcelona, Spain. It was a really nice experience. There was too much going on to report everything here, so I will just pick some favorites. Photo by Bert Freudenberg The event was hosted by citilab  Cornellà. It started off with a Camp Smalltalk over the weekend. I already met quite a few people there. I couldn't mingle as much as I hoped to because I had to get the first Etoys 4.1 release candidate out of the door: Photo by Adriaan van Os Close by was "Yokohama Wok", a Japanese/Spanish restaurant with the best all-you-can-eat buffet imaginable. You could have everything from freshly cut ham to sushi, grilled steak or seafood, bread, pasta, rice, fruits, cake, desserts. Photo by Bert Freudenberg I talked to Stef (president of ESUG) and gave him a Squeak Etoys button , which he ended up wearing the whole wee...

Squeak Etoys on iPad

In preparation of making Etoys work on the recently announced OLPC tablet , I ported it to the iPad. Here is a video —read on below for some details: This might look exciting, and it certainly is, but it feels actually a lot more clunky than it looks. You may have noticed the little target circles I added whenever a finger touches the screen. That's to know where exactly the finger hit. It's really hard to hit anything, took me a while of training to hit the colorful halo handle buttons on first try. We really need to redesign the user interface before giving this into the hands of kids ... But for now, some technical details:  John McIntosh  ported the Squeak Virtual Machine to Apple's touch-based OS last year (source available at  isqueak.org ). I modified it slightly to enable multi-touch and keyboard input. Also, I rewrote his code to deal with touch events in Squeak, and added multi-touch handling to Morphic. Fortunately, Morphic was designed to handle multip...

Peaceful Holidays ...

... and a Happy 2009 to everyone from me and my family. Presented by my XO-hugging USB men (who seem to have more memory capacity than me at times). Featuring a seriously tree-infested Etoys project, with snow (for those living south who cannot enjoy the white fluff this time of the year). And see you at 25C3 I hope!

European grassroots meeting

I went to Brussels last weekend, meeting with folks from OLPC Europe, OLPC Boston, and some other European grassroots (me representing OLPC Germany e.V. ). We mostly discussed how to implement the new Give-1-Get-1 program as well as Give-many  here in Europe. Some notes are available. And, while sitting together at a nice Cafe on Sunday I made this little Etoys project to celebrate OLPC Europe. Just click here if you are on an XO or have the Squeakland  plugin installed (as everyone should of course). For those who were there and took the huge file home on their USB drives - this is a fixed version that does not keep growing indefinitely while animating. For the Etoyers out there - if you put a copy of a player in one of its own variables repeatedly, this creates an evergrowing "linked list" of player copies. Bad idea. Reset the variable first (by assigning dot for example) then do the copy: see my example.

OLPC review now online, English too

The extensive OLPC article by c't magazine is now available online in both original German and an English translation . It's a thorough review (they had a B1 machine) with some interesting photographs in it, like the Squeak Etoys screen in reflective and backlight modes with microscopic images revealing the working of the XO's incredible LCD.

Croquet SDK 1.0 released

Get it while it's hot from the equally new Croquet Consortium web site.

In-depth review of XO in German c't magazine

There's a glowing review of the OLPC project and its XO machine in the current issue 07/2007 of c't magazine . The in-depth article by Dr. Jürgen Rink describes the project's history and educational ambitions as well as its current prototype hardware and software. One very interesting detail is a comparison of the XO's novel dual-mode display in low light and bright sun light, at normal size and magnified: On the left, under indoor lighting, the colored backlight shines through holes in the reflective layer. On the right, when brightly lit outdoors, the reflection is so strong that the backlight is not even visible anymore, thus creating a gray-scale image. The photographs show one of the example Etoys projects. The magazine is available now at kiosks until next week, or via mail order . In a few weeks the article should be available online via click&buy .

Croquet for Business: Qwaq Forums

So Qwaq came out of "stealth-mode" and reveiled what they have been working on for a while now, Qwaq Forums : Qwaq Forums, the company's first product, is a secure virtual workspace application that significantly increases the productivity of distributed teams by bringing critical resources together in virtual places, as if they were in an actual physical location. A highly interactive and persistent environment, Qwaq Forums enables users to work, collaborate with others, and identify and solve problems. And I'm proud to say I contributed a little, which most probably will find its way into the next Croquet release. Update: Here's a few nice stories of fellow bloggers who have seen Forums already. From Steve Borsch's Connecting The Dots : Qwaq will get traction only because they completely understand that giving someone a semi-trailer truck (i.e., an engine like There or Second Life) doesn't do much good if the person has a small garage and needs a vehi...

Interactive OLPC XO Display Simulation

Many people still have not seen the innovative display of the OLPC project's "XO" laptop. It has twice the resolution of a regular LCD (200 dpi), and works in bright daylight in gray-scale reflective mode. It's impossible for me to increase your screen's resolution by software, and I cannot make your display reflective, but here is an interactive simulation of the backlight mode with its interesting color pattern. This pattern is the source of a lot of confusion about the "color resolution" of the display. The LCD has 1200x900 square pixels, but the backlight puts a full color through each pixel. It is not made of red, green, and blue sub-pixels like a regular LCD, but the first pixel is full red, the second green, the third blue, and so on. The DCON chip (Display CONtroller) selects the color components from the full-color frame buffer. My simulation of the DCON achieves the same effect by selecting either the red, green, or blue color component in each...

OpenGL in a Workspace

On some modern Linux systems, Croquet does not work anymore because OpenGL failes to initialize. Now, I originally wrote that code, and it worked fine for years. So it can't possibly be buggy, right? Jens Lincke of impara tracked it down to the "Composite" extension that is enabled by default nowadays. With Composite disabled, it works, enable it, and it does not. So I turned to NVIDIA for help, thinking their driver might be buggy. Had to give them an easy way to reproduce the problem, this is the snippet I came up with: | ogl green | ogl := OpenGL newIn: (0@0 extent: 100@100). green := 1. [[ ogl glClearColor(0, green, 0, 1). ogl glClear(16r4000). ogl swapBuffers. Sensor waitClickButton. green := 1 - green. ] repeat] ensure: [ogl destroy] Beauty, eh? ;-) I guess nobody has done this in a workspace for a long time. Stop it with Alt-. Anyway, NVIDIA could reproduce the problem, and found our bug: [...] the app is trying to create a ...

Etoys kid-tested on XO

I brought my green machine home this weekend, and my twins had fun with it. Enormous fun in fact for the two 7-year olds, pounding on TamTam furiously. I couldn't bear it anymore after half an hour or so. Instead, I showed Jakob how to make a little figure bounce around on the screen in Etoys, while his sister went to practice her cello. He painted a simple head, and then we used the "forward by" and "bounce" tiles in a tiny two-line script making it move around. I made the mistake of pointing out that the "bounce" tile can produce some noise when bouncing. Endless fun trying the different noises ensued. Oh well. Disturbed in her practice by these noises, Sophie came over and wanted to paint, too. So we saved Jakob's project and started a new one for her. I sat back to work on my email and let her brother teach. She spend like half an hour just painting the figure. The paint tool showed that it is not tuned to the XO's display resolution yet, i...

OLPC talk at design school

I gave a talk about the $100-laptop at the Magdeburg school of Industrial Design . We did some very inspiring projects using Squeak, Etoys, and Croquet together before. The designers always come up with interesting ideas, even though not everything is directly implementable by us developers. Carola Zwick, dean of the school, wrote a book Designing for Small Screens that certainly gives valuable insight for OLPC developers, and she provided (though indirectly) some very important infrastructure for the OLPC office: her group designed the chairs they are sitting on. I got the actual invitation by Christine Strothotte, who got her PhD doing computer graphics in Smalltalk just a few years before I got mine from the same school. She's teaching interaction design nowadays. I'm looking forward to doing an OLPC-related project with these great folks. A student took some photographs during the talk. Also, from his blog post it seems I convinced him of the merits of the OLPC project...