I created an up-resed version of the 2003 demo that Alan Kay and I did at the O'Reilly ETech conference. It really holds up nicely.
by David A. Smith (noreply@blogger.com) at September 20, 2020 10:41 PM
I created an up-resed version of the 2003 demo that Alan Kay and I did at the O'Reilly ETech conference. It really holds up nicely.
by David A. Smith (noreply@blogger.com) at September 20, 2020 10:41 PM
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) really worked.
function frexp(value) {My frexp() uses a DataView to extract the exponent bits of the IEEE-754 float representation. If those bits are 0 then it is a subnormal. In that case I normalize it by multiplying with 264, getting the bits again, and subtracting 64. After applying the bias, the exponent is ready, and used to get the mantissa by canceling out the exponent from the original value.
if (value === 0) return [value, 0];
var data = new DataView(new ArrayBuffer(8));
data.setFloat64(0, value);
var bits = (data.getUint32(0) >>> 20) & 0x7FF;
if (bits === 0) { // denormal
data.setFloat64(0, value * Math.pow(2, 64)); // exp + 64
bits = ((data.getUint32(0) >>> 20) & 0x7FF) - 64;
}
var exponent = bits - 1022;
var mantissa = ldexp(value, -exponent);
return [mantissa, exponent];
}
function ldexp(mantissa, exponent) {
var steps = Math.min(3, Math.ceil(Math.abs(exponent) / 1023));
var result = mantissa;
for (var i = 0; i < steps; i++)
result *= Math.pow(2, Math.floor((exponent + i) / steps));
return result;
}
by Vanessa (noreply@blogger.com) at June 26, 2020 11:43 PM
I'm proud to announce SqueakJS, a new Squeak VM that runs on Javascript:
by Vanessa (noreply@blogger.com) at June 26, 2020 09:08 PM
function GetNow( ) {
return new Date( ).getTime( ) / 1000.0;
}
return ( GetNow( ) - this.start_time ) * this.rate
socket.on( "message", function( message ) {
var fields = message;
….
fields.time = Number( fields.time );
fields.origin = "reflector";
queue.insert( fields, !fields.action );
….
var message = JSON.stringify( fields );
socket.send( message );
Gun.chain.heartbeat = function (time, rate) {Client, which start firstly or create a new virtual world instance, create heartbeat node for that instance and run a metronome (that part could be run on Gun DB instance somewhere on the hosting server, for anytime availability):
// our gun instance
var gun = this;
gun.put({
'start_time': 'start_time',
'rate': 1
}).once(function (res) {
// function to start the timer
setInterval(function () {
let message = {
parameters: [],
time: 'tick'
};
gun.get('tick').put(JSON.stringify(message));
}, 50);
})
// return gun so we can chain other methods off of it
return gun;
}
let instance = _LCSDB.get(vwf.namespace_); //
instance.get('heartbeat').put({ tick: "{}" }).heartbeat(0.0, 1);
let instance = _LCSDB.get(vwf.namespace_);The main point here is the calculation of Croquet time using Gun’s HAM state:
instance.get('heartbeat').on(function (res) {
if(res.tick) {
let msg = self.stamp(res, start_time, rate);
queue.insert(fields, !fields.action);
}
}
this.stamp = function(source, start_time, rate) {
let message = JSON.parse(source.tick);
message.state = Gun.state.is(source, 'tick');
message.start_time = start_time; //Gun.state.is(source, 'start_time');
message.rate = rate; //source.rate;
var time = ((message.state - message.start_time)*message.rate)/1000;
if (message.action == 'setState'){
time = ((_app.reflector.setStateTime - message.start_time)*message.rate)/1000;
}
message.time = Number( time );
message.origin = “reflector";
return message
}
Gun.state.is ( node, property )
message.state = Gun.state.is(source, ‘tick’); // time of updating tick
message.start_time = Gun.state.is(source, ‘start_time'); //start time of the instance heartbeat
message.rate = source.rate;
var time = ((message.state - message.start_time)*message.rate)/1000;
instance.get('heartbeat').get('tick').put(JSON.stringify(newMsg));
by Suslov Nikolay (noreply@blogger.com) at June 25, 2019 10:54 AM
by David A. Smith (noreply@blogger.com) at May 20, 2019 11:16 PM
by David A. Smith (noreply@blogger.com) at April 02, 2019 04:40 PM
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. This is actually possible, 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:
$ mono Contralto.exeContrAlto v1.2.2.0 (c) 2015-2017 Living Computers: Museum+Labs.Bug reports to joshd@livingcomputers.orgYou are at the ContrAlto console. Type 'show commands' to seea list of possible commands, and hit Tab to see possible command completions.>load disk 0 xmsmall.dskDrive 0 loaded.>startAlto started.>
ctrl A ≤ (less or equal)To learn Smalltalk-76, the User Manual is a good starting point:
ctrl B bold
ctrl C user interrupt
ctrl F ≡ (identical)
ctrl G ◦ (index operator)
ctrl I italic
ctrl N ≠ (not equal)
ctrl O ↪ (quote)
ctrl Q ⇑ (return)
ctrl R ≥ (greater or equal)
ctrl S 's (eval operator)
ctrl T ┗ (prompt)
ctrl U ¬ (unary minus)
ctrl X clear emphasis
ctrl / ⇒ (if then)
ctrl = ≡ (identical)
ctrl shift = ≠ (not equal)
ctrl \ ≠ (not equal)
ctrl ] ⌾ (create point)
ctrl [ ◦ (index operator)
ctrl : ⦂ (open colon)
ctrl ' ↪ (literal quote)
ctrl < ≤ (less or equal)
ctrl > ≥ (greater or equal)
shift - ¬ (unary minus)
cursor down doit (in dialog view)
by Vanessa (noreply@blogger.com) at February 13, 2019 08:30 PM
by David A. Smith (noreply@blogger.com) at January 15, 2019 03:22 AM
I just posted the video I made of Virtus Walkthrough. I created this in 1990 with David Easter and Mark Uland. I am actually demonstrating Virtus 4 here. Scott Haynes was responsible for this version, and I think it is the best version of Walkthrough we ever did. It was also, unfortunately the last. The overall design and interaction is almost identical to the original 1990 version, though. This is using a software renderer that I wrote and was greatly enhanced by the team led by Greg Rivera. It uses portals extensively, and though you won't notice it, it does not actually have a z-buffer. The objects are sorted using a kind of BSP thing I did that is extremely fast. I am actually running this on Parallels on an older Macbook, and it feels faster to me than Sketchup 7.1, which I run native. But of course, considering that this had to run in real time on sub-20 mHz 68010 and 68020 machines, this had to be pretty damn fast to work at all.
This is the system I first prototyped the virtual collaboration space in that I showed to Alan Kay. This led to the development of ICE (see previous post), OpenSpace, the Croquet Project, and Teleplace.
Virtus Walkthrough won many awards, including the very first Breakthrough Product of the Year from MacUser Magazine, and the PC Computing Best Drawing Program, where we beat Adobe Photoshop.
Here is the demo:
https://www.youtube.com/watch?v=RKYMZzGPSjM
by David A. Smith (noreply@blogger.com) at September 01, 2018 03:10 AM
---
extends: http://vwf.example.com/aframe/ascene.vwf
properties:
children:
spaceText:
extends: http://vwf.example.com/aframe/atext.vwf
properties:
value: "Virtual World Framework & A-Frame"
textColor: "#b74217"
position: [-2, 2.5, -2]
sphere:
extends: http://vwf.example.com/aframe/asphere.vwf
properties:
position: [1, 1.25, -4]
color: "#e0e014"
radius: 1
wireframe: true
children:
box2:
extends: http://vwf.example.com/aframe/abox.vwf
properties:
position: [2, -1.25, 0]
color: "#2167a5"
depth: 1
sky:
extends: http://vwf.example.com/aframe/asky.vwf
properties:
color: "#ECECEC"
camentity:
extends: http://vwf.example.com/aframe/aentity.vwf
properties:
position: [0, 0, 0]
children:
camera:
extends: http://vwf.example.com/aframe/acamera.vwf
properties:
look-controls-enabled: true
forAvatar: true
children:
cursor:
extends: http://vwf.example.com/aframe/acursor.vwf
by Suslov Nikolay (noreply@blogger.com) at March 23, 2017 09:56 PM
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.
by Vanessa (noreply@blogger.com) at July 04, 2014 08:42 PM
by Suslov Nikolay (noreply@blogger.com) at October 09, 2013 02:02 PM
by Suslov Nikolay (noreply@blogger.com) at July 27, 2013 11:11 PM
by Suslov Nikolay (noreply@blogger.com) at July 27, 2013 10:07 PM
After playing with Flapjax library in Javascript, I moved to Reactive to learn more about FRP. Because research on Functional Reactive Programming is most active in Haskell, I thought it would be better to do that. Reactive seems to be a nice library, but unfortunately I couldn't find many working code examples. So I show some of them as my exercise. To write this, I owe a maoe's great article in Japanese.
(This page has been translated into Spanish language by Maria Ramos from Webhostinghub.com.)As I didn't have much time, I couldn't write a good explanation now. But still I hope it helps some people who learn Reactive like me. I used Haskell Platform 2010 (slightly old) and did cabal install reactive --enable-documentation to install Reactive.
The first example shows "Hello, World!" after three seconds. atTime generates a timer event, and <$> convert this event to IO action (\_ -> putStrLn "Hello, World!") which writes a string.
This is as same as above, but it makes events each second.
This makes running Fibonnaci numbers. You can use scanlE to process previous value and current value of the event in a function. In this case, (0, 1) is the initial value, and when an event occurs, the function \(n0, n1) _ -> (n1, n0 + n1) calculates next value, and the result (the first case is (1, 1)) is used as a next argument when a new event occurs.
It shows characters as you type. It looks difficult but you don't have to worry about run function. The important part is machine :: Event Char -> Event (IO ()) that convert a character input event to an IO action.
This example shows how to merge two events. onType is same as machine in the previous example, and onClock is same as helloMany.hs example. I used `mappend` to merge the two events
This shows a simple state machine. The function next defines the state machine, and mealy_ convert the definition to an event. zipE is another way to merge two events. Unlike mappend, you can see two values in the two events in a same time.
by Takashi (noreply@blogger.com) at April 13, 2013 01:43 AM
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:
http://ss3.gemstone.com/ss/minecraft.htmlSqueak can either run on the Raspberry Pi itself (a VM is already installed) or on another computer in your network.
by Vanessa (noreply@blogger.com) at February 25, 2013 11:42 AM
by David A. Smith (noreply@blogger.com) at January 17, 2013 12:26 AM
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 :)
by Vanessa (noreply@blogger.com) at December 17, 2012 11:49 AM
by Suslov Nikolay (noreply@blogger.com) at April 09, 2012 08:03 PM
by Suslov Nikolay (noreply@blogger.com) at January 25, 2012 08:22 PM
by Suslov Nikolay (noreply@blogger.com) at December 21, 2011 09:32 PM
Functional Reactive Programming (FRP) is a framework to deal with time-varying data in a clean way. It is a combination of beauty of functional programming and dynamics of object oriented programming. The basic principle is easy enough as spreadsheets, however, its vague scope and arcane terminologies keep you from grasping it. It's not quite easy to answer the question such as what makes FRP different from Observer Pattern, Data Flow, etc ??. I think a good way to explain FRP is to compare FRP library against non-FRP library, and I could show you where FRP is special, and pros-and-cons of FRP.
I examined Flapjax as an example of FRP, and took Bred Victor's Tangle as the comparison target. Although Tangle has similar goal of FRP as he wrote "Tangle is a library for creating reactive documents", its implementation is quite different from Flapjax.
Because of those properties, I think comparing the two libraries is helpful to understand what FRP is. I hope it makes clear idea about FRP in your mind.
This is the first example from the Tangle's documentation. You can modify the number of cookies by dragging, and it keeps calculating the calories as you change the value.
When you eat cookies, you will consume calories.
To make this nice reactive document. This document consists with two parts, HTML for the view and javascript for the model.
<p id="tangle" When you eat <span data-var="cookies" class="TKAdjustableNumber" data-min="2" data-max="100"> cookies</span>, you will consume <span data-var="calories"></span> calories. </p>
The HTML part is straightforward, this is just a normal HTML except special attributes for Tangle. Data-var is used to connect HTML elements to Tangle object's properties. Class name TKAdjustableNumber makes a draggable input control. Data-min and data-max are its parameters.
var element = document.getElementById("tangle"); new Tangle(element, { initialize: function () { this.cookies = 4; }, update: function () { this.calories = this.cookies * 50; } });
The actual model of the document is described in the second argument of Tangle object's constructor (new Tangle). It consists with just two parts. initialize sets up the initial state, and update is invoked whenever you modify the input value. Tangle connects the model and the HTML element specified by getElementById("tangle").
This initialize-update structure is fairly common among end-user programming language like Processing and Arduino.
Let's move on to Flapjax. Unfortunately, Flapjax doesn't have a nice input widget as Tangle has. Instead, we use a traditional input field. But other than that, the behavior is identical.
When you eat cookies, you will consume calories.
As Tangle, the Flapjax version has HTML part and Javascript part. Note that Flapjax provides "Flapjax Syntax" which allows you to write a simpler notation, but we don't use it because I want to compare those as Javascript libraries.
<p id="flapjax" class="example"> When you eat <input id="cookies" value="4" /> cookies, you will consume <span id="calories"></span> calories. </p>
Flapjax's HTML part is similar as Tangle's. The element identifiers (cookies and calories) are given by id attributes. Unlike Tangle, the initial number of cookies is written in the input field.
var behavior = extractValueB("cookies"); var colories = behavior.liftB(function (n) { return n * 50; }); insertDomB(colories, "calories");
In Flapjax, time-varying data is called behavior. The goal of the program is to make a behavior which always calculates calories of the cookies. It's not so difficult than it seems. ExtractValueB creates a behavior from a form element, in this case, extractvalueB("cookies") tracks every changes happening in the input field named "cookies". This created behavior is processed by the function at the argument of liftB, in this case, whenever you modify "cookies" field, colories represents a value which is always 50 times by the number of cookies.
Eventually, insertDomB insert the content of colories where HTML element "calories" is and the calories are shown on the screen. This element is automatically updated.
Unlike Tangle, there is no side-effect in the program. One advantage of FRP is that you are not confused between old values and new values. In Tangle's example, this.cookies is old value (input) and this.calories is new value (output). But you are free to be mixed up those. In Flapjax, a new value is always the return value of a function, and there is no chance to be mistaken.
One of advantages of FRP is its composability. You can make a complicated behavior by combining simple behaviors (occasionally, imperative programming gives you a hard time for debugging if the bug involves with connected program modules with side-effects). To demonstrate this feature, I will show you how to make a Tangle-style draggable widget in Flapjax. This problem is particularly interesting because processing drag and drop involves a state machine, but a state machine is not quite fit with a functional programming style. So you might find pros and cons of FRP clearly from this example.
When you eat cookies, you will consume calories.
The HTML part is almost identical except adjustable class in the input field which points a Tangle like (but not fashionable enough) stylesheet.
<p id="flapjax-drag" class="example"> When you eat <input id="cookies-drag" value="4" class="adjustable"/> cookies, you will consume <span id="calories-drag"></span> calories. </p>
The main Javascript part is also similar as above. But in this time, we are implementing makeAdjustableNumber to make a draggable widget from the element named "cookies-drag".
var element = document.getElementById("cookies-drag"); var behavior = makeAdjustableNumber(element); var colories = behavior.liftB(function (n) { return n * 50; }); insertDomB(colories, "calories-drag");
A drag gesture consists of three events, mousedown, mousemove, and mouseup. After a mousedown is detected, it has to track mousemove events to know how far you are dragging. You can make such a state machine to construct a higher order event stream. Here are two new concepts. An event stream is similar as behavior, but it is a stream of discrete events instead of continuous values. But you don't have to worry about that. It's just another object which has slightly different API. A higher order event stream is an event stream of event streams. This is used to make a stream which behavior is switched depends on the input.
This mouseDownMove makes a higher order event stream that tracks mousedown and mousemove. extractEventE(element,"mousedown") extracts mousedown event in the element. When the event signaled, the function inside the mapE is evaluated. MapE is similar as liftB but it is only for an event stream. Inside the function, extractEventE(document,"mousemove") find mousemove events and track the distance from mousedown. Note that I used document to find the event because occasionally you drag a mouse to outside the widget.
function mouseDownMove (element) { return extractEventE(element,"mousedown").mapE(function(md) { var initValue = parseInt(element.value); var offset = md.layerX; return extractEventE(document,"mousemove").mapE(function(mm) { var delta = mm.layerX - offset; return Math.max(1, Math.round(delta / 20 + initValue)); }); }); }
We need to handle mouseup event also. The mouseUp function returns a higher order event stream that find mouseUp event and the zeroE happily does nothing.
function mouseUp (element) { return extractEventE(document,"mouseup").mapE(function() { return zeroE(); }); }
And these two event stream make by mouseDownMove and mouseUp are going to be merged by the mouseDownMoveUp function to complete a mousedown, mousemove, and mouseup cycle. MergeE is used to merge two events streams. We need one more step switchE to convert a higher order stream to a nomal stream, in this case, a stream of numbers (distance).
function mouseDownMoveUp(element) { var downMoveUp = mouseDownMove(element).mergeE(mouseUp(element)); return downMoveUp.switchE(); }
Finally, we connect the event stream into an HTML element. Here I did slightly dirty work. Whenever a drag gesture happens, the element.value attribute is set. Probably using insertDomB to make an output element is cleaner way, but I chose this dirty way to make it simple. At the last line, the event stream is converted to a behavior object by startsWith. And that's how makeAdjustableNumber is implemented.
function makeAdjustableNumber (element) { var drag = mouseDownMoveUp(element); drag.mapE(function(n) { element.value = n; }); return drag.startsWith(element.value); }
Honestly, Flapjax doesn't seems to be too easy to use. But part of the reasons might be that I chose to show a plain Javascript syntax to introduce the mechanism. Flapjax also provides its own compiler which provides cleaner syntax. This Flapjax syntax should improve readability a lot. Anyway, I hope this short note helps you to grab a brief idea of Flapjax and FRP.
by Takashi (noreply@blogger.com) at December 06, 2011 09:12 AM
by Suslov Nikolay (noreply@blogger.com) at November 14, 2011 07:27 AM
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:
by Vanessa (noreply@blogger.com) at November 01, 2011 01:31 PM
Bret Victor came to our office yesterday, and we had a great chat. He is a great thinker and has a beautiful sense about visualizing abstract ideas. I really like his works. I want to learn his idea more, but as a starter, I tried to implement his early famous Alligator Eggs! game. This game was made to teach about lambda calculus to eight years old kids. But it's even more fun to adult hackers!
This is a green alligator and her egg. This family shows a lambda expression λx.x (because I know you are not an eight years old, I use formulas without hesitation!). There is a no animation as there is nothing to eat.
But things are getting fun when there is something to eat before the alligator mother. In this case, a blue egg. If you click on the diagram, you see what's happening (I only tested Chrome, Safari, and Firefox). The alligator eats the poor blue egg. But price for the sacrifice is too high. The mother will die, and we will see the new baby.
And then, things are getting curiouser. The new baby doesn't look like the mother at all, rather it is like a blue egg, the victim of the slaughter. What's a amazing nature of the lambda land!
This is slightly a hard example. There are two alligators "x" and "y", and two victim eggs "a" and "b" on the right side. If there are more than two things next to an alligator, the alligator eats left one first (it is called as left associative in jargon). Can you guess what does happen after the meal? Alligator "x" eats egg "a", and alligator "y" eats egg "b". And only egg "a" survives (because it transmigrates through the green "x" egg).
You can think that this alligator family (λx.λy. x) eats two things and leave the first one. In a same way, can you think of an alligator family which eats two things and leave the second one? Here is the answer.
There are a few things to know more. Old alligators are not hungry. But they keep guarding their family while they guard more than one things. They behave like parenthesis in a lambda expression.
This rule is the most tricky one. There are two blue alligators "y" at left and right, but those two are not in a same family. The only mother of the blue egg "y" is the right one. It gets trickier when the family is eaten by the green alligator because the blue family is reborn at the green egg is, where is bottom of another blue alligator. To make them different, the right blue family change the name and color to "y1" and orange.
By these rules, you can make various kinds of alligator ecosystem. This is my favorite one. (λx.x x) is called a "Mockingbird" or, rather we should call it Mockingalligator. It doubles its prey twice. So what happens if a mockingalligator eats a mockingalligator? The result is called one of omegas, an infinite loop. They are eating forever. To stop the endless violence, please click the diagram again. But please do not to click three times! Because of my bug, something wrong will be happening.
This is dangerous but beautiful one. The omega ecosystem above kills each other but it doesn't make any, but this Y combinator is very fertile. It produce many, so you have to watch it carefully, otherwise it consumes all the CPU power you have eventually!!
Actually, alligators also can do serious jobs. If you design carefully, you can teach them how to calculate 3 + 4! In this example, the middle family represents three and the right family represents four (count green eggs). And the result is a family with seven green eggs! This is called Church numbers (I don't have a time to explain the theory, so please read the link).
I only introduced very few alligator families. If you want play it, visit http://metatoys.org/alligator/ and design by your self. You can also download from http://github.com/propella/AlligatorEggs. The source code is messy because I haven't written javascript recently, but I'll clean it up soon.
by Takashi (noreply@blogger.com) at September 23, 2011 02:51 AM
http://metatoys.org/demonCastle/
If you have played with Etoys, you might have seen The Etoys Castle (or The Demon Castle) tutorial. But you would never know how the story ends, because the Etoys distribution only includes the first chapter, and the last slide shows "To Be Continued ...". However, there are actually the hidden sequels, and the story has a happy ending.
When I first wrote the story in 2006, there were three chapters. The first chapter was about learning "handles", the second one was about the painter, and the third one was about scripting. But due to some technical issues, I gave up to publish them. Today, I happened to clean up my hard drive and I found old files. It's shame that I have never published rest of them. So I gathered the screen shots and made up one page html.
by Takashi (noreply@blogger.com) at July 10, 2011 02:24 AM
Tinlizzie Wiki is a wiki written in Tweak. It uses OpenDocument Format (ODF) as data format, and WebDAV as server.
Although data format in StackWiki was Squeak specific binary, In Tinlizzie Wiki existing common format is used. A part of reason why I choose ODF was that it was a research project to find a possibility to exchange eToys content among different platform. So it was necessary to find platform independent and transparent format. ODF, especially its presentation format, was quite close to my demonds which are a) text based b) enable to embed graphics c) enable to use original element d) internal and external link supported.
A ODF file is just a zip archive which includes XML text and multimedia binary files. And it is easy to extract image file in a project by an another tool. Both embeded object and external resource can be represented by common URL notation. And if necessary, new tag for Tweak specific object can be used. For example, a project which includes fully dynamic behavior written as Tweak objects can be viewed on ordinary OpenOffice Org application, although dynamic feature would in it be disabled.
To export Tweak object to ODF as natural as possible, special care was needed to save. It is not the best way to define a new tag for Tweak specific object even though it is possible. It was preferable to map from Tweak to ODF properly. For example, if a Book object in Tweak is stored as a presentation within frame in ODF, the project looks somewhat more normal even on other application.
There is a issue how much detail information is needed to save an object. For example, if a text is saved during its editing, whether if position of the cursor should be saved or not?? There are two strategy in terms of implementation. One is to save everything except specified status (deep copy), another one is to save only specified status. Tinliziie Wiki adopted the latter one although Squeak and Tweak native serialize mechanism were the former.
Saving only specific status has two disadvantages. a) A user might expect to save everything including minor information because combining arbitrary objects in even any peculiar way is possible in Tweak. b) Each new widget needs to implement each exporter. But "saving everything by default" strategy has a problem of compatibility because even just one change of variable name makes trouble for old version. Especially it is problematic for sharing in Internet. So I din't choose this strategy.
WebDAV is used as the server. Both StackWiki and Tinlizzie doesn't need server side logic, but simple storage is required. WebDAV is the best option for that matter. Even version control system can be plugged in the server with Subversion modlule in Apache for free,
Javascript Workspace is a simple web application. It uses bare Javascript on client, and Ruby CGI on server. It behave like a Smalltalk Workspace, and the contents are managed same manner as Wiki.
Let me make sure about workspace again. Workspace is a text editor, and it has two additional commands "do it" and "print it". Do it command envokes a source code selected by user, and print it command output the result into cursor position. The function is similar to REPL shell on dynamic language, but the use case is slightly different. A typical way to use workspace is as an explanation of program. An author writes example source code inside the documentation, so that a user can try actual function while reading a text. Namely, REPL is two ways dialog between a machine and a human, but workspace is tree ways conversation among a machine, an author, and a user.
Workspace is indispensable tool for Smalltak though, which doesn't mean only for Smalltalk. It would be nice if there is a workspace for Javascript language. This was the initial motivation of Javascript Workspace. And then, it was a natural consequence that Wiki was used to save the content because Javascript lives on web browser intrinsically, and there are no way to save to local disk.
During the development, however, I realize that it can be more than just a workspace in terms of media. Javascript workspace has only simple user interface, which includes a couple of buttons and one big text area. Even there are no hyper link nor emphasized text. But variety things can be happend from such minimal configuration by source code. Hyper link is enable to make from location property, rich text can be shown to modify DOM tree, and even game can be made to set up event hander. Source code can do everthing.
Just one textbox on a web page is a very radical idea. This is completely opposite direction to current trend of rich internet application. Web application consists with number of hidden functions these days, but Javascript Workspace can not have any invisible information. Everything what it does is shown to you as source code entirely on the screen. Javascritp Workspace looks like dangerous as it runs any Javascript code, but in fact, it is a quite safe system.
The idea of uset interface of Javascript Workspace is adopted to OMeta/JS.
TileScript uses Scriptaculous as GUI library and WebDAV for server storage. JSON is used for its data format.
A TileScript document consists with one or more paragraphs, and a paragraph is either Javascript code, "tile script", or HTML expression. A tile script is set of tiles, which each tile represents some syntactical element in a programming language. A user can connect tiles to construct a program with drag and drop. This is an easy way to make a program avoiding syntax error. Javascript is used to represent more complicated program than tile script. And HTML is used as annotation. It can be seen as rich version of Javascript Workspace.
The initial motivation of TileScript was to remake eToys on the web environment. The research had got started by making tile available on web browser. I considered to use Lively Kernel (SVG), but it was unnecessary if Table element in HTML DOM is used as tile. Scriptaculous is used to keep the source code simple.
After tile is ported, then next step was eToys environment itself which includes event handling, scheduling, and bitmap animation, etc. But those issues seemed too difficult for nature of web document.
Flow layout, which actual position of document elements are dynamically changed by reader's browser environment, is a significant feature of web. An author don't specify concrete position of elements, but rather care about logical structure. And then, a part of document which can not be shown on the screen is accessable by a vertical scrool bar.
On the other hand, eToys provides page layout, which size and position of elements is fixed, and presume particular screen size. Althogh, it is quite fit as a metaphor of physical paper, and best for a graphical environment like eToys, but clumsy operation like zooming and horizontal scrool is required.
Because ultimate goal of TileScript was not just reinventing eToys, but investigating further possibility, flow layout is adopted to TileScript. But still absolute coordination can be supported in form of embeded object even in flow layout. TileScript provides variable watcher like eToys, but those widget is also layouted along with flow.
Now I'm working on next version of Javascript Workspace, which especially its target application is Active Essays. Our group have found that Javascript is quite reasonable tool to show some ideas of computer science. One reason is language's simplicity, and other one is easiness of collaboration. We have a lot of new ideas about programming language, and some of the part should be simple enough to understand even by junior high student. I believe my tool can be used to explain such ideas.
The problem is any project intoroduced here is not intended for real use, rather just for demo or prototype of further real development. So it is not be so useful as it looks because it includes too experimental aspect, too fragile, or too slow. Now I'm thinking that it is not bad idea if I make somewhat stable version of them. Even it might not have exotic feature like tile script, but only basic and simple functions are enough to play with everyone. I really like my first idea of Javascript Workspace, which has only simple text. I admit it is extreme, so next version might support emphasized text and inline image (basic HTML elements) at least.
by Takashi (noreply@blogger.com) at June 30, 2011 09:54 PM
Glad to invite everybody to register for exploring now the OpenQwaq's collaborative 3D forums using Krestianstvo SDK2 and ongoing Krestianstvo's 2 forums (CCSE, Learning math, Collaborative music, Art disks, ect.) in near future.
The registration page is available online now for all: http://www.krestianstvo.ru/register (RU: http://неучи.рф/регистрация ).
As soon as you get the Login and Password, you could enter into the collaborative 3D forums anywhere through the internet. But for that you'll need to download the new version of SDK.v.2.0.2: here or using an alternative link, or update the 2.0.1 one (Monticello repository here: http://krestianstvo.ru:8888/sdk/Monticello/sdk2/).
The main feature of the new 2.0.2 SDK is the new database storage logic, entirely based on XML and taking away the ODBC/MySQL usage. So, the OpenQwaq's service provider (not the Local's one) use the XML based db just as MySQL db, while storing it in Smalltalk class variable and serializing it's tables onto disc with plain XML files. That scenario is suitable for local and internet servers, thus turning OpenQwaq onto really mobile platform. Another feature is directed against Apache/PHP, meaning the coal/web/forum services running on :9991. So, the first step you could look at working online registration on Krestianstvo site and next will be having all admin pages using just Javascript and Ajax, hosted on the same Smalltalk image.
See you in the forums!
by Suslov Nikolay (noreply@blogger.com) at June 18, 2011 10:39 PM
OpenQwaq is the most awaited framework in the virtual world's development domain!
Four years left after the latest OpenCroquet release and OpenCobalt has done a lot to bring virtual worlds closer to life, but OpenQwaq set the final point!
Now anybody could set up it's own virtual space or forum and do not worry about the underlying network architecture, just create Forums, create content for them and place on the servers through the web and collaborate.
So, everything looks just fine, but... to start own server on LAN or WAN someone need to install Linux, Apache, PHP, MySql and OpenQwaq server itself following config rules and avoiding the pitfalls.
But hey? We are in Squeak/EToys platform, Smalltalk at last.. in the self-contained environment, so why all these third-party tools a needable? (Yes, for: Security reasons, Application services, Streaming, account politics ect). But in learning situation at classroom or in Art gallery during installation all of these features are not too critical.
I decided to explore, how it is possible to have just One-Click OpenQwaq image with server and client on it, that could run as internet or local server or just a client. Image, that in a few clicks could be used by children setting up the classroom's network or artists making performance / installation.
And the Krestianstvo SDK 2.0 as experimental platform was borned!
Comparable to OpenQwaq, I started Krestianstvo2 with only one image for server and client versions (the server one based on Squeak 4.2).
The aim is to start the server with no need of installing any other third party applications (apache, mysql). Of course, some (a lot of) features of OpenQwaq could not be available in such scenario, but the work is in progress...
In the current version, anybody could easily setup the running server on LAN or WAN (the server http://www.krestianstvo.ru has already running the same image as provided for download).
SDK is developed on top of OpenQwaq, so that no part of the original OpenQwaq code in image is modified from the functional point of view. So, SDK image allows to run OpenQwaq Forums just in pure mode. Nevertheless, for localization purposes the String method #translateMe was introduced and was injected into OpenQwaq code for the most of string's objects. Translation process is still in progress too.
SDK works with Russian language support by default!
----------
Try out the running space!
The demo logins and passwords, that's working on krestianstvo.ru
Login: member
Password: member
Organization: krestianstvo
Server: kresianstvo.ru
Login: guest
Password: guest
Organization: krestianstvo
Server: kresianstvo.ru
-----------
You could add as new members and new groups in setup, visually.
In main login screen use right mouse button to have the context menu and select: "Add new user...".
Example connection scenario:
1. On the 'A' host you start Krestianstvo with as server (type instead of krestianstvo.ru the in the 'Server:' field).
2. On the 'B' host you start Krestianstvo with IP address of 'A' host as server.
3. Then try to login with l: admin/p: admin (l: member/ p: member) accounts (or add new members in 'A' host (on the main login screen, where is proxy configuration dialog).
So, in final it will be good to have: CoalServices working with local storage database in memory (instead of mysql) with Smalltalk WebServices front-end (instead of apache/php).
The project page: http://www.krestianstvo.ru/main
Monticello: http://www.krestianstvo.ru:8888/sdk/Monticello/sdk2/
Download the image: http://krestianstvo.googlecode.com/files/Krestianstvo2.0a.zip
by Suslov Nikolay (noreply@blogger.com) at May 16, 2011 10:22 PM
by Suslov Nikolay (noreply@blogger.com) at March 09, 2011 08:07 PM
Here is a video from the recent event, which was held in the "Museum of Science" (Russia, Vologda), where the Multi-touch table based on Krestianstvo SDK was shown. The table is controlled directly by Krestianstvo virtual space and it's objects shared on the Croquet island. So, several such tables could be organized into p2p network and become a really interactive classroom, programmable just in Smalltalk. For recognizing reacTIVision fiducial markers and TUIO protocol are used (based on Simon Holland TUIO for Squeak work). For music synthesising SuperCollider through OSC is connected, using the idea from SCIMP (SuperCollider Server client for Impromptu) and realized in Smalltalk.
by Suslov Nikolay (noreply@blogger.com) at December 28, 2010 08:53 PM
Want to share my early experiments with the novel controller from Microsoft: Kinect, fine working in Krestianstvo SDK (based on Smalltalk dialect Squeak/Croquet). Here you could find an interesting list of projects and ideas already evolving using Kinect in different programming languages (c, c++, of, max/msp, processing. java, ect.)
But, why not in Smalltalk?.. And in pure 3D Virtual Space (Croquet), controlling your Avatar with own body and operating on objects just with own hands..
So, using OpenKinect driver, I prepared the plugin KinectSqueak.framework and the changeset for Krestianstvo (source code is avaliable here) with Mac OS X support only for now (Window will be very soon). The latest downloadable SDK is also include Kinect support, so just download it and try the sensor, if you have one..
Happy Kinecting!
by Suslov Nikolay (noreply@blogger.com) at November 26, 2010 01:04 AM
Happy to announce an October update of Krestianstvo SDK with it's main feature:
World serialization support
Meaning, that one could freely save a current work, being done in active space and then restore it at any time later. The spaces are saved into OWML text file format (check them in Resources/resources/MySpaces folder).
In the next post, I will write an introduction to this new format. Briefly to say, it is mainly based on Sophie XUL and partially C3X serialization logic.
Some other features: new objects (Text3D), Seaside and Squeak base image update, Cog VM update, UTF-8 encoding is default in Mac VM now.
Happy serializing!
by Suslov Nikolay (noreply@blogger.com) at October 25, 2010 09:52 PM
Tamacola is not just another LISP language, it is designed as a meta-language to make a new language. I'll explain this feature today. Today's goal is to design a subset of lisp language. If you think that a lisp is too simple to keep your passion, sorry, be patient, simple thing first.
make run-exampleIt runs all of the examples in the Tamacola distribution as well as recompile the compiler. If you don't find any error, you are ready to go. Otherwise, please let me know the problem.
$ tamacola - Cola/Tamarin > (+ 3 4) 7You can also give Tamacola source files as well as compiled binary names. Typically, source code ends with .k, and a binary ends with .abc. Tamacola is smart enough to detect newer file between .k and .abc.
Suppose you are on some working directory, and you have already set PATH environment to the bin/ directory. And then, we are going to write a very simple language, greeting:
;; greeting.g - A simple PEG example greeting = "morning" -> "Good Morning!" | "evening" -> "Good Evening!"
This stupid example answers "Good Morning!" if you say "morning", and it answers "Good Evening!" if you say "evening". This PEG syntax is easy to understand. The right hand side of = is a rule name. A rule name is translated as a function once it is built. -> means an action rule, where if the left hand is matched the right hand side is returned. | is an Ordered options. In this case, the parser tries the first case "morning", and tries the second case "evening" only if the first case fails.
Save this syntax named "greeting.g". To test this language, type those commands:
$ mkpeg greeting.g $ tamacola greeting.k - compiling: greeting.k Cola/Tamarin > (parse-collection greeting "morning") "Good Morning!" > (parse-collection greeting "evening tokyo") "Good Evening!"
Mkpeg command converts grammar file (greeting.g) to tamacola source (greeting.k), a rule "greeting" the result can be read by tamacola shell. Greeting.k is built on the fly and the command prompt is shown.
Parse-collection's first argument is a parser name (in this case "greeting"), and the second is a input collection. As the name implies, it accepts any collection as the input stream.
The second case shows an interesting property of PEG syntax. Although the second rule matches the beginning part of the input "evening tokyo", still the input remains more string " tokyo". PEG doesn't care if the input is competely consumed or not. If you really want to make sure that the entire input is matched, you need to explicitly tell the Parser the point where end of the file.
The last example only matched a predefined constant, but we make a parser for any integer number here.
;; number.g -- A number parser digit = [0123456789] number = digit+
We also convert the grammar specification into the tamacola program, but in this case, we give -n option to tell the namespace. A namespace is useful when you want to use a common name as a rule name like "number". Because "number" is already used in the system, you can not use it without namespace.
The grammar itself is easy to understand if you have an experience with regular expressoins. Brackets ([]) matches one of characters inside, and postfixed plus (+) repeats previous expression with one-or-many times.
$ mkpeg -n number number.g $ tamacola number.k - compiling: number.k Cola/Tamarin > (parse-collection number/number "xyz") FAIL > (parse-collection number/number "345") {token-group: (53 52 51)}
Because we use the namespace "number", we need specify the namespace before slash(/) in the function name.
As you might notice, this parser correctly rejects a non-number like "xyz", and accepts "345". But the result is not so useful. The return value of plus is a special object named "token-group", but we would want a number represented by the string, instead. So we put a conversion function to get the value.
number = digit+:n -> (string->number (->string n))
$ tamacola number.k - compiling: number.k Cola/Tamarin > (parse-collection number/number "345") 345
Now parser returns a number conveniently. Perhaps you might think that it is somewhat cheating. As the string->number function itself is a kind of number parser, we should have write a number parser without string->number! Yes we could. But it leads more interesting topic about left and right recursion, so I leave it for later.
Now we are going to write a parser for almost real S-expression. This parser can only handle number and list, but it is useful enough to explain the essence of Tamacola.
;; sexp.g ;; Lexical Parser spaces = [ \t\r\n]* digit = [0123456789] number = digit+ :n spaces -> (string->number (->string n)) char = [+-*/abcdefghijklmnopqrstuvwxyz] symbol = char+ :s spaces -> (intern (->string s)) sexp = symbol | number | "(" sexp*:e ")" -> (->list e)
In this grammar, only new operator is the postfix star (*) which repeats zero-or-many times. Rest is straightforward. To test this grammar, we use Tamacola's simple test framework. Writing test case is better than the interactive shell, because you don't have to type same expression many times.
;; sexp-test.k (check (parse-collection sexp/spaces " ") => 'SPACES) (check (parse-collection sexp/digit "0") => 48) (check (parse-collection sexp/number "345") => 345) (check (parse-collection sexp/char "a") => 97) (check (parse-collection sexp/symbol "hello") => 'hello) (check (parse-collection sexp/sexp "345") => 345) (check (parse-collection sexp/sexp "hello") => 'hello) (check (parse-collection sexp/sexp "(hello world)") => '(hello world)) (check (parse-collection sexp/sexp "(3 4)") => '(3 4)) (check (parse-collection sexp/sexp "(print 4)") => '(print 4))
The check function comes from SRFI-78. This function complains only if the left hand value and the right hand value differ. Otherwise, does nothing. I like this UNIX stile conciseness.
As a convention, a test program is added a postfix "-test" with the main program's name. I borrowed this custom from Go language.
Make sure this program do nothing.
$ tamacola sexp.k sexp-test.k
The PEG parser can handle any list structure as well as string. It allows you to write compiler in PEG. In a string parser, the input is a string and the output is some object (a list in our case), but in a compiler, the input is a lisp program and the output is a assembler code.
;; Compiler arity = .*:x -> (length (->list x)) insts = inst* :xs -> (concatenate (->list xs)) inst = is-number:x -> `((pushint ,x)) | is-symbol:x -> `((getlex ((ns "") ,(symbol->string x)))) | '( '+ inst:x inst:y ) -> `(,@x ,@y (add)) | '( '- inst:x inst:y ) -> `(,@x ,@y (subtract)) | '( '* inst:x inst:y ) -> `(,@x ,@y (multiply)) | '( '/ inst:x inst:y ) -> `(,@x ,@y (divide)) | '( inst:f &arity:n insts:a ) -> `(,@f (pushnull) ,@a (call ,n))
There are some new elements in the grammar. Quoted list '( ) matches a list structure, and a quoted symbol matches a symbol.
A prefix ampersand (&) prevents to consume the stream even if the rule matches. For example, &arity rule examine the rest of the list, but the contents are matched again by the insts rule later.
Is-number is matched against number, and is-symbol is for a symbol. Those rule can not be described as PEG grammar, but as a lisp function.
(define is-number (lambda (*stream* *parser*) (if (number? (peek *stream*)) (begin (set-parser-result *parser* (next *stream*)) #t) #f))) (define is-symbol (lambda (*stream* *parser*) (if (symbol? (peek *stream*)) (begin (set-parser-result *parser* (next *stream*)) #t) #f)))
A rule is a function which receives the stream and the parser (an object which store the result). The rule function returns #t if it matches, and #f if it fails.
I think it is easier to see the test code than read my explanation.
(check (parse-collection sexp/arity '(a b c)) => 3) (check (parse-collection sexp/insts '(3 4) => '((pushint 3) (pushint 4))) (check (parse-collection sexp/inst '(3)) => '((pushint 3))) (check (parse-collection sexp/inst '((+ 3 4))) => '((pushint 3) (pushint 4) (add))) (check (parse-collection sexp/inst '((f 3 4))) => '((getlex ((ns "") "f")) (pushnull) (pushint 3) (pushint 4) (call 2)))
We still need a little bit to construct a real assembler code. This detail topic is out of the context, so I simply show the code.
program = inst:x -> `(asm (method (((signature ((return_type *) (param_type ()) (name "program") (flags 0) (options ()) (param_names ()))) (code ((getlocal 0) (pushscope) ,@x (returnvalue)))))) (script (((init (method 0)) (trait ())))))
And the test case.
(check (parse-collection sexp/program '((print 42))) => '(asm (method (((signature ((return_type *) (param_type ()) (name "program") (flags 0) (options ()) (param_names ()))) (code ((getlocal 0) (pushscope) (getlex ((ns "") "print")) (pushnull) (pushint 42) (call 1) (returnvalue)))))) (script (((init (method 0)) (trait ()))))))
You can read the entire program in example/sexp.g in the Tamacola distribution. To try the program, please enter:
make -C example test-sexp
We left an interesting topic about left and right recursion. Let me show you our number parser again.
digit = [0123456789] number = digit+:n -> (string->number (->string n))
If we don't want to use string->number function, I would write the parser as:
;; Use fold-left digit1 = [0123456789]:d -> (- d 48) number1 = digit1:x digit1*:xs -> (fold-left (lambda (n d) (+ (* n 10) d)) x (->list xs))
Digit1 rule converts the ascii value of the the digit character, and number1 rule construct a decimal number. As you see, you need to use fold-left function to construct a number because a number notation is essentially left recursion. For example, a number 34567 actually means:
(((3 * 10 + 4) * 10 + 5) * 10 + 6) * 10 + 7
However, PEG parser doesn't parse left recursion grammar in general. So I had to reconstruct the left recursion structure by fold-left. This is not hard at all if you familiar with functional programming. In functional programming, a list is considered as a right recursive data structure and it is even natural that a list is parsed by a right recursive way. However, I admit that it looks awkward for some people.
Yoshiki Ohshima provides a very useful extension to support a direct left recursion. To use his extension, the number parser is written as:
;; Use left-recursion digit2 = [0123456789]:d -> (- d 48) number2 = number2:n digit2:d -> (+ (* n 10) d) | digit2 number2s = number2
You need to load runtime/peg-memo-macro.k to use this extension.
$ tamacola ../runtime/peg-memo-macro.k number.k - Cola/Tamarin > (parse-collection number/number2s "345") 345
The real parser and compiler are bigger than presented grammars here, but I explained all of the essential ideas. I hope it helps you to make your own language!
by Takashi (noreply@blogger.com) at October 04, 2010 09:38 PM
![]() |
This year's conference logo was designed by my good friend Patty Gadegast. |
![]() |
Photo by Bert Freudenberg |
Photo by Adriaan van Os |
![]() |
Photo by Bert Freudenberg |
![]() |
Photo by Bert Freudenberg |
![]() |
Photo by Bert Freudenberg |
Photo by Adriaan van Os |
![]() |
Photo by Adriaan van Os |
![]() |
Photo by Adriaan van Os |
![]() |
Photo by Adriaan van Os |
![]() |
Photo by Adriaan van Os |
![]() |
Photo by Adriaan van Os |
![]() |
Photo by Adriaan van Os |
![]() |
Photo by Adriaan van Os |
![]() |
Photo by Adriaan van Os |
![]() |
Photo by Adriaan van Os |
![]() |
Photo by Adriaan van Os |
![]() |
Photo by Adriaan van Os |
by Vanessa (noreply@blogger.com) at September 24, 2010 01:47 PM
I have published the source code of Tamacola, a lisp compiler which runs on Adobe Flash / Tamarin VM (or Adobe Virtual Machine 2) http://github.com/propella/tamacola. I'm pretty sure that the current version is useless if you are just looking for a lisp implementation on Tamarin (las3r and scheme-abc are much better), but Tamacola includes abundant tips if you are interested in making a self-hosting compiler on Tamarin VM. That's why I decided to publish it as-is.
I'm also working on a presentation slide for S3 conference http://www.hpi.uni-potsdam.de/hirschfeld/s3/s3-10/ to show it. I'm writing random thoughts about the compiler here so that I will compile them to a thread of talk.
I've already written the motivation on the paper (perhaps I will paste the URL in a month) so I don't repeat it. But in short, I wanted make a tiny language which bootstraps and runs on Adobe Flash.
A tiny language and bootstrapping seem contradicting idea as bootstrapping requires various language functions which tends to be large. On the other hand, this is practically a nice constrain because it keeps the language from too simple or too fat. Choosing Scheme like language as a target is natural to me because I wanted to concentrate basic implementation technique instead of language design.
Well, as one reviewer of the paper said, this is not particularly surprising or dramatically different in comparison with previous systems in the area, but some of the stories from the compiler should interest you!
In the beginning I created the assembler. Honestly, I wanted to avoid the task because writing assembler seemed not quite an interesting job. But in that time, I couldn't find a nice AVM2 assembler that suite my project. So I've done it. In retrospect, this was not bad at all. I could understand what avm2overview.pdf (the AVM2 specification) said quite well, and I got self confidence.
I wrote my assembler in PLT-Scheme because Ian Piumarta's COLA (Tamacola was supposed to be written in COLA and Tamacola itself, I'll tell you this later) is not finished yet in that time and Duncan Mak, a friend of mine, recommend it. This was actually a good choice. This is my first Scheme application and PLT's good documentation helped me a lot.
An interesting part of PLT-Scheme was it encourages a functional programming style, even PLT doesn't suppport set-car! and set-cdr! in the default library. So it was natural that my assembler was written without side-effect except I/O. This is the first key of the development of the assembler. Unfortunately, because Tamarin doesn't support tail-recursion optimazion and Tamarin's stack size is small, I gave up to eliminate all side-effect later. But the implementation was pure functional up to the time, and it was quite clean.
Indeed, it had to be clean considering boot-strapping. I wanted to make the assembler run in my language itself even before enough debugging facility is not ready. If it were not clean, a tiny bug would cause a few days of debugging. I avoided the nightmare with a functional style and Test Driven Development.
Test Driven Development is the second key. I virtually wrote every test case for each function even if it looks silly. Scheme has a couple of options of testing frame work. I chose SRFI-78. It only report assertion failer only something happen, otherwise it keeps silence. I somewhat like this UNIX taste terse.
The third key was to write an assembler and a disassembler in a same time. It sounds like an unnecessary job because I only needed an assembler eventually. But I had to analyze an output from asc (an asembler in Adobe Flex) and learn how an ActionScript program was converted to the Tamarin byte-code. The disassembler was very helpful to read the byte-code as well as debugging. If output of the disassembler generates the original byte-code by the assembler, there is high chance that my imprementation is correct, unless my understanding is wrong.
The assembler is named ABCSX http://github.com/propella/abcsx and it was ported to Gauche, COLA, and Tamacola later. I ported it to Gauche because I was curious about portability of Scheme language.
I had realized there are many places where I could reduce code redundancy in the assembler. An assembler tends to include repetitive process, but some of them are not quite captured well by function abstraction. I would be effective to apply macro and domain specific language in those part. I didn't have tried to solve it yet, but I want to solve it later.
(to be continued)
by Takashi (noreply@blogger.com) at September 24, 2010 07:51 AM
After I made the Tamacola compiler written in COLA, next thing to do was to implement it in Tamacola itself. A language is called self-hosting if the language is written in the language itself. This implies various advantage.
First, once self-hosting is done, you don't need to use COLA anymore, you can improve or modify any language aspects on Tamarin VM. If I carefully design the environment, it would be possible to do language design only on the Web browser (it needs server side help for security reason, so it hasn't done yet).
Second, self hosting is a benchmark for the language to tell that it is good enough. Scheme is especially simple language, so there are a lot of people who implement toy-Scheme. But because my Tamacola is now self-hosting, I could proudly claim that this is not a toy! Well, this is rather self satisfaction, though.
Third, it provides a rich library including "eval" function. A compiler uses various programming techniques, and those must be useful for other programs, too.
To make it self-hosting, there were two key problem which are macros and eval.
I heavily used macros in my compiler, for example, the parser written in PEG was converted a bunch of macro expressions. The problem is, expanding macros requires eval function but I wasn't able to make eval before the parser was done. It's a deadlock! Here is a typical macro written in COLA:
(define-form begin e (cons 'let (cons '() e)))This is how the macro works. When the compiler find a expression like:
(begin (print "Hello") (print "World"))Expressions inside
begin
is bound to e
, the
body (cons 'let (cons '() e))
is executed in compile time
and the expression is expanded to:
(let () (print "Hello") (print "World"))
Such expansion is impossible without eval function because the
compiler need to evaluate a list (cons 'let (cons '() e))
given by user. What I would do when I didn't have eval yet. But I
realized that macros only include basic list functions like car, cdr,
and cons in many cases. And a more complicated macro could be hard
corded as a special form in the compiler. So I invented a pattern base
macros.
(define-pattern ((begin . e) (let () . e)))
Basically this is a subset of Scheme's syntax-rule. If the compiler
finds an expression starting with begin
, rest of the
expression is bound to e
and substituted as a right hand
side. Those expansion requires only limited set of list functions, so
the compiler doesn't have to provide full eval function. This macro
syntax made my compiler readable, and I was able to continue happily.
Even after I implemented more dynamic traditional macro with eval function, I keep using this pattern base macros mainly.
To implement eval function, you need to understand the dynamic code loading facility provided by the VM. Note that this is not part of AVM2 specification, and Avmshell (a console Tamarin shell program) and Adobe Flash have different API.
Avmshell has straightforward API. You give compiled byte code, and the function returns the value. Because Tamacola is now written in Tamacola, you can invoke the compiler as a library function and get byte code you want to execute.
avmplus.Domain.loadBytes(byteArray:ByteArray)
You can get the domain object by Domain.currentDomain() static method.
Those useful functions in Avmshell are found shell/
directory in the Tamarin-central repository.
Flash Player has somewhat tricky API for dynamic code loading. The signature is normal.
flash.display.Loader.loadBytes(bytes:ByteArray, context:LoaderContext = null):void
There are two problems for our purpose. First, this method is not designed mainly for dynamic loading, it only accepts SWF, JPG, PNG, or GIF files, and byte code happen to be accepted inside a SWF file. So I had to construct SWF file to load code. In case if you don't know about SWF file, SWF file is a kind of container format. You can embedded vector graphics, mp3 sounds, and ActionScript byte code. Making a SWF file is not particularly difficult though, it needs nasty bit fiddling.
Second, this is far more problematic, is that this method works as asynchronously. In other words, this doesn't return the result value. Instead, you need to give it a callback function to wait to finish the code. Additionally, this method doesn't return value at all, so if you want the return value, you need to setup some explicit return mechanism by yourself.
Practically, this cause a problem if you want to write a traditional macro definition and use the macro in a same source code. Because a traditional macro need to evaluate a lisp expression in a compile time, but the eval function doesn't return before the compilation thread is done. I could solve the problem by setting up compilation queue or something, but it would cost performance penalty which I don't want. And now I simply gave up.
I have explained pretty much all interesting aspect of the self hosting compiler. I'll talk about how to make a new language on the Tamacola environment later.
by Takashi (noreply@blogger.com) at September 16, 2010 05:47 AM
Now I'm going to talk a bit about how a lisp (almost Scheme) program is compiled into Tamarin's byte code. This topic is especially interesting if you are curious to make your own language or VM.
Tamarin VM is made for ActionScript, so its byte code is also specifically designed for ActionScript. In other words, it is a slightly tricky to implement other language than ActionScript. In case if you don't know about ActionScript, it is almost identical as JavaScript in the execution model. Difference between them is about optimization with explicit type notion and static field.
ActionScript and Scheme are common for those aspects:
But there are significant difference.
Those limitations sound like that Tamarin VM is inferior. But no, actually those limitations come from Tamarin VM's advantage and optimization. If you happen to have a chance to design your VM, please learn from the lesson. There ain't no such thing as a free optimization. Any optimization kills some generality. I'll explain each case.
ActionScript doesn't have a simple function call neither Tamarin
VM. This is rather harmless though. When you see a function like
expression like trace("hello")
, this is actually mean
(the global object).trace("hello")
, and eventually, the
receiver passes to the function as the first argument. In other words,
if you want to construct a function call with two arguments, you need
to make three arguments where the first argument is "this" object. A
slightly tricky part is primitive operators like + or -, which don't
have "this" object. Those primitives are special case.
ActionScript also has lexical scope, but only a function has a scope. So I have to be careful when I compile let expression in Scheme. Most simplest way to implement a let expression is to use a function. A let expression can be always translated to a lambda in theory though, this is a huge performance disadvantage. So I use "with" expression in ActionScript. "With" expression is an unpopular syntax in ActionScript, but you can use any object as a scope object. I borrowed this idea from Happy-ABC project http://github.com/mzp/scheme-abc.
Lack of the tail call optimization in Tamarin VM was the most disappointed thing to me. It prevents a functional programming style. I simply gave up it. Tail call optimization is not difficult topic at all. If the target were a native code like x86, it would be a matter of swapping stack and jump. But Tamarin VM doesn't allow direct access of stack or jump to other function. I understand that it might cause a security issue though, it would be wonderful if VM would provide special byte code for tail call.
Finally, you can't access the call stack directly, therefore you can't implement call/cc. The reason why I can't call Tamacola as Scheme is the lack of tail call optimization and call/cc. It prevents many experimental language features like generator, process, or so. But considering rich libraries provided by the Flash API, I would say Tamacola will be a reasonably useful language eventually.
I'll tell you convolved self hosting process and macros tomorrow.
by Takashi (noreply@blogger.com) at September 15, 2010 06:04 AM
Once the assembler was done, I was able to test verious Tamarin VM's features, even I wrote a tiny GUI application on Adobe Flash in the assembler. Then next step is the compiler.
Another goal of the project was to port Ian Piumarta's COLA framework to Tamarin (the project name came from this). And perhaps this is only the real technical contribution of the project. COLA is a meta language (a programming language to design another language) which resembles Scheme. COLA has a nice sub-language called Parser Expression Grammar that makes parser very terse. My plan was to write a boot-strappng compiler in PEG and COLA, then to implement COLA library, and to write the real compiler in PEG and Tamacola itself.
I won't give you the detail of PEG. But briefly, it is as simple as a regular expression and as powerful as a context free grammar.
When that time I started writing the compiler, COLA has no library at all except PEG framework, so I needed to write necessary libraries by myself from scratch. Fortunately COLA has quite a powerful external function call feature (a kind of FFI), macro sysytem, and a flexible object oriented framework. So writing library is not so hard. But I tried not to use COLA specific features as possible because it would be a problem when I rewrite the compiler in Tamacola itself later.
To implement the library, I borrowed function specifications from R6RS as well as possible to avoid unnecessary confusion. There were exception because COLA treat a slash "/" character as special for namespaces, I took PLT's function names in this case.
Writing lisp libraries is interesting puzzle to me because there were some requirements and constrain for the domain. Those requiments are:
These requirements were carefully chosen. Because COLA has only modest debugging facility, the unit test framework must be there. So my first goal was to implement all functions needed by the unit testing. I needed a pretty printer for debugging, too.
Another "must have" library was bit operators, and file / in-memory streams that is needed to the assembler. Interestingly enough, R6RS doesn't define enough functions to support those. For example, there are no portable way to specify a stream to be binary or text. So I needed a bit creativity.
Eventually, I wrote all libraries and the compiler. And I got a pretty good sense about a minimun set of functions needed for compiler, which are testing framework, pretty printer, bit operators, and streams. In other words, if your language has those features, your language can be self-hosting.
The real puzzle part was the order. Those requirements must be precisely ordered by need. For example, the pretty printer must follow stream and string functions because the pretty printer uses those functions. Although you can write functions in random order as you like in Lisp, precise order makes testing and debugging is easy. I kept this discipline. I even implemented the test library twice, the first one was concise assert function, and the second one has more friendly fail message by the pretty printer.
It took a few weeks to build a simple compiler, but still there were long way up to the point where self-hosting can be done. One thing that I had learned from the stage was, even without debugger, debugging is not so hard if you have enough test cases and a good pretty printer.
by Takashi (noreply@blogger.com) at September 14, 2010 04:43 PM
Happy to announce that from now Krestianstvo SDK is running on the new Cog VM (Windows, Mac OS X, Linux Ubuntu 10.x are tested).
by Suslov Nikolay (noreply@blogger.com) at September 13, 2010 01:54 AM
Tony Nemelka has just been named CEO of Teleplace and I couldn't be more pleased. I have had a number of discussions with him and some of the exceptional people he is bring with him since he started working with the company, and I am really impressed with his vision for the direction for the business and the clear focus he has on customer value. I am very proud that the company has been able to attract someone of Tony's caliber to be the CEO. No question that the company was ready for this next step. Greg Nuyens did an exceptional job positioning the company technically - Teleplace is the best collaboration platform in the world today, by quite a wide margin. Now it is time to leverage that technical advantage into a market advantage as well.
by David A. Smith (noreply@blogger.com) at August 20, 2010 01:02 AM
Creating music in movement by interacting with people and architectural objects in realtime.
Video shows the Man'J chair prototype with built in Ultrasonic sensor, controlled by Arduino board, open sourced software Krestianstvo and Supercollider.
by Suslov Nikolay (noreply@blogger.com) at August 09, 2010 04:45 AM
Krestianstvo SDK 1.1 is available for download and now it is based on the new Squeak 4.1 image!
SDK includes:
1. Working version of Collaborative Curved Space Explorer
2. Examples of Seaside 3.0 and Open Croquet integration in web browser with Comet support.
3. Examples of Collaborative coding trough web-browser on several images running Open Croquet
4. Open Sophie CSS/XUL logic for describing Tweak user interfaces.
4. Math examples on matrices and vectors in Krestianstvo's learning 3D space
5. OSC remote controlling support
6. 3d vision (red/blue) support
7. Tool for building multi-pixel projection walls or CAVE
and more..
Happy exploring!
by Suslov Nikolay (noreply@blogger.com) at July 31, 2010 03:45 PM
This is very experimental, but working announce.
by Suslov Nikolay (noreply@blogger.com) at July 28, 2010 05:34 PM
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 ...
by Vanessa (noreply@blogger.com) at June 21, 2010 09:16 PM
EN:
There are recent great news from Etoys dev-list, that "Derek's new CameraPlugin morph should work on Windows, Mac and Linux in Etoys image" :)
And now it is available and working in Krestianstvo SDK as video window in 3D space (several camera instances support also). Online video is replicated to all participants of an island in realtime.
So to try, just update your recent image or download the latest SDK with CameraPlugin support in it.
CameraPlugin binaries for Mac OS X/Linux/Windows are available here or could be found in Scratch distribution.
When running Krestianstvo world, check the new item "Видео камера" in menu "Инструменты".
Now everything is ready to:
by Suslov Nikolay (noreply@blogger.com) at May 13, 2010 11:30 AM
About three months ago, I joined Lockheed Martin STS as their Chief Innovation Officer. I have been wanting to pursue a project that was quite different from the direction that Teleplace has been going, and after about a year of discussion, it was clear that the direction I wanted to go and what Lockheed Martin was looking for fit extremely well.
It is too early to talk about what I will be doing, but if it works the way I think it should, it could have some very big results and may have an impact on everyone someday. I can tell you it is a very different world inside of a big company - there is still a requirement to be entrepreneurial and sell the ideas, but once a big company like this gets behind it, the resources available are simply amazing.
More to come for sure...
by David A. Smith (noreply@blogger.com) at May 01, 2010 02:26 PM
Вот и вышла долгожданная первая версия методического пособия по текущей версии Крестьянство SDK, состоящая из описаний, рекоммендаций и документации.
Скачать в формате (pdf) можно здесь: Методическое пособие
The first version of Krestianstvo SDK documentation book (on Russian) has gone online.
Download is available in pdf here.
by Suslov Nikolay (noreply@blogger.com) at April 29, 2010 08:43 PM
To try, just load Cobalt-Stereo package into the recent Cobalt image from the contributions repository.
by Suslov Nikolay (noreply@blogger.com) at April 14, 2010 10:44 AM
As of April 2010 Krestianstvo SDK has the following new features:
by Suslov Nikolay (noreply@blogger.com) at April 08, 2010 09:38 PM
I just bought a new phone, and it wasn't an iPhone, but it is still very cool. I have been planning to buy an iPhone as my next communication device - all my friends have one. I am very glad that they no longer feel the urge to demonstrate how cool they are by showing me some stupid picture or new app on their iPhone - except for Frank, of course.
So why didn't I buy an iPhone? Well, it is a bit complicated. My family has five phones with Sprint. I actually had a Rumor, which is a pretty good texting phone, but not much use for anything else. I was reasonably happy with it, though the blue-tooth quality was pretty poor. It was not too useful in California - unless you are married to the governator. Sprint is pretty good for quality of reception, but I always thought the selections of their phones sucked. A few years ago, I decided I needed a Blackberry and tried to upgrade at Sprint. Believe it or not, they would not sell me one. They only sold them to businesses. Morons. I did buy a Blackberry from someone else and carried two phones. I dropped the Blackberry after a while, because I realized I could almost always check my email with my MacBook, even when I was traveling.
So why the new phone? Somehow, I must have either dropped or stepped on my Rumor. I had made two or three phone calls earlier in the day from my office. I put it in my pocket and went downstairs to talk to my wife and while I was talking to her I received another call. I took the phone out and pressed the answer button and then saw that it had a big crack in the center of the screen. Worse, the voice quality on the other end was totally garbled - like some sort of electronica convolution filter. It was basically toast. I needed my phone to work this week, as there are many things going on in my life (that I will be writing about soon) so whether I liked it or not, I had to go visit the Sprint store for a replacement.
When I got there I had a few nice surprises - first the selections of phones was not terrible. In fact it was getting interesting. No iPhone of course - this wasn't AT&T, but they had an Android phone and yes, they finally were offering Blackberries to real people, and a they had the new Palm WebOS-based phones. I was interested in the Google phone, but a friend of mine had just bought one and was trying to take some pictures in the bright sunlight. The screen was unusable. Also it was kind of big and bulky - sort of like what the old Soviet Union might build if they were trying to make an iPhone knock-off.
What really caught my eye was the Palm Pixi. It is the smaller and slightly cheaper brother to the Palm Pre (which had the very strange commercials last year). I like small phones, as I already carry too much hardware in my pockets. The Pixi was actually smaller than my old Rumor (which really wasn't that small) and it was a real smart phone. Better yet, Sprint was offering a hell of a data plan where my family's monthly costs, which did not include data, would actually drop with the new plan which did include it. The phone was $200 with a $100 rebate - including a new two year contract, but now, even that was pro-rated. Sprint is definitely getting aggressive.
So now the review of the Pixi. In a nutshell, it is terrific.
Here is a list of pros followed by cons:
Pros
- Setup was trivial. The guy at the Sprint store did most of the work and I had a working phone with all my contact info when I walked out.
- The phone perfectly integrates with Gmail, which is my main email connection these days. It pulled all of my contact info into the phone and I was immediately reading the most recent emails.
- It supports Google Calendar, which my wife and I share. And it issued calendar alerts. Very nice.
- It is quite small, but the built in thumb-keyboard is quite usable. It took a little getting used to, but it works fine and has a nicer feel than my Blackberry or my earlier RIM device. I do love the size - it is quite thin and feels very nice in my hands.
- Sprint's wireless network performance is great. I was at a Starbuck's with a friend of mine and wanted to show him a video I had posted to YouTube. He tried to access it with his iPhone, but I had it running on the Pixi well before he even had an connection. He never did get it to work, but he was using the AT&T network and not the local Wi-Fi.
- Web browsing works pretty good, given the size of the screen. Certain sites, like Boing Boing are excellent, because they have a mobile version automatically loaded. Amazon was a bit crappy, surprisingly.
Cons
- The text is too small, especially for us old guys.
- The sound volume is not quite loud enough, even with it maxed out.
- When I called my mother, she said the sound quality on her end was echo-y, like I was far away from the phone.
- I tried to read a PDF document using the included Adobe reader app, but it didn't word wrap, so this was basically a lost cause. Seriously - if I zoom into a document using PDF, you really need to provide an option to wrap the text so I don't have to scroll left and right.
- Camera quality is poor. Good enough for a random picture now and then, but it won't replace my Casio Exilim.
- Takes a long time to charge (maybe 4-5 hours?)
- Charge lasts about 3 days with use. Since it was a new phone, I probably did more with it than I normally will in the future, so this probably caused the battery to drain quickly.
- Some apps re-orient based on the orientation of the phone. Others don't.
- It really needs a search app that has instant access.
Overall, this is a great non-Android Google phone. It is really nice how cleanly and easily it interfaces with my Google life. And I love the size. It is really quite elegant. It has only been three days now, so let's see how it holds up over the next few months.
As an aside, I had a rental car last week - a Ford Flex. This included the Microsoft Sync software. I might comment more on this later, but short answer - it was terrible. I actually liked the car (more of an SUV actually), but this software was really opaque. After linking it to my now sadly demised phone via BlueTooth I could not figure out how to get to the phone interface to make a call. I nearly had an accident trying to figure this thing out. I never did figure out how to use the built-in GPS for directions. Luckily I had my Garmin Nuvi with me. Sync is Bad Bad Bad. If anyone from Ford is reading this - I did like the Flex, but will never buy anything with Sync installed.
by David A. Smith (noreply@blogger.com) at February 05, 2010 05:36 AM
For those who have not tried out the new Collaborative Curved Space Explorer in Krestianstvo SDK yet, here is the video which was recorded at Vologda State Technical University (Russia) during the "Virtual museum of geometry" opening event:
by Suslov Nikolay (noreply@blogger.com) at February 03, 2010 07:55 PM
Tamarin-central, the stable source tree of open source VM used by Adobe Flash, was updated last December (Dec 22 2009) after relatively long blank. The newer tree has faster VM and includes updated ABC assembler and disassembler. Especially those ABC utilities are quite useful to a binary hacker of AVM2.
$ export FLEX=~/Downloads/flex_sdk_4.0.0.10485_mpl
$ hg clone http://hg.mozilla.org/tamarin-central/ $ cd tamarin-central $ mkdir objdir-release $ cd objdir-release $ python ../configure.py --enable-shell --enable-debugger $ make $ ./shell/avmshell -Dversion shell 1.5 release-debugger build cyclone features AVMSYSTEM_32BIT; ...
$ cd .. $ java -jar $FLEX/lib/asc.jar -import core/builtin.abc -import shell/shell_toplevel.abc utils/abcdump.ascore/builtin.abc and shell/shell_toplevel.abc are basic libraries provided by tamarin, you can use them to try to see how abcdump works. Note that you need to separate abc file names with --, otherwise arguments are processed by avmshell instead of abcdump.
$ ./objdir-release/shell/avmshell ./utils/abcdump.abc -- core/builtin.abc // magic 2e0010 // Cpool numbers size 158 0 % ...I recommend you to make a tiny shell script to ease such a complicated command line.
#!/bin/sh ~/tmp/tamarin-central/objdir-release/shell/avmshell ~/tmp/tamarin-central/utils/abcdump.abc -- $@
$ cd utils/abcasm/ $ ./abcasm.sh test/hello.abs test/hello.abs $ ../../objdir-release/shell/avmshell test/hello.abc Hello, world
by Takashi (noreply@blogger.com) at January 29, 2010 09:58 PM
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 pixel. Just move the mouse pointer around to see how different colors are reproduced. You'll notice strong diagonal patterns, but remember, on the actual display the pixels are only half as large. Note that the actual DCON optionally applies a bit of anti-aliasing in hardware which is not simulated here. It helps reproducing fine structures and depicts colors more accurately. Additionally, the simulation shows a magnified image to better illustrate the principle, but it is not accurate because the reflective area of each pixel is not depicted. Maybe I can add this in a later version.
I made the simulation using Squeak / Etoys, which is one of the programming environments on the OLPC machine, but also works on Windows, Mac OS X, Linux, and many more systems. If you run the simulation on the actual laptop (download the project, place it in /home/olpc/.sugar/default/etoys/MyEtoys, run Etoys, choose Load Project), then you should close the small simulated screen and just leave the magnified view open.
For the interactive simulation, download Squeak (this version installs both, a regular application and a browser plugin), then click here to run the simulation in your browser, or download the project file, launch Squeak, and drop the project into it.
Intel-Mac users beware, the plugin is not supported directly yet. To see the project in Safari, you have to quit Safari, set it to open in Rosetta (select Safari in the finder, press Cmd-i), and reopen. Or, use the download method, Squeak itself is running fine on Intel Mac, it's just the browser plugin that's making problems.
by Vanessa (noreply@blogger.com) at January 27, 2010 03:37 PM
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, it's far too small. But not giving up that easily, Sophie was erasing and repainting it over and over until she was satisfied with her "cow girl". Then Jakob proudly told her how to let it move and bounce, he had rembered almost everything needed. Together they quickly made it work, and just started exploring the noise-making possibilities again when we were saved by the call to dinner ...
by Vanessa (noreply@blogger.com) at January 27, 2010 03:37 PM
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 (it was a lively discussion). Thanks for posting, Cheng!
by Vanessa (noreply@blogger.com) at January 27, 2010 03:37 PM
I just installed Sophie on my green machine. Sophie is a project of the Institute for the Future of the Book, is implemented in Squeak (just like my Etoys activity on the laptop) using Tweak as its UI framework (which is the original topic of my blog). Tweak is also the base for the next-gen Etoys.
Installation went pretty smooth. I downloaded the cross-platform zip file using the Web activity from Sugar
and unpacked it using the command line. The first start of Sophie failed, but after replacing the failing plugin with one from the pre-installed Squeak it started and worked. Yay!
This is an excellent example why it's a good idea to have a regular X11 installation on the kid's laptop: a lot of software will just work, even if it is not correctly integrated into the Sugar UI.
Michael Rüger of impara (a Squeak shop leading Sophie development here in Magdeburg, Germany) came over and made a little book, downloading two logos directly from the web (Sophie can do that!), adding a bit of text and color ... Tweak performance is not exactly blazing on the XO machine, I think we made the right decision to not use the Tweak-based Etoys but stick to the proven Morphic-based one. Of course one could optimize it a lot, but who has time for that? Anyway, it was useable - click the image to get a larger view:
by Vanessa (noreply@blogger.com) at January 27, 2010 03:37 PM
Lately I work on Squeak integration in the One Laptop Per Child (OLPC) project, perhaps better known as the "$100 laptop". The whole etoys group came over to OLPC's office in Cambridge. Squeak looks surprisingly well on the display prototype, and also etoys are reasonably fast. Ian Piumarta took some nice pictures, which might very well be the first photos of the actual display in the wild.
by Vanessa (noreply@blogger.com) at January 27, 2010 03:37 PM
*UPDATED* New half adder video is released!
by Takashi (noreply@blogger.com) at January 25, 2010 01:19 AM