This feed does not validate.
In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns: ...
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns: ...
line 51, column 0: (3 occurrences) [help]
<lj-embed id="18" />
line 56, column 0: (5 occurrences) [help]
<a href="http://ic.pics.livejournal.com/cananian/123187/2055/origina ...
line 59, column 0: (6 occurrences) [help]
<a href="http://ic.pics.livejournal.com/cananian/123187/1814/origina ...
</channel>
<?xml version='1.0' encoding='utf-8' ?>
<!-- If you are running a bot please visit this policy page outlining rules you must respect. https://www.livejournal.com/bots/ -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
<title>Dr. C. Scott Ananian</title>
<link>https://cananian.livejournal.com/</link>
<description>Dr. C. Scott Ananian - LiveJournal.com</description>
<lastBuildDate>Sun, 21 Oct 2012 22:51:05 GMT</lastBuildDate>
<generator>LiveJournal / LiveJournal.com</generator>
<lj:journal>cananian</lj:journal>
<lj:journalid>123187</lj:journalid>
<lj:journaltype>personal</lj:journaltype>
<image>
<url>https://l-userpic.livejournal.com/11312513/123187</url>
<title>Dr. C. Scott Ananian</title>
<link>https://cananian.livejournal.com/</link>
<width>100</width>
<height>100</height>
</image>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/67703.html</guid>
<pubDate>Sun, 21 Oct 2012 22:51:05 GMT</pubDate>
<title>Reading Project Talk (and slides)</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/67703.html</link>
<description><p>An unruly tag team of OLPC folks gave a long talk on <a href="http://wiki.laptop.org/go/Literacy_Project" target="_blank">the Literacy Project</a> today for attendees at this year's <a href="http://www.olpcsf.org/CommunitySummit2012" target="_blank">OLPC-SF Community Summit</a>. It was streamed live on Ustream: <a href="http://www.ustream.tv/recorded/26344794" target="_blank">Part 1</a> (Matt Keller, Richard Smith), <a href="http://www.ustream.tv/recorded/26345580" target="_blank">Part 2</a> (Richard Smith, Ed McNierney, C. Scott Ananian, Chris Ball, questions from the audience). We've posted the slides: <a href="http://dev.laptop.org/~cscott/literacy-public/Keller-Reading.ppt" target="_blank">Matt Keller</a>, <a href="https://docs.google.com/presentation/d/18S9eSMMZeCxiCRxXZl4VgVAxQFTLIWQCOkO2GVGjk8g/edit" target="_blank">Richard Smith</a>, <a href="https://docs.google.com/presentation/d/1CSJBu_11YKc_3H20Zi5maDPym9tcYo7gdmK9Hj1Wc30/edit" target="_blank">C. Scott Ananian</a>.</p>
<p>You can try out some of the apps mentioned in the talk. <a href="http://nell-balloons.github.cscott.net" target="_blank">Nell's Balloons</a> and <a href="http://nell-colors.github.cscott.net" target="_blank">Nell's Colors</a> will run in any reasonably-recent Google Chrome or Mozilla Firefox browser. They will also run as a <a href="https://marketplace.mozilla.org/developers/" target="_blank">Firefox webapp</a> on Android devices, using the <a href="http://nightly.mozilla.org/" target="_blank">latest Firefox nightly for Android</a>. For deployment we use a slightly-tweaked build of Firefox (adding expanded webapp storage quotas and the ability to use plugins from inside webapps), and a <a href="https://github.com/cscott/intent-addon" target="_blank">custom plugin</a> to hook up the <a href="http://funf.org/" target="_blank">Funf logging framework</a>. Source code is available on github: <a href="http://github.com/cscott/nell-balloons" target="_blank">nell-balloons</a>; <a href="http://github.com/cscott/nell-colors" target="_blank">nell-colors</a>. In addition, Chris Ball's "Matching" app for Android is available: <a href="http://dev.laptop.org/~cscott/literacy-public/Matching-1.4.0.apk" target="_blank">apk</a>; <a href="http://dev.laptop.org/git/users/cjb/android-matching/" target="_blank">source</a>.</p></description>
<comments>https://cananian.livejournal.com/67703.html?view=comments#comments</comments>
<category>javascript</category>
<category>sugar</category>
<category>olpc</category>
<category>nell</category>
<category>android</category>
<lj:security>public</lj:security>
<lj:reply-count>3</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/67390.html</guid>
<pubDate>Wed, 22 Aug 2012 16:29:11 GMT</pubDate>
<title>The Importance of Sensing Distance</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/67390.html</link>
<description><p>At <a href="http://www.dimeb.de/idc2012" target="_blank">IDC 2012</a> in June, Arnan Sipitakiat and Nusarin Nusen discussed how they are using <a href="http://dx.doi.org/10.1145/2307096.2307108" target="_blank">Robo-Blocks</a>&mdash;a turtle robot and &ldquo;tangible <a href="http://wiki.sugarlabs.org/go/Activities/Turtle_Art" target="_blank">Turtle Blocks</a>&rdquo;&mdash;to teach problem solving and debugging skills to 5- through 12-year-olds.</p>
<p>One of the things I learned from their presentation was that children had difficulty reasoning about relative angles. The Robo-Blocks robot does not have any distance feedback on its motors, so &ldquo;the result of a program will change depending on the roughness of the surface and the battery level of the robot.&rdquo; They worked around this issue by developing a protractor tool to guide the children's reasoning about the relationship between the (arbitrary) numbers entered and the amount the robot turned, but some kids still had difficulty. The researchers &ldquo;often had to insist on trying the protractor&rdquo; and &ldquo;some children preferred to keep increasing the turn amount even if a small decrease would have fixed the problem&rdquo; resulting in programs that had the robot making multiple complete rotations before setting off in the correct direction. The kids were also dissatisfied with polygon-drawing tasks (&ldquo;<a href="http://en.wikipedia.org/wiki/Turtle_Geometry" target="_blank">turtle geometry</a>&rdquo;) because the inaccuracies of open-loop control of the robot means that the polygons often didn't close completely, and &ldquo;[t]his small error turned out to be unacceptable to children.&rdquo;</p>
<p>So I designed the XOrduino turtle robot from the start to have distance sensors so that it can do accurate turns with closed-loop control. Here's a little video showing how they work in the current (A1.5 / B1) revision of the board:</p>
<lj-embed id="18" />
<p>Some bonus pictures of the speed sensor on the workbench:</p>
<ul>
<li>The robot on the workbench with probes.<br />
<a href="http://ic.pics.livejournal.com/cananian/123187/2055/original.jpg" target="_blank"><img alt="Speed sensor test setup" border="0" title="Speed sensor test setup" src="https://ic.pics.livejournal.com/cananian/123187/2055/300.jpg" width="300" fetchpriority="high" /></a>
</li>
<li>Signal from the motor speed sensor. 5ms/div .5v/div. Motor is running at full speed, unloaded. Two dips are seen: the larger is from a piece of white paper glued to the rim of the gear; the smaller is from a spot made with a white paint marker (the paint didn't stick very well). White-out worked much better (as shown in the video above).<br />
<a href="http://ic.pics.livejournal.com/cananian/123187/1814/original.jpg" target="_blank"><img alt="Oscilloscope trace" border="0" title="Oscilloscope trace" src="https://ic.pics.livejournal.com/cananian/123187/1814/300.jpg" width="300" loading="lazy" /></a>
</li>
<li>Oscilloscope settings<br />
<a href="http://ic.pics.livejournal.com/cananian/123187/1575/original.jpg" target="_blank"><img alt="Oscilloscope settings" border="0" title="Oscilloscope settings" src="https://ic.pics.livejournal.com/cananian/123187/1575/300.jpg" width="300" loading="lazy" /></a>
</li>
</ul></description>
<comments>https://cananian.livejournal.com/67390.html?view=comments#comments</comments>
<category>sugar</category>
<category>olpc</category>
<category>xorduino</category>
<category>arduino</category>
<lj:security>public</lj:security>
<lj:reply-count>2</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/67093.html</guid>
<pubDate>Sat, 18 Aug 2012 05:13:16 GMT</pubDate>
<title>XO Turtle Bot drives around</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/67093.html</link>
<description><p>Here's a first look at an XOrduino Turtle bot driving around:</p>
<lj-embed id="13" />
<p>I've checked out all of the functionality on the A1.5 board except the step-up voltage regulator now. I'm optimistic the B1 boards (being made now in Taipei) will be clean.</p>
<p>It will be great when we've got lesson plans written up so kids can learn how to control the bot with Turtle Blocks, and play with the different possible behaviors. Instead of just bumping around ("like a Roomba, except it doesn't vaccuum" a friendly 6-year-old beta-tester told me), you can trace patterns you design, or use the Scratch Sensor Board sensors to make the robot "afraid of sound", "attracted to light", or add your own sensors and behaviors.</p></description>
<comments>https://cananian.livejournal.com/67093.html?view=comments#comments</comments>
<category>olpc</category>
<category>xorduino</category>
<lj:security>public</lj:security>
<lj:reply-count>0</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/66895.html</guid>
<pubDate>Wed, 15 Aug 2012 20:34:02 GMT</pubDate>
<title>"Hello, World" from XOrduino/XO Stick</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/66895.html</link>
<description><p>Here's a quick look at the next versions of the XOrduino and XO Stick boards. These were assembled from a small quantity of "pre-B1" boards I had made at <a href="http://batchpcb.com" target="_blank">BatchPCB</a>.</p>
<lj-embed id="11" />
<p>I've uploaded some more pictures to <a href="https://plus.google.com/photos/109541946294746531763/albums/5772322118805954321" target="_blank">the XOrduino album</a> as well.</p>
<p>Here's a little table relating the board versions pictured with those I've previously discussed.</p>
<table>
<tr><td>Build</td><td>XOrduino</td><td>XO Stick</td></tr>
<tr><td>A1</td><td>v4</td><td>v5</td></tr>
<tr><td>This video</td><td>v6</td><td>v7</td></tr>
<tr><td>B1</td><td>v8</td><td>v14</td></tr>
</table>
<p>B1 is "the next run" of boards, already released to the fab house but not yet in hand.</p>
<p>The big feature added to XOrduino after A1 was a motor driver, to allow using the XOrduino as a Turtle robot. The big feature added to XO Stick after A1 was the shield form factor, allowing it to ride piggy back on the XOrduino. This makes it easier to share a single turtle robot with a classroom: there may be only one XOrduino robot base, but each student can have their own low-cost XO Stick "brains". They can take turns snapping their brains on top of the base to drive it.</p>
<p>I haven't finished testing all the functionality of these new boards yet, but it looks like I haven't made any major mistakes! Help still wanted with software, documentation, etc; send email to xorduino@gmail.com if you're interested.</p></description>
<comments>https://cananian.livejournal.com/66895.html?view=comments#comments</comments>
<category>sugar</category>
<category>olpc</category>
<category>xorduino</category>
<category>arduino</category>
<lj:security>public</lj:security>
<lj:reply-count>0</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/66654.html</guid>
<pubDate>Thu, 02 Aug 2012 06:39:39 GMT</pubDate>
<title>XO Bot joins the XOrduino and XO Stick</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/66654.html</link>
<description><p>Free things first: I've got parts for 20 copies of the "Mk I"
<a href="http://cananian.livejournal.com/66129.html" target="_blank">XOrduino and XO Stick</a>. <b>I'm mailing them out for free</b> (!) in exchange
for your development help. Send me an email at
xorduino@gmail.com describing what you'd like to do with the
XOrduino/XO Stick, and your full mailing address. Best 20 or so get kits.</p>
<p align="center"><img alt="XOrduino A1" border="0" title="XOrduino A1" src="https://ic.pics.livejournal.com/cananian/123187/847/original.jpg" fetchpriority="high" /></p>
<p>Here are some of the projects which you might be able to help with:</p>
<ul>
<li><b>Assemble an XOrduino / XO stick with an 8-12 year old</b> and document
the process. What parts were tricky to solder? Where did polarity
matter? How much of the function of the different devices did you
find worth explaining? Photos or video of children assembling the device would be great for future publicity, with their permission. (We're not crazy: kids can <a href="http://www.youtube.com/watch?v=Pus_fA1Tv9w" target="_blank">repair XOs</a> and <a href="http://www.sparkfun.com/news/555" target="_blank">solder</a>.)</li>
<li><b>Test different configurations</b> of the boards. What are the
fewest components necessary for a functional XO Stick?
What capacitors are really needed? What's the smallest number of
components needed to get the arduino IDE to talk to the XOrduino?
Then add the components for the <a href="http://info.scratch.mit.edu/Sensor_Boards" target="_blank">Scratch Sensor Board</a> functionality,
and test that with this <a href="https://github.com/osbock/ScratchSensors" target="_blank">Arduino sketch</a> (some minor porting required). Try out whatever
Arduino shields/old Arduino code you have lying around, and see if there
are any gotchas there. Document it all, take photos and video, let me know about bugs and pitfalls.</li>
<li><b>Write some killer <i>education</i> apps</b>! These
boards are meant specifically for teaching kids&mdash;take the <a href="http://wiki.sugarlabs.org/go/Activities/Turtle_Art/Using_Turtle_Art_Sensors" target="_blank">Turtle Art with Sensors</a> ideas as examples, and write up some
lessons to teach science. Or take inspiration from the old school
"fun with electronics" kits from Radio Shack and recreate some of the
popular standbys: a burglar alarm for kids' tree fort,
a light-sensitive alarm they can hide in their sibling's drawer,
etc. Or a document how to program a robot (more on the robot below) with simple emergent behaviors&mdash;avoiding walls, turning toward light, fleeing loud sounds, etc. The <a href="https://www.sparkfun.com/products/11074" target="_blank">Cubelets</a> examples may give you ideas. Take photos and video.</li>
<li><b>Arduino support for the XO Stick</b>. There are a number of projects
which add support for the ATtiny85 and friends to the Arduino IDE (for example, <a href="http://provideyourown.com/2011/arduino-program-attiny/" target="_blank">this one</a>).
Ideally we'd like to make the XO Stick as Arduino-compatible as
possible, so we can reuse the excellent Arduino IDE, etc.
This involves (a) porting an arduino-compatible bootloader (like
<a href="http://embedded-creations.com/projects/attiny85-usb-bootloader-overview/avr-jtag-programmer/" target="_blank">usbAspLoader-tiny</a>), as well as (b) porting the Arduino libraries to match the
pinout/peripherals of the ATtiny85 and ATtiny861 (<a href="http://hlt.media.mit.edu/?p=1695" target="_blank">this page</a> is a good start).</li>
<li><b>Program an XO Stick from an XOrduino</b> and vice versa. Ideally we'd
like to bootstrap the initial chip programming, so that one
programmed XOrduino (or XO Stick) can be used to put the initial
bootloaders on the others. For technical reasons the XO Stick
is probably best as a "clone tool": without interacting with the
USB bus it would just copy its internal memory to another
XO Stick. The XOrduino is a little easier, just a matter of
adapting the existing <a href="http://arduino.cc/en/Tutorial/ArduinoISP" target="_blank">Arduino sketches and documentation</a>.</li>
<li><b>Debrick an XO</b> from the XO Stick. The XO Stick can talk to the
EC programming bus to recover a bricked XO; it can probably also
<a href="http://wiki.laptop.org/go/SPI_FLASH_Recovery" target="_blank">reprogram OpenFirmware</a>. We need to write a bit of code to make it
pain-free and document the process. This would make the XO Stick a useful repair accessory for XO deployments.</li>
<li><b><a href="http://catroid.org" target="_blank">Scratch</a>/<a href="http://wiki.sugarlabs.org/go/Activities/TurtleArt" target="_blank">Turtle Blocks</a> support</b> for the <a href="http://wiki.sugarlabs.org/go/Activities/Turtle_Art/Plugins#Arduino" target="_blank">XOrduino</a> and/or <a href="http://youtu.be/qfU_f8HF-78" target="_blank">XO turtle bot</a> (see below).</li>
</ul>
<p>Here's the exciting part two: I'm already working on the XOrduino and XO Stick "Mk II". The latest schematics/boards
are in github (<a href="https://github.com/cscott/xostick" target="_blank">xostick</a>, <a href="https://github.com/cscott/xorduino" target="_blank">xorduino</a>). The kits I'll be sending out this week correspond to the "A1" tag in those repositories; the "Mk II" revision is on the master
branch.</p>
<p>The XO Stick gets a minor change with big implications: instead of
using a 20-pin header matching the ATtiny861 pinout, I've widened the
board to <b>give the XO Stick a standard Arduino shield connector</b> (and some
prototyping area). This opens the way for a port of the Arduino IDE
(mentioned above), but it also means that the XO Stick can be mounted on top of
an XOrduino. In a cost-conscious classroom environment, this allows a teacher to buy/make one copy of the XOrduino with all of its
fancy peripherals (scratch sensors, robot support) and then give each student a copy of the
cheaper XO Stick. The students share the XOrduino and swap out their XO Stick "brains" on top to control it or use its peripherals. Mating the two
boards also makes it straightforward to program an XO Stick from
an XOrduino, or to use the XO Stick's prototyping area to hack together
a shield for the XOrduino.</p>
<p>The XOrduino gets a more exciting feature (hinted at above) -- enough peripherals to become the <b>XO Turtle Bot</b>! This is a very
low-cost <a href="http://en.wikipedia.org/wiki/Turtle_%28robot%29" target="_blank">turtle robot</a> based on a <a href="http://www.tamiyausa.com/product/item.php?product-id=70097" target="_blank">Tamiya motor assembly</a>. All of the
extra robot components are optional&mdash;you can populate just the parts you want&mdash;but a classroom can now make
their XOrduinos (or XO Stick + XOrduino base) into standalone turtle
robots, controlled by Scratch, Turtle Art, or Arduino code. The XO Turtle Bot revision adds a motor driver, two bump switches, a simple 3-cell
power supply, and rotation sensors for the motors to the XOrduino. (Arnan Sipitakiat and Nussarin Nusen in their Robo-Blocks presentation for <a href="http://dimeb.informatik.uni-bremen.de/idc2012/program.htm" target="_blank">IDC 2012</a> explained that children find "turn for two seconds" hard to understand; we include motor sensors so that we can "turn 90 degrees" instead.) And of course because the robot is based on XOrduino, you can add
whatever other sensors you like and write arduino/Scratch/Turtle Blocks code for it.</p>
<p align="center"><img alt="XOrduino A1 board on top of Tamiya Twin Motor Gearbox." border="0" title="XOrduino A1 board on top of Tamiya Twin Motor Gearbox." src="https://ic.pics.livejournal.com/cananian/123187/1350/300.jpg" width="300" loading="lazy" />&nbsp;&nbsp;&nbsp;<img alt="XOrduino A1 plugged into USB port; prototype XO Turtle Bot in the background." border="0" title="XOrduino A1 plugged into USB port; prototype XO Turtle Bot in the background." src="https://ic.pics.livejournal.com/cananian/123187/1278/300.jpg" width="300" loading="lazy" /></p>
<p>I'm excited about the potential of low-cost robotics and the Arduino platform for
education. If you are, too, let me send you a kit so you can help
out!</p></description>
<comments>https://cananian.livejournal.com/66654.html?view=comments#comments</comments>
<category>sugar</category>
<category>olpc</category>
<category>xorduino</category>
<category>android</category>
<category>arduino</category>
<lj:security>public</lj:security>
<lj:reply-count>1</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/66444.html</guid>
<pubDate>Tue, 12 Jun 2012 06:39:52 GMT</pubDate>
<title>Nell's Tinkrbook in Omo</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/66444.html</link>
<description><p>
This week I will be at the 2012 <a href="http://dimeb.informatik.uni-bremen.de/idc2012/" target="_blank">Interaction Design and Children
conference</a> in Bremen, Germany. I will be presenting the
<a href="http://cananian.livejournal.com/66008.html" target="_blank">Growing Up With Nell</a>
paper as well as discussing the OLPC Foundation's literacy pilots in
Ethiopia.
</p>
<p>
The <a href="http://wiki.laptop.org/go/Literacy_Project" target="_blank">Literacy
Project</a> is a collaboration between four different groups (as
alluded to by the title of this post): the One Laptop per Child
Foundation (&ldquo;Nell&rdquo;), the MIT Media Lab
(&ldquo;Tinkrbook&rdquo;), the School of Education, Communication and
Language Sciences at Newcastle University, and the Center for Reading
and Language Research at Tufts University (&ldquo;Omo&rdquo;).
The goal is to reach children even further from educational
infrastructure than OLPC has ventured to date. In particular, the
Ethiopia pilots are complete child-led bootstraps, attempting to teach
kids to read English (an official language of Ethiopia) who neither
speak English nor read in any language yet. There are no teachers in the village,
and no literate adults either.
</p>
<p>Adapting Nell to this environment has some challenges: how do we
guide students through pedagogic material with stories if they don't
yet understand the language of the stories we want to tell? But the
essential challenge is the same: we have hundreds of apps and videos
on the tablets and need to provide scaffolding and guidance to the
bits most appropriate for each child at any given time, just as Nell seeks to
guide children through the many activities included in Sugar. In the
literacy project there is also a need for automated assessment tools: how can we tell that the project is
working? How can we determine what parts of our content are effective
in their role?</p>
<p>I'll write more about the Literacy Project in the coming weeks.
As we've started to get data back, some of the lessons learned are
familiar: kids do the strangest things! They learn how to do things
we never knew they could do (or meant for them to) and often are
motivated by pleasures which surprise us. For example, one app we
deployed had a sphere which deflated with a sort of farting noise when
the child picked the wrong answer. It turns out that the kids liked making the farting noise
much more than they liked the response to the correct answer! Obvious
in retrospect, but the lesson reminds us why we are pursuing an incremental development and data collection approach. Happily, the hardware itself
has been a success: low hardware failure rates, solar powered charging
is successful (although they prefer to charge the devices during the
middle of the day; we'd expected them to do so overnight from storage batteries charged during the day), and they've
mastered the touch interface very quickly on their own. The pilots
have been running since February, and the kids are still very engaged
with the content. So far, so good!</p>
<p align="center">
<img alt="Smiling boy in Ethiopia Literacy Pilot" border="0" title="Smiling boy in Ethiopia Literacy Pilot" src="https://ic.pics.livejournal.com/cananian/123187/387/300.jpg" height="225" fetchpriority="high" />&nbsp;<img alt="Two girls in Ethiopia Literacy Pilot" border="0" title="Two girls in Ethiopia Literacy Pilot" src="https://ic.pics.livejournal.com/cananian/123187/749/300.jpg" width="300" loading="lazy" /></p></description>
<comments>https://cananian.livejournal.com/66444.html?view=comments#comments</comments>
<category>sugar</category>
<category>olpc</category>
<category>nell</category>
<lj:security>public</lj:security>
<lj:reply-count>0</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/66129.html</guid>
<pubDate>Sat, 09 Jun 2012 16:06:32 GMT</pubDate>
<title>Introducting the XOrduino! (and XO Stick)</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/66129.html</link>
<description><p>I banged out two <a href="http://freedomdefined.org/OSHW" target="_blank">open hardware</a> designs this week, designed for use with the <a href="http://en.wikipedia.org/wiki/OLPC_XO-1" target="_blank">OLPC XO</a> laptops.</p>
<p>The first is the <b>XOrduino</b>, a stripped down low-cost
<a href="http://arduino.cc/" target="_blank">Arduino</a>-compatible board that plugs right into the XO's USB ports.
But wait, there's more: it's also compatible with the <a href="http://info.scratch.mit.edu/Sensor_Boards" target="_blank">Scratch Sensor
Board</a>, so you can use this device to control <a href="http://scratch.mit.edu/" target="_blank">Scratch</a> (and <a href="http://wiki.sugarlabs.org/go/Activities/TurtleArt#Arduino" target="_blank">Turtle Art</a>, once <a href="http://firmata.org/" target="_blank">Firmata</a> is ported).
It should be compatible with the <a href="http://en.wikipedia.org/wiki/Arduino#Software" target="_blank">Arduino IDE</a> and all <a href="http://arduino.cc/en/Main/ArduinoBoardLeonardo" target="_blank">Arduino
Leonardo</a>-compatible shields.</p>
<p>The board uses mostly through-hole parts, with one exception, and
there are only 20 required components for the basic Arduino
functionality, costing about $5 (from digikey, quantity 100). It is
reasonable for local labor or even older kids to assemble by hand.</p>
<p>It's open hardware: <a href="http://en.wikipedia.org/wiki/Eagle_(program)" target="_blank">Eagle</a> design files are <a href="https://github.com/cscott/xorduino" target="_blank">on github</a> (<a href="https://github.com/cscott/xorduino/blob/A1/XOrduino-sch.pdf?raw=true" target="_blank">schematic PDF</a>,
<a href="https://github.com/cscott/xorduino/blob/A1/XOrduino-brd.pdf?raw=true" target="_blank">pcb PDF</a>). I expect to have a small number of boards in a few weeks; let
me know if you'd like one in exchange for help with hardware and
software bring-up. Schematic and layout review also appreciated (I did the PCB routing late at night under time pressure leaning heavily on autoroute, it's certainly not the prettiest). And feedback from Arduino and Arduino shield hackers would also be welcome.</p>
<p>If $5 per student is too much money, there's also the <b>XO Stick</b>, my
second board. It's based on the <a href="http://www.sparkfun.com/products/9147" target="_blank">AVR Stick</a> using the <a href="http://www.atmel.com/devices/attiny85.aspx" target="_blank">ATtiny85</a> processor and costs only
$1/student. It's not quite as user-friendly as the Arduino-compatible
board, but it can also be used to teach simple lessons in embedded
electronics. For $0.12 more you can populate an <a href="http://www.atmel.com/devices/ATTINY261A.aspx" target="_blank">ATtiny261A</a> (though a '461 or '861 would be better) and get 13 I/O ports; this variant should be powerful enough to program other XO Sticks and perform XO maintenance tasks (accessing the serial
console, debricking a laptop via SPI flash). The XO Stick is even easier for a
kid to assemble themself: only 8 required components, all through-hole.
(Sadly, my desire to shave every penny off the cost of this design meant that I couldn't use some of the symmetry tricks I invented for <a href="http://www.mit.edu/~puzzle/12/ben_bitdiddle/investigators_report/solution/" target="_blank">a 2012 Mystery Hunt puzzle</a> to make the circuit <i>impossible</i> to assemble incorrectly.)
</p>
<p>Same deal as the XOrduino: design files <a href="https://github.com/cscott/xostick" target="_blank">on github</a> (<a href="https://github.com/cscott/xostick/blob/master/XO-Stick-sch.pdf?raw=true" target="_blank">schematic PDF</a>,
<a href="https://github.com/cscott/xostick/blob/master/XO-Stick-brd.pdf?raw=true" target="_blank">pcb PDF</a>); I expect to have a few boards available to people who want to
help make some software for them. Schematic and layout review is also appreciated!</p></description>
<comments>https://cananian.livejournal.com/66129.html?view=comments#comments</comments>
<category>sugar</category>
<category>olpc</category>
<category>xorduino</category>
<category>arduino</category>
<lj:security>public</lj:security>
<lj:reply-count>0</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/66008.html</guid>
<pubDate>Mon, 12 Mar 2012 20:55:35 GMT</pubDate>
<title>Growing Up With Nell</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/66008.html</link>
<description><p>Chris, Michael, and I just submitted a short paper describing our work on the XO-3 Nell project to this year's <a href="http://dimeb.informatik.uni-bremen.de/idc2012/" target="_blank">Interaction Design and Children</a> conference. Give the preprint a read: <a href="http://cscott.net/Publications/OLPC/idc2012.pdf" target="_blank"><i>Growing Up With Nell: A Narrative Interface for Literacy</i> [pdf]</a>.</p>
<p>We're hard at work implementing Nell. We could use help in a number of areas: art, animation, story, user interface, javascript hacking, and probably others. For example, at the moment Chris and I are: drawing the characters, drawing user interface concepts, writing silly alphabet stories, animating the silly alphabet stories, doing the CSS/HTML layout to mock up designs, making some of the mock ups into functional demos, implementing HMM-based handwriting recognition in JavaScript, porting pyaiml to JavaScript, implementing an Apple Guide-style contextual help system on top of HTML widgets, and writing a integrated story editor (and stories about the story editor). I'd welcome volunteers for any of these tasks!</p></description>
<comments>https://cananian.livejournal.com/66008.html?view=comments#comments</comments>
<category>sugar</category>
<category>olpc</category>
<category>nell</category>
<lj:security>public</lj:security>
<lj:reply-count>1</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/65380.html</guid>
<pubDate>Tue, 01 Nov 2011 22:28:14 GMT</pubDate>
<title>A collection of Nell demos</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/65380.html</link>
<description><p>Here are some banged-together demos of various pieces of
<a href="http://laptop.org" target="_blank">One Laptop per Child</a>'s
<a href="http://cananian.livejournal.com/65077.html" target="_blank">Project Nell</a>.
The ultimate goal is a Nell <a href="http://wiki.laptop.org/go/Nell" target="_blank">demo</a>
for <a href="http://en.wikipedia.org/wiki/Consumer_Electronics_Show" target="_blank">CES</a>
in January 2012, but these bits should be considered as tech demos,
benchmarks, and proofs of concept, not actual pieces of that demo (yet).
</p>
<p>Most of these demos require WebGL support. Visit <a href="http://get.webgl.org/" target="_blank">get.webgl.org</a> for information about
enabling WebGL in your browser; there is WebGL support in Chrome,
Firefox, Safari, and Opera&mdash;although it often requires enabling
experimental features in the browser preferences.</p>
<ul>
<li><a href="http://dev.laptop.org/~cscott/nelldemo.20111101/tile_test.html" target="_blank">Tiles</a>. Performance benchmark
for a tile-based home screen. "Apps" are "locations" on your world map,
which you can customize as you like. (Here's an interesting
<a href="http://vocamus.net/dave/?p=1168" target="_blank">blog entry</a> discussing
world-creation for kids.) Day/night would ultimately reflect current
time, although they've been greatly sped up in this demo. Lots of
rough edges and missing UI, but all the textured triangles are
present, so it should be an accurate benchmark.<br />
(Drag with left mouse button to rotate, middle mouse button to zoom,
right mouse button to pan.)
</li>
<li><a href="http://dev.laptop.org/~cscott/nelldemo.20111101/nell_home_test.html" target="_blank">Nell at home</a>. Basic idea
(including transition) for activities which include dialog with
Nell or story-telling.<br />
Standalone model viewers:
<a href="http://dev.laptop.org/~cscott/nelldemo.20111101/watchtower_test.html" target="_blank">Castle</a> (from <a href="http://www.blendswap.com/3D-models/architecture/watchtower/" target="_blank">blendswap</a>),
<a href="http://dev.laptop.org/~cscott/nelldemo.20111101/sintel_test.html" target="_blank">"Nell"</a> (Sintel, from <a href="http://www.blendswap.com/3D-models/characters/sintel-lite-2-57b/" target="_blank">blendswap</a>),
<a href="http://dev.laptop.org/~cscott/nelldemo.20111101/sintel_lite_test.html" target="_blank">Alternate (lightweight) Nell model</a>,
<a href="http://dev.laptop.org/~cscott/nelldemo.20111101/maison_test.html" target="_blank">Alternate (heavyweight) house model</a>
(from <a href="http://www.blendswap.com/3D-models/architecture/little-house/" target="_blank">blendswap</a>).<br />
In model viewers: drag with left mouse button to rotate, middle
mouse button to zoom, right mouse button to pan.
</li>
<li><a href="http://dev.laptop.org/~cscott/nelldemo.20111101/music.html" target="_blank">Music maker</a>. Uses WebGL and the Web
Audio APIs to let you draw and perform music.<br />
Inspired by Andr&eacute; Michelle's
<a href="http://lab.andre-michelle.com/tonematrix" target="_blank">ToneMatrix</a> and
<a href="http://lab.andre-michelle.com/karplus-strong-guitar" target="_blank">Karplus-Strong
Guitar</a> (see also
<a href="http://en.wikipedia.org/wiki/Karplus-Strong_string_synthesis" target="_blank">wiki</a>
and this 2008 <a href="http://lac.linuxaudio.org/" target="_blank">Linux Audio Conference</a>
<a href="https://ccrma.stanford.edu/realsimple/faust_strings/faust_strings.pdf" target="_blank">paper</a>),
as well as <a href="http://labs.dinahmoe.com/" target="_blank">DinahMoe</a>'s
<a href="http://labs.dinahmoe.com/ToneCraft/" target="_blank">ToneCraft</a> and
the <a href="http://www.global.yamaha.com/tenori-on/" target="_blank">Tenori-on</a>.
</li>
<li><a href="http://www.youtube.com/watch?v=4Mr27yY8-A8" target="_blank">Quake on XO-1.75</a>
(video).
Of course we need to actually run WebGL with good performance on XO
hardware. Jon Nettleton has been working hard on our GL drivers,
enabling the GPU on the XO-1.75 hardware for the first time.
This Quake demo shows his progress&mdash;don't worry, Quake is not
actually part of the Nell demo! (We have a GPU in the XO-1.5 as
well, which hasn't yet been utilized.)
</li>
<li><a href="http://twolivesleft.com/Codify/" target="_blank">Codify</a>&mdash;not
one of our demos (it's a commercial iPad app) but it demonstrates
the direction we'd like to push <a href="http://wiki.laptop.org/go/Pippy" target="_blank">Pippy</a>.</li>
</ul>
<p>Coming soon: TurtleArt and Implode for the web. We've started
converting them to GTK3 in preparation for hoisting them bodily onto
the interwebs. Here's the <a href="http://git.sugarlabs.org/~cscott/turtleart/cscott-gtk3/commits/gtk3" target="_blank">source
code repository for the TurtleArt port</a> if you'd like to watch or
participate in this hackage. (See <a href="http://repl.it" target="_blank">repl.it</a>
for one of the more unusual ways to get Python running in the web
context.) The rest of the demo source code is on <a href="https://github.com/cscott/nelldemo" target="_blank">github</a> (or just "View Source" in your browser).</p></description>
<comments>https://cananian.livejournal.com/65380.html?view=comments#comments</comments>
<category>olpc</category>
<category>nell</category>
<lj:security>public</lj:security>
<lj:reply-count>1</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/65077.html</guid>
<pubDate>Sat, 01 Oct 2011 05:18:05 GMT</pubDate>
<title>Introducing Nell</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/65077.html</link>
<description><p>Between now and January <a href="http://en.wikipedia.org/wiki/Consumer_Electronics_Show" target="_blank">CES</a>, Chris Ball and I will be building <i>Nell</i> for the <a href="http://en.wikipedia.org/wiki/OLPC" target="_blank">OLPC</a> <a href="http://blog.laptop.org/2011/07/22/olpc-xo-3-design-update/" target="_blank">XO-3</a> tablet.
Nell is a name, not an acronym, but if you want to pronounce it as
"Narrative Environment for <a href="http://wiki.laptop.org/go/Learning_Learning" target="_blank">Learning Learning</a>," I won't stop you.</p>
<p>Nell's development will be demo-oriented&mdash;we're going to try to write the most
interesting bits first and learn as we go&mdash;so don't be upset if you
don't see support right away for legacy Sugar activities ("Sweet
Nell"), robust sharing support, mesh networking, or whatever
your favorite existing feature is. They'll come, but the new
crazy stuff is what we need to evaluate first.</p>
<p>Here are four of the big ideas behind Nell, along with pointers to some of our sources of inspiration.</p>
<p><b>Narrative.</b> I probably don't need to restate that Neil
Stephenson's "The Diamond Age" has been hugely influential, and we also owe
a large debt to interactive fiction and the <a href="http://pr-if.org/" target="_blank">Boston IF group</a> in particular. (Check out
the talks from our
"<a href="http://blog.printf.net/articles/2011/06/18/narrative-interfaces" target="_blank">Narrative
Interfaces day</a>" at OLPC.)
<a href="http://users.soe.ucsc.edu/~jskorups/wiki/wide_ruled/wide_ruled_v2" target="_blank">Wide
Ruled</a> (<a href="http://eis.ucsc.edu/sites/default/files/Skorupski_DAC09_WideRuledLessonsLearned.pdf" target="_blank">conference
paper</a>) and <a href="https://research.cc.gatech.edu/inc/mark-riedl" target="_blank">Mark Riedl</a>
at Georgia Tech have demonstrated interesting approaches to story representation.
I'm also looking forward to the results of the Experimental Game Play
group's September <a href="http://experimentalgameplay.com/blog/2011/09/story-game-in-september-2011/" target="_blank">Story
Game</a> competition.</p>
<p><b>Emotion.</b> The Radiolab podcast "<a href="http://www.radiolab.org/2011/may/31/" target="_blank">Talking To Machines</a>" crystallized my thinking about emotionally-attractive environments. The discussion with Caleb
Chung, the creator of Furby, is particularly apropos. Caleb's goal is
to make things which kids want to "play with for a long time," and he
contributes his three rules for creating things which "feel alive":
it must (1) feel and show emotions, (2) be aware of itself and its
environment, and (3) have behaviors which change over time. Furby's
pursuit of these goals include expressive eyes and ears, crying when
held upside down, reacting to loud noises, and gradually switching from <a href="http://en.wikipedia.org/wiki/Furby#Furbish-English_phrases" target="_blank">Furbish</a>
to English for its utterances. A living thing emits a
constant stream of little surprises. Expect to see Nell put the
XO-3's microphone and accelerometer to good use.</p>
<p><b>Talking and Listening.</b> The "Talking To Machines" podcast also discusses <a href="http://en.wikipedia.org/wiki/ELIZA" target="_blank">ELIZA</a> and <a href="http://en.wikipedia.org/wiki/Cleverbot" target="_blank">Cleverbot</a>, which
dovetails with my interest in the popular <a href="http://wiki.sugarlabs.org/go/Activities/Speak" target="_blank">Speak
activity</a> for Sugar and related toys like <a href="http://outfit7.com/apps/talking-tom-cat/" target="_blank">Talking Tomcat</a> for
mobile phones. The key insight here is that a little bit of "cheap
trick" AI can go a long way toward making a personable and engaging
system. We want Nell to feel like a friend. Recent work by
the <a href="http://csc.media.mit.edu/" target="_blank">Common Sense Computing
Initiative</a> at MIT's Media Lab shows how we can reset this on a sounder
basis and use mostly-unstructured input to allow the system to grow
and learn (creating "behaviors changing over time"). In particular, I'll cite <a href="http://csc.media.mit.edu/conceptnet" target="_blank">ConceptNet</a> for its
database and practical NLP tools, and inspiration from
"Empathy Buddy," "StoryFighter," and the other projects described in their
<a href="http://web.media.mit.edu/~push/Beating-Common-Sense.pdf" target="_blank">Beating
Common Sense</a> paper. It's also worth noting that open source
speech tools are good and getting better (the <a href="http://voxforge.org/" target="_blank">VoxForge</a> site points to most of them);
also interesting is <a href="http://festvox.org/transform/transform.html" target="_blank">this technique</a>
for matching a synthesized voice to that of the user.</p>
<p><b>Collecting, nurturing, and rewarding.</b> Collector games such as <a href="http://en.wikipedia.org/wiki/Pocket_Frogs" target="_blank">Pocket Frogs</a> and
<a href="http://www.facebook.com/iphoneflowergarden" target="_blank">Flower Garden</a>
are sticky activities which
encourage kids to come back to the device and continue working toward a goal over a long period of time.
<a href="http://www.technologyreview.com/printer_friendly_article.aspx?id=37874" target="_blank">Memrise</a>
is educational software illustrating this technique: its users tend a garden of flowers by
mastering a set of flash cards. Nell will incorporate the sticky aspects of such games, possibly also integrating the Mozilla <a href="http://openbadges.org/" target="_blank">Open Badges infrastructure</a> into an achievement/reward system.</p>
<p>I hope this has given you a general sense of the direction of our Nell project. In future
blog posts I'll drill down into implementation details, demonstration storyboards, and other more concrete facets of Nell.</p></description>
<comments>https://cananian.livejournal.com/65077.html?view=comments#comments</comments>
<category>sugar</category>
<category>olpc</category>
<category>nell</category>
<category>if</category>
<lj:security>public</lj:security>
<lj:reply-count>4</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/64747.html</guid>
<pubDate>Wed, 15 Jun 2011 21:27:50 GMT</pubDate>
<title>Narrative Interfaces</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/64747.html</link>
<description><p>One Laptop per Child creates student-centric learning experiences. Our current software stack, however, is somewhat "shallow". When you turn on the XO, all the content is immediately available but there is no path or guidance provided. Nothing suggests what you should try first, or indicates an order to progress through the activities provided. Everything is available, but there's no built-in journey. No plot. How can we improve this?</p>
<p><a href="http://www.timeanddate.com/worldclock/fixedtime.html?msg=Narrative+Interfaces+Talks+at+OLPC&amp;iso=20110617T14&amp;p1=43&amp;ah=2&amp;am=30" target="_blank">This Friday (June 17) at 2pm Eastern</a> we're inviting some folks over to OLPC's new offices at the <a href="http://www.americantwine.com/" target="_blank">American Twine</a> building to discuss <i>Narrative Interfaces</i>, as part of the proposed XO-3 software stack. <a href="http://nickm.com/" target="_blank">Nick Montfort</a> will give a short talk on <a href="http://curveship.com/" target="_blank"><i>Curveship</i></a>, his model-based interactive fiction system, and <a href="http://printf.net/" target="_blank">Chris Ball</a> will present some related recent hacking. <a href="http://web.media.mit.edu/~anjchang/" target="_blank">Angela Chang</a> will present her <i>Tinkerbooks</i> early-literacy platform, which allows kids to interactively change the written story on the page. And I'll discuss Neal Stephenson's novel <a href="http://en.wikipedia.org/wiki/The_Diamond_Age" target="_blank"><i>The Diamond Age</i></a> (a recap of <a href="http://www.dailymotion.com/video/xip6ep_en-the-diamond-age_tech" target="_blank">a short talk I gave at EduJAM in Uruguay</a>), and give concrete suggestions for how Diamond Age's <i>Primer</i> might influence the software architecture for the XO-3. (I might even reveal how to make software testing semantically indistinguishable from writing a game!) Chris Ball and I have also been collecting best-of-breed "comic books that teach you something" as examples of educational narrative; we'll pass those around and post a reading list after the event.</p>
<p>The real point of this meeting isn't the talks, per se, but the discussions to follow. We're trying to gather folks who know a lot more about this stuff than we do, in order to learn from them and be inspired. We don't have a lot of space, unfortunately, so I'm going to have to ask for RSVPs from those who wish to attend. If you're in the Boston area and feel like you have something to contribute (and especially if you have created/could create <a href="http://creativecommons.org/" target="_blank">Creative Commons</a>-licensed content for education), drop me a line at cscott at laptop dot org. Describing what you can contribute to the discussion will help break ties if space is inadequate.</p>
<p>We will also live-stream the meeting at <a href="http://www.ustream.tv/channel/cscottnet" target="_blank">ustream.tv/channel/cscottnet</a>. Afterwards we'll post higher-quality video and a list of cited works. Thanks in advance to everyone who will participate, online and off!</p>
<p><b>UPDATE:</b> video now up; see <a href="http://blog.printf.net/articles/2011/06/18/narrative-interfaces" target="_blank">this writeup on Chris Ball's blog</a>.</p></description>
<comments>https://cananian.livejournal.com/64747.html?view=comments#comments</comments>
<category>sugar</category>
<category>olpc</category>
<category>nell</category>
<category>if</category>
<category>games</category>
<category>curveship</category>
<lj:security>public</lj:security>
<lj:reply-count>0</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/64330.html</guid>
<pubDate>Tue, 24 May 2011 16:22:51 GMT</pubDate>
<title>Small systems... and distributed ones</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/64330.html</link>
<description><p>Today I stumbled across some very interesting projects by <a href="https://github.com/SamuraiJack" target="_blank">Nickolay Platonov</a> which I'd like to discuss in an OLPC context.</p>
<p>I've been hacking away at <a href="http://cscott.net/Projects/TurtleScript" target="_blank">TurtleScript</a> fueled partly by a drive for minimalism: a small system is a learnable system. To that end, the language is based on <a href="http://www.crockford.com/" target="_blank">Douglas Crockford</a>'s "Simplified JavaScript" (as recognized by <a href="http://javascript.crockford.com/tdop/tdop.html" target="_blank">this top-down operator precedence parser</a>) which tries hard to include only JavaScript's "<a href="http://www.livestream.com/etsy/video?clipId=pla_1463e546-47ed-4a93-b59a-bd52b236e8b8" target="_blank">Good Parts</a>". For example, the <a href="https://github.com/cscott/TurtleScript/blob/beeba5c138d88af40297f93689ecbe7721724819/crender.js#L333" target="_blank">initial code</a> for the TurtleScript system uses <a href="http://javascript.crockford.com/prototypal.html" target="_blank">prototype inheritance</a> (via <code>Object.create</code>) rather than classical class-style inheritance. In fact, the <code>new</code> operator isn't even included in the Simplified JavaScript/TurtleScript language.</p>
<p>In a discussion of TurtleScript Alan Kay mentioned, "It is very tricky to retain/maintain readability (so the first Smalltalk was also an extensible language not just semantically but syntactically)." And today I stumbled across the <a href="http://joose.it/" target="_blank">Joose</a> library, which gives a very <a href="http://joose.github.com/Joose/doc/html/Joose.html" target="_blank">readable syntax</a> for traditional class-based inheritance. It backs this up with a robust meta-object protocol, introspection, and lots of nice features borrowed from Perl 6, CLOS, and Smalltalk. The syntax ought to work fine with the limited tile set of TurtleScript, although I might have to add a tile for the <code>new</code> operator.</p>
<p>However, adding Joose raises some questions. Is the increase in readability worth the addition of such a large library to the system? What impact will this have on understanding problems and debugging? Is a return to class-based inheritance a positive change? (There have been arguments that the make-a-clone-and-change-it practice of prototype inheritance is easier to understand for new learners.) Can a larger overall system actually be easier to understand?</p>
<p>And once we're looking at libraries... Nickolay Platonov is now working on <a href="http://joose.it/blog/2011/04/08/syncler-distributed-applications-for-human-beings/" target="_blank">Syncler</a>, based on the <a href="http://joose.it/blog/wp-content/uploads/2011/03/Bayou-updates-propagation.pdf" target="_blank">Bayou</a> system. Unobstructive replication mechanisms would certainly make it easier to construct the sorts of collaborative applications we've wanted for <a href="http://en.wikipedia.org/wiki/Sugar_(desktop_environment)" target="_blank">Sugar</a>. I have two concerns with Syncler's current state. First, the use of <a href="http://joose.it/blog/2011/02/14/joosex-cps-tutorial-part-i/" target="_blank">explicit continuation-passing style</a> greatly impairs readability. The JavaScript <code>yield</code> keyword <a href="http://blog.ometer.com/2010/11/28/a-sequential-actor-like-api-for-server-side-javascript/" target="_blank">helps a lot</a> when writing asynchronous code. (It's not supported by all JavaScript engines, but <code>yield</code> wouldn't be hard to add to TurtleScript.) Second, Syncler's event model uses explicit callbacks. I've been greatly impressed with the <a href="http://www.flapjax-lang.org/" target="_blank">Flapjax</a> event model (and its <a href="http://lamp.epfl.ch/~imaier/pub/DeprecatingObserversTR2010.pdf" target="_blank">strongly-typed functional cousin</a>). Both of these changes ought to make asynchronous code much more readable&mdash;and isn't that an important part of <a href="http://en.wikipedia.org/wiki/Grok" target="_blank">grokking</a> a system?</p></description>
<comments>https://cananian.livejournal.com/64330.html?view=comments#comments</comments>
<category>javascript</category>
<category>sugar</category>
<category>olpc</category>
<category>turtlescript</category>
<category>programming</category>
<lj:security>public</lj:security>
<lj:reply-count>3</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/64140.html</guid>
<pubDate>Fri, 20 May 2011 06:06:15 GMT</pubDate>
<title>Turtles All The Way Down</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/64140.html</link>
<description><p><img src="https://imgprx.livejournal.net/9b91b2dab6eaf256d69dd8c4e15906b767c1ec52/p1mSi3tXVUwXGuSe_IHwDid88SdoMSrgGOlcGq7_FH48ARU5d8KRTT0onv8NOmo-98QhFjA5kFoOldhsu7HWYWHktqXe5BmXkvOy1pJ44rDR9ECcAdzXuoKgYBmbcc55" fetchpriority="high" /></p>
<p>Inspired by <a href="http://croquetweak.blogspot.com/" target="_blank">Bert Freudenberg</a>, <a href="http://piumarta.com/software/" target="_blank">Ian Piumarta</a>, and <a href="http://wiki.sugarlabs.org/go/User:Walter" target="_blank">Walter Bender</a>, I started hacking on "Turtles All The Way Down" (aka <a href="http://cscott.net/Projects/TurtleScript/" target="_blank">TurtleScript</a>) on the plane back from Uruguay.
Now there's a nice <a href="http://cscott.net/Projects/TurtleScript/ctiles.html" target="_blank">rendering demo</a> to show what a tile-based editor for JavaScript might look like, as well as a <a href="http://cscott.net/Projects/TurtleScript/tdop.html" target="_blank">bytecode compiler and interpreter</a> for the language. The <a href="https://github.com/cscott/TurtleScript/blob/f977f782bb2bda06d26e5eeb1259db95dd48f2ca/bytecode_table.js" target="_blank">bytecode instruction set</a> is still too large; encouraged by Craig Chambers' work on <a href="http://selflanguage.org/documentation/published/implementation.html" target="_blank">SELF</a> I think I ought to be able to replace all the unary and binary operators, conditional jumps, and slot selectors by a single <code>mapof</code> operator. I can put a better <a href="http://piumarta.com/software/cola/objmodel2.pdf" target="_blank">object model</a> on the interpreter, too;
I've written some <a href="http://cscott.net/Projects/TurtleScript/#simplifying-the-environment" target="_blank">notes on the matter</a>.</p>
<p>The question is: does this really have educational value? "Turtles all the way down" is a great slogan, and a fine way to teach a graduate-level class on compiler technology, but I feel that the higher-level UI for tile-based program editing is the really useful thing for tablet computing. I'm a compiler geek and love the grungy underbelly of this stuff, but I keep reminding myself I should really be spending more time building a beautiful fluffy surface.</p></description>
<comments>https://cananian.livejournal.com/64140.html?view=comments#comments</comments>
<category>javascript</category>
<category>sugar</category>
<category>olpc</category>
<category>turtlescript</category>
<category>turtles</category>
<lj:security>public</lj:security>
<lj:reply-count>1</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/63783.html</guid>
<pubDate>Fri, 29 Apr 2011 15:47:57 GMT</pubDate>
<title>Next Steps for New Technologies</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/63783.html</link>
<description><p>I've reached the end of the month. I've accomplished my
Android and NativeClient-related <a href="http://cananian.livejournal.com/62667.html" target="_blank">goals</a>, but didn't get the time to do
as much mesh and python investigation as I'd wanted. Here are some
ideas for next month's work. (Next week I'll be in Uruguay for <a href="http://wiki.sugarlabs.org/go/Uruguay_Summit_2011" target="_blank">EduJAM</a>.)</p>
<h3>GObject Introspection (Android or NaCl)</h3>
<ol>
<li>Start by porting <a href="http://en.wikipedia.org/wiki/Libffi" target="_blank">libffi</a>. An android port would be
straightforward, but since libffi involves code generation
(<a href="https://github.com/atgreen/libffi/blob/master/src/arm/ffi.c#L557" target="_blank">ARM</a>, <a href="https://github.com/atgreen/libffi/blob/master/src/x86/ffi.c#L475" target="_blank">x86</a>), this is going to require a bit of assembly
magic and the new "JIT"/"shared library" support in the NaCl plugin.</li>
<li>Then port <a href="http://blogs.gnome.org/johan/2008/06/01/introduction-to-gobject-introspection/" target="_blank">gobject-introspection</a>. GObject-Introspection relies on
libffi for its guts, but the <strong>hard</strong> part of this port will be refactoring
g-i's build process, which is <a href="http://mail.gnome.org/archives/gtk-devel-list/2009-March/msg00062.html" target="_blank">not cross-compilation
friendly</a>. Might need to rewrite some tools. If targeting NaCl, you might consider finishing the <a href="https://groups.google.com/group/native-client-discuss/msg/1e61ab5f7bd71797" target="_blank">code allowing execution of unsandboxed NaCl binaries</a>.</li>
<li>Turn gobject-introspection on its head: generate GIR and a
C binding for the platform "native" interface. For NaCl,
this would be a <a href="http://www.w3.org/DOM/Bindings" target="_blank">GObject-using C-level binding
of the browser-native DOM</a>; for
Android, this would be a GIR binding of the native Android APIs. These bindings should be mostly
automatically generated, since they will need to continue tracking
successive native platform releases/HTML5 features.</li>
<li>Demos! Change browser DOM from Python, write native Android apps
in Python. Add a gobject-introspection binding to <a href="http://dev.laptop.org/git/users/wmb/cforth" target="_blank">cforth</a>,
then do the same from forth. (Forth might be a simpler place to
start than Python. Or not.)</li>
</ol>
<h3>GTK (Android or NaCl)</h3>
<ol>
<li> Build on the cairo/pango port to proceed to a full GTK backend for
Android/NaCl. These backends ought to be upstreamable. The NaCl
port should be based on the <a href="http://blogs.gnome.org/alexl/2011/03/15/gtk-html-backend-update/" target="_blank">broadway</a> work: the cairo canvas
would be drawn to more directly, but a lot of the mechanism which
captures JavaScript events and translates them into the GTK event loop
could probably be reused.</li>
<li> Demo: "Hello GTK world" in Android/NaCl.</li>
</ol>
<h3>Sugar partitioning.</h3>
<p>Bring Sugar closer to being a true
multi-language multi-library platform.</p>
<ol>
<li> Refactor sugar modules (for example, sugar toolbar widget) as
standalone C libraries. Basic idea is to embed Python and export
a C API, while preserving as much of the code as possible. Python
libraries now invoke this library via g-i-r instead of directly.
The python embedding tool is probably a useful standalone product.</li>
<li> Rewrite "Hello, Sugar" activity in C (or <a href="http://en.wikipedia.org/wiki/Vala_(programming_language)" target="_blank">vala</a>), using <code>#include</code> for <code>import</code>
and <a href="http://en.wikipedia.org/wiki/GObject" target="_blank">GObject</a> inheritance instead of python inheritance. Use this as
a guide to pull apart sugar into modules (as above) to make this
code actually work as written.</li>
</ol>
<h3>Miscellanous topics</h3>
<ol>
<li> <a href="http://en.wikipedia.org/wiki/Google_Chrome_OS" target="_blank">ChromeOS</a> w/ touch support.
<p>Find an appropriate machine, do an installation, what are the
roadblocks/rough spots? Can we install on <a href="http://www.engadget.com/2011/01/09/marvell-powered-olpc-xo-1-75-only-draws-2-watts-of-power-finall/" target="_blank">XO-1.75</a> as a testbed?</p>
</li>
<li>TurtleArt as JavaScript viewer/editor.
<p>Revisit <a href="https://github.com/cscott/TurtleScript#readme" target="_blank">TurtleScript</a> work, but skip over the
time-consuming "construct an editor" step by reusing the
(excellent) <a href="http://wiki.laptop.org/go/Turtle_Art" target="_blank">TurtleArt</a> code.</p>
</li>
<li> Mesh: android <a href="http://lists.olsr.org/pipermail/olsr-dev/2011-April/004439.html" target="_blank">olsrd</a> frontend, build testbed, research 802.11 DCF issues.</li>
</ol>
<h3>Summary</h3>
<p>There are four rough topics here; I might try to continue the
breadth-first search by spending a week on each. It might be more
satisfying to downselect two of these issues and spend two weeks on
each.</p></description>
<comments>https://cananian.livejournal.com/63783.html?view=comments#comments</comments>
<category>nativeclient</category>
<category>javascript</category>
<category>sugar</category>
<category>olpc</category>
<category>android</category>
<category>programming</category>
<category>mesh</category>
<lj:security>public</lj:security>
<lj:reply-count>0</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/63595.html</guid>
<pubDate>Fri, 29 Apr 2011 15:08:56 GMT</pubDate>
<title>Pango/Android -vs- Pango/NaCl</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/63595.html</link>
<description><p>At the end of <a href="http://cananian.livejournal.com/62756.html" target="_blank">my Sugar/Android</a> week, I had a simple
<a href="http://en.wikipedia.org/wiki/Pango" target="_blank">Pango</a>-on-<a href="http://en.wikipedia.org/wiki/Cairo_(graphics)" target="_blank">Cairo</a> demo running. This was built on a stack
of ported libraries, including <a href="http://en.wikipedia.org/wiki/Gettext" target="_blank">gettext</a>, <a href="http://cgit.freedesktop.org/pixman/tree/README" target="_blank">pixman</a>,
<a href="http://en.wikipedia.org/wiki/FreeType" target="_blank">freetype</a>, <a href="http://en.wikipedia.org/wiki/Libxml2" target="_blank">libxml2</a>, <a href="http://en.wikipedia.org/wiki/Fontconfig" target="_blank">fontconfig</a>, and <a href="http://en.wikipedia.org/wiki/Glib" target="_blank">glib</a>,
as well as <a href="http://en.wikipedia.org/wiki/Cairo_(graphics)" target="_blank">cairo</a> and <a href="http://en.wikipedia.org/wiki/Pango" target="_blank">pango</a>. You can run the demo
yourself by <a href="http://en.wikipedia.org/wiki/Sideloading" target="_blank">sideloading</a> <a href="http://dev.laptop.org/~cscott/Android/Pango/pango-demo.apk" target="_blank">pango-demo.apk</a> onto your Android
device (tested on a Motorola <a href="http://en.wikipedia.org/wiki/Motorola_Xoom" target="_blank">Xoom</a>), and you can <a href="http://dev.laptop.org/git/users/cscott/android-libs/tree/" target="_blank">browse the
source code</a> to see what it entailed (here's the <a href="http://dev.laptop.org/git/users/cscott/android-libs/tree/jni/Makefile.devel" target="_blank">scariest
part</a>). (I was inspired by Akita Noek's <a href="https://github.com/anoek/android-cairo" target="_blank">android-cairo project</a>,
but I ended up reworking the build scheme and redoing most of the
ports.)</p>
<a href="http://dev.laptop.org/~cscott/Android/Pango/screenshot.png" target="_blank"><img src="https://imgprx.livejournal.net/28d8ab2bb527e3657f7f2e86a91818591f07ad4c/p1mSi3tXVUwXGuSe_IHwDvdhl9c3MOPZ6unsGmM4ErFzxk3TlY2IMoGaeIdaiC6PYkdhxFLHFYthKYnuPlkGe0kencJQ6ykAe_lJZ5iAuEg" width="300" alt="Screenshot of Pango demo on Android" title="Pango demo on Android" fetchpriority="high" /></a>
<p>It made sense to start my Sugar/<a href="http://en.wikipedia.org/wiki/Google_Native_Client" target="_blank">NaCl</a> investigation by porting
the same demo application to Native Client. The same stack of ported
libraries was involved, although it was easy to include more
functionality in the Native Client ports, including threading and
PNG/PS/PDF support in cairo. The <a href="http://dev.laptop.org/git/users/cscott/naclports" target="_blank">source code</a> is a fork from
the upstream <a href="http://code.google.com/p/naclports/" target="_blank">naclports</a> project, and the process was generally much cleaner.
(But see my previous post for some <a href="http://cananian.livejournal.com/63325.html" target="_blank">caveats regarding naclports</a>.)
If you're using Chrome 10 or 11, you can <a href="http://dev.laptop.org/~cscott/NaCl/Pango/cairo.html" target="_blank">run the demo in your
browser</a> (follow the instructions on that page). The
Wesnoth team has a parallel project which <a href="https://groups.google.com/group/native-client-discuss/msg/8bfa6401e4951551?pli=1" target="_blank">ported some of these libraries as well</a>, but
not in an upstreamable manner.</p>
<a href="http://dev.laptop.org/~cscott/NaCl/Pango/screenshot.png" target="_blank"><img src="https://imgprx.livejournal.net/78f325f7523b8dc6fe87f38eafed29f56ae80467/p1mSi3tXVUwXGuSe_IHwDvdhl9c3MOPZ6unsGmM4ErE2UeGWLdo5S1WP86H0YJ4HVx5RpW7REm3nrrnLMIyaXVhL5inVoDn5EYWGS-sdFZ0" width="300" alt="Screenshot of Pango demo on Native Client" title="Pango demo on NaCl" loading="lazy" /></a>
<p>The demo app uses cairo to draw the background, an animated X, and
some basic text in the center; it uses Pango's advanced international
text support to draw properly-shaped Persian text in a circle
around it. The center text is the "proper" bilingual Greek/Japanese
written form of "pango"; the text around the edges is the Persian name of
the internationalization library, "harfbuzz". Note that the Persian
text is written right-to-left&mdash;and that I didn't put a full CJK
font in the NaCl app, so the Japanese "go" character is missing.
The Android port rebuilds the font cache at each startup, so it loads
rather slowly; the NaCl port contains a prebuilt font cache so it starts
more quickly.</p>
<p><b>Both ports took about two weeks.</b> I blew my <a href="http://cananian.livejournal.com/62667.html" target="_blank">original schedule</a>,
partly due to the Patriot's day holiday, and partly because I'd given
Android about a week's head start by tinkering on it before my
original schedule post. The framerate of the demo is much better on
NaCl (so fast that the edges of the animated X look choppy in the
screenshot), but the hardware isn't easily comparable, so the
comparison doesn't really tell us much. The porting effort was
certainly more pleasant on NaCl, since newlib is a much more complete
libc than Android's "Bionic"&mdash;but having gdb available made
debugging on Android easier. (There is an unintegrated NaCl branch that
<a href="https://groups.google.com/group/native-client-discuss/browse_thread/thread/e11fdea235fa3702" target="_blank">integrates NaCl gdb in the browser</a>, though!)</p>
<p>Much of the GNOME/POSIX library stack assumes access to a filesystem
tree and does file-based configuration. In our demo application,
fontconfig was the most culpable party: it wanted to load a
configuration file describing font locations and naming, then to load
the fonts themselves from the file system, and finally to write a
cache file describing what it found back to the file system. Most
ported software is going to want similar access&mdash;even if you store
the user's own documents in a <a href="http://wiki.laptop.org/go/Journal_Activity" target="_blank">Journal</a>, software still expects
to find configuration, caches, and other data in a filesystem.</p>
<p>Android provides the <b>POSIX filesystem APIs</b>, but the filesystem an app can
touch is segmented and sandboxed. As discussed previously, Android's
<a href="http://developer.android.com/reference/android/os/storage/StorageManager.html" target="_blank">Opaque Binary Blob</a> feature may allow you to create a app-specific
filesystem, but this doesn't let you share (for example) fonts and
font configuration between activities. NaCl might eventually provide
a similar unshared mechanism based on the HTML5 <a href="http://www.html5rocks.com/tutorials/appcache/beginner/" target="_blank">AppCache</a>.</p>
<p>The preferred solution is more limited, but more flexible: no built-in
filesystem APIs are used (or in NaCl's case, provided!) at all.
Instead, you provide your own implementation of the POSIX file APIs
(either via the <a href="https://groups.google.com/group/native-client-discuss/msg/4b84cd47910430e2" target="_blank">--wrap linker indirection</a> or through an appropriate
backend to newlib/glibc/glib). For the NaCl demo app, I wrote a
rather-elaborate <a href="http://dev.laptop.org/git/users/cscott/naclports/tree/src/examples/graphics/cairo/cairo_files.c" target="_blank">in-memory filesystem</a> --- only to find that an
even-more-elaborate one <a href="http://dev.laptop.org/git/users/cscott/naclports/tree/src/packages/scripts/memory_filesys" target="_blank">already existed in naclports</a>. But the
longer-term solution uses message-passing (<a href="https://sites.google.com/a/chromium.org/dev/nativeclient/how-tos/simple-rpc" target="_blank">SRPC</a> in NaCl, <a href="http://developer.android.com/guide/topics/intents/intents-filters.html" target="_blank">intents</a> in
Android) to implement these POSIX APIs. In Native Client, the
implementation would be in browser-side JavaScript, which would then
allow you to share parts of the filesystem tree between activities
and/or map it into (cached) web-addressed resources. In either case,
your application still sees the bog-standard POSIX API it expects.</p>
<p>More problematic are the <b>networking APIs</b>. Here Android provides
a pretty standard socket library, while Native Client provides
nothing at all. Using a browser-based implementation, as for
the file APIs, will work fine for HTTP, <a href="http://en.wikipedia.org/wiki/WebSockets" target="_blank">WebSockets</a> and even P2P via the
<a href="http://rtc-web.alvestrand.com/home/papers/juberti-p2ptransport-api.pdf" target="_blank">HTML5 P2P APIs</a>. But it's not clear that (for example) glib's
elaborate <a href="http://git.gnome.org/browse/glib/tree/gio/libasyncns/asyncns.c" target="_blank">asynchronous DNS name resolver implementation</a> can (or
should!) be implemented in a NaCl port.</p>
<p>In the end, the porting effort and abstraction shifts needed for
Native Client and Android are <b>roughly comparable</b>. I expect
Native Client will hold a strong edge in allowing close
integration with web standards and web technologies. Android will
probably continue to hold an edge in third-party application support and
platform maturity.</p></description>
<comments>https://cananian.livejournal.com/63595.html?view=comments#comments</comments>
<category>nativeclient</category>
<category>sugar</category>
<category>olpc</category>
<category>android</category>
<category>programming</category>
<category>gnome</category>
<lj:security>public</lj:security>
<lj:reply-count>1</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/63325.html</guid>
<pubDate>Fri, 29 Apr 2011 14:24:36 GMT</pubDate>
<title>Sugar-on-Native Client investigation</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/63325.html</link>
<description><p>This post will describe the state of Native Client in general, based on
week 2 of my <a href="http://cananian.livejournal.com/62667.html" target="_blank">original four week plan</a>. In the next post, I'll
link to my work so far, and compare the Native Client and the Android
efforts. Recapping, the end goal of these explorations is a platform for the next generation of the
<a href="http://en.wikipedia.org/wiki/Sugar_(desktop_environment)" target="_blank">Sugar learning environment</a>.</p>
<p>To begin, the Native Client (NaCl) plugin is fairly mature in a number of
areas. Version <a href="http://code.google.com/chrome/nativeclient/docs/releasenotes.html" target="_blank">0.2 of the NaCl SDK</a> was recently released (a
version number which substantiates the "fairly" in my previous
sentence), and the NativeClient plugin is currently shipping in Chrome
(versions 10 and 11), although you have to manually turn on a
preference in the <code>about:flags</code> dialog to enable it. The
NaCl toolchain is much more standard than the Android NDK toolchain <a href="http://cananian.livejournal.com/62756.html" target="_blank">I
discussed previously</a>, and the robust <a href="http://code.google.com/p/naclports/" target="_blank">naclports</a> tree shows
that the patches required for NaCl ports of common packages <a href="http://code.google.com/p/naclports/source/browse/trunk/src/packages/scripts/pixman-0.16.2/nacl-pixman-0.16.2.patch" target="_blank">tend not
to be too evil</a>. The <a href="http://wiki.tcl.tk/28211" target="_blank">Tcl
interpreter</a> and <a href="http://dev.laptop.org/~cscott/NaCl/Qt/" target="_blank">Qt tookit port</a> demos show that fairly complex pieces of code can be deployed today on NaCl.</p>
<p>On the other hand, there are three main difficulties:</p>
<ol>
<li> The default NaCl toolchain uses <a href="http://en.wikipedia.org/wiki/Newlib" target="_blank">newlib</a> as its standard C library.
This is consistent with Google's preference for BSD-licensed code in
SDKs they provide to the public (see the <a href="http://codingrelic.geekhold.com/2008/11/six-million-dollar-libc.html" target="_blank">discussion of Bionic in the
Android SDK</a>). However, there also exists <a href="https://groups.google.com/group/native-client-discuss/msg/16bcc685269fa09e" target="_blank">a branch of the SDK which
uses glibc</a>. The glibc branch supports several additional
features, like <a href="http://code.google.com/p/nativeclient/issues/detail?id=565" target="_blank">shared library support</a>. However, it is unclear
whether this will ever be a "supported" part of the SDK. If glibc does
become supported, it is unlikely ever to be the <i>only</i> supported libc;
the BSD-licensed newlib will need to remain available as an option.
(Yes, the LGPL license of glibc shouldn't inspire such paranoia, but
Google has elected not to undertake the education of all prospective
third-party developers.)</li>
<li> The naclports project, although fairly robust, is driven between the
<a href="http://en.wikipedia.org/wiki/Between_Scylla_and_Charybdis" target="_blank">Scylla and Charybdis</a> of compatibility. The goal is that all
the code in naclports be buildable at all times on all three major
platforms: Windows, Mac, and Linux. Further, it should support both
x86_32 and x86_64 backends, and ideally ARM and <a href="http://nativeclient.googlecode.com/svn/data/site/pnacl.pdf" target="_blank">pNaCl</a> as well.
It's <a href="http://build.chromium.org/p/client.nacl.ports/console" target="_blank">auto-built</a> against the latest SDK sources, but should also work
on the latest <i>released</i> SDK. And with the addition of the
glibc/newlib split discussed above, the possible build targets are
multiplied further. Needless to say, keeping the tree building
against such a large number of variants is not an easy task, and
naclports is usually broken in some way. In practice, most developers
seem to pay attention to some subset (say, x86_32/newlib/Linux host),
but it's hard to push patches upstream without worrying about breaking
some obscure target. It might be best to base future work on a
proper package technology, like (say) dpkg-cross.</li>
<li> In general, a lot of interesting NaCl development has occurred on
branches that are not easily integrated. I've already mentioned glibc
support, which is a toolchain branch; shared library support is on
another branch that requires a new chromium plugin as well. At
various times different means have been implemented to run NaCl
binaries "natively" outside the sandbox (for example, in order to test
some feature at build time, or auto-generate some piece of code via
introspection). These efforts live on abandoned branches, while the
"official" means to do this is incomplete. Similarly, a lot of
interesting NaCl work used the now-abandoned legacy "<a href="http://en.wikipedia.org/wiki/NPAPI" target="_blank">NPAPI</a>" plugin
interface to interact with the browser. It was followed by the
"Pepper" plugin interface, which was <a href="https://wiki.mozilla.org/NPAPI:Pepper" target="_blank">itself abandoned</a>. Current
work uses the <a href="http://code.google.com/p/ppapi/" target="_blank">Pepper2</a> browser plugin APIs, which
(unfortunately) have not yet been implemented in non-Chrome browsers
and continue to flux about. Many interesting browser interactions
exist only in deprecated Pepper APIs, not having yet been built into
Pepper2. ARM and pNaCl work also appears to be on unintegrated
branches. There are a number of different <a href="https://sites.google.com/a/chromium.org/dev/nativeclient/how-tos/debuggingtips" target="_blank">gdb support
strategies</a>.</li>
</ol>
<p>None of these difficulties is insurmountable&mdash;and in fact, some
are side-effects of the desirable active development and
productization of Native Client. To date I've done my work on the
(more compatible) SDK v0.1 and the (more upstreamable) newlib library.
So far newlib has not been a huge obstacle, and this basis allows my
patches and ports to be more broadly useful. This might change in the
future&mdash;certainly at some point we need to move to ARM and/or
pNaCl for XO-3, which will probably require building chrome and the NaCl
toolchain from scratch. At that point, it may be worth further
exploring the non-mainstream branches.</p></description>
<comments>https://cananian.livejournal.com/63325.html?view=comments#comments</comments>
<category>nativeclient</category>
<category>sugar</category>
<category>olpc</category>
<category>programming</category>
<lj:security>public</lj:security>
<lj:reply-count>1</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/62756.html</guid>
<pubDate>Tue, 12 Apr 2011 17:40:48 GMT</pubDate>
<title>Sugar-on-Android, week one</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/62756.html</link>
<description><p>Last week I described a four-week plan to survey key technologies for
One Laptop Per Child's forthcoming XO-3 tablet computer. Here I'll
describe the results of the first week of work, which dove into
Google's Android operating system. <i>Warning: technical content ahead...</i></p>
<h3>Basic design of Sugar-on-Android</h3>
<ol>
<li>Cross-compile gobject/GTK/gobject-introspection/cairo/dbus for Android;
distribute these key libraries as <a href="http://developer.android.com/sdk/ndk/" target="_blank">NDK</a> libraries. This is what I spent
most of my time on this week: I've managed so far to port libiconv, gettext,
glib, pixman, freetype, fontconfig, cairo, libxml2, and pango. (<a href="http://dev.laptop.org/git/users/cscott/android-libs" target="_blank">Source code</a>)</li>
<li>Use cairo or OpenGL backends of GTK3 to render legacy Sugar activities directly to Android
canvas.</li>
<li>Modularize sugar; use <a href="http://www.freedesktop.org/wiki/Software/dbus" target="_blank">D-Bus</a> for inter-module communication.
Interprocess communication mechanism is Android <a href="http://developer.android.com/guide/topics/intents/intents-filters.html" target="_blank">'intents'</a>; these can
<a href="http://developer.android.com/resources/articles/can-i-use-this-intent.html" target="_blank">redirect to the web or the Android Market for missing dependencies</a>. (<a href="http://blogs.gnome.org/uraeus/2011/04/12/gstreamer-and-android/" target="_blank">Collabora reportedly already has a D-Bus implementation for Android</a>.) Sugar components can also become Android <a href="http://developer.android.com/guide/topics/fundamentals/services.html" target="_blank">Services</a>.</li>
<li>Implement Sugar <a href="http://wiki.sugarlabs.org/go/Human_Interface_Guidelines/The_Laptop_Experience/Zoom_Metaphor" target="_blank">Home/Groups/Neighborhood</a> views and <a href="http://wiki.sugarlabs.org/go/Human_Interface_Guidelines/The_Laptop_Experience/The_Journal" target="_blank">Journal</a> as four separate Android
<a href="http://developer.android.com/guide/topics/appwidgets/index.html" target="_blank">App Widgets</a>. These could also be implemented by <a href="http://developer.android.com/resources/samples/Home/index.html" target="_blank">providing a new Android home application</a>, but I think the finer-grained modularity afforded by splitting these functions would yield a better design and make it easier to incorporate upstream improvements to the Android launcher.(Android <a href="http://developer.android.com/resources/samples/CubeLiveWallpaper/index.html" target="_blank">Live Wallpaper</a> is also similar in function, but not as good a fit.)</li>
<li>The Sugar <a href="http://wiki.sugarlabs.org/go/Human_Interface_Guidelines/The_Laptop_Experience/The_Journal" target="_blank">Journal</a> becomes an Android <a href="http://developer.android.com/guide/topics/providers/content-providers.html" target="_blank">"Content Provider"</a>, which
stores/retrieves content for other Sugar activities. (There is special Android support for <a href="http://developer.android.com/resources/samples/WeatherListWidget/index.html" target="_blank">"collection-based Widgets"</a> and <a href="http://developer.android.com/resources/articles/live-folders.html" target="_blank">Live Folders</a> which may be helpful.)</li>
<li>Use <a href="https://live.gnome.org/GObjectIntrospection" target="_blank">gobject-introspection</a> to build a multi-language environment.
Use <a href="http://live.gnome.org/JGIR" target="_blank">JGIR</a> to expose Sugar APIs to "native"
Dalvik apps; use something like the <a href="http://code.google.com/p/android-scripting/" target="_blank">Android Scripting Environment</a> to expose Android native
APIs to GIR languages (Python, JavaScript, C, etc).</li>
<li>[opportunity] Use the <a href="http://www.olsr.org/?q=node/30" target="_blank">Android port of OLSRd</a> to implement a <a href="http://wiki.sugarlabs.org/go/Human_Interface_Guidelines/The_Laptop_Experience/Zoom_Metaphor#Neighborhood" target="_blank">Neighborhood view</a>.
Alternatively, investigate <a href="http://code.google.com/p/adhoc-on-android/" target="_blank">AODV routing on Android</a> and/or <a href="https://www.alljoyn.org" target="_blank">AllJoyn</a> (which also requires root access, see <a href="https://www.alljoyn.org/sites/default/files/80-BA001-1_C_AllJoyn-Android-NDK-Developer-Guide.pdf" target="_blank">pg 24-25 of the manual</a>).</li>
</ol>
<h3>Key Benefits</h3>
<ul>
<li>Sugar is integrated into Android environment; use native Android
education apps, or apps like <a href="http://www.gottabemobile.com/2011/02/18/android-3-0-honeycomb-movie-studio-enables-movie-editing-on-the-go/" target="_blank">Movie Studio</a> which have no Sugar
equivalents yet.</li>
<li>Android APIs and customization hooks are good, and provide a
more-extensible framework for development.</li>
</ul>
<h3>Open challenges (general)</h3>
<ol>
<li>The web integration story is cloudy. <a href="http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/WebViewDemo/src/com/google/android/webviewdemo/WebViewDemo.java" target="_blank">Java and JavaScript can call each other inside a bundled WebView widget</a>,
but this isn't supported in standard Browser app. Browser plugin interface would help.</li>
<li>No good story for building 'native' <a href="http://en.wikipedia.org/wiki/Dalvik_(software)" target="_blank">Java/Dalvik</a> or C apps on the device.
Writing a simple Dalvik compiler would help. <a href="http://en.wikipedia.org/wiki/Dalvik_(software)#External_links" target="_blank">Dalvik specs are available</a>, and people have
written <a href="http://benlynn.blogspot.com/2009/02/compiler-compilers_11.html" target="_blank">Dalvik compilers for toy languages</a>.</li>
<li>"View source" requests can be implemented as an Android 'intent' message,
but no good story for implementing this functionality other than on a case-by-case basis in each activity.</li>
<li>Although the Amazon Marketplace for Android indicates that it can be done, it appears that there is no "blessed" mechanism for creating .apk files on the device and installing them. (<a href="http://code.google.com/p/android/issues/detail?id=545" target="_blank">Android bug</a>, <a href="http://groups.google.com/group/android-developers/browse_thread/thread/fe0978b471d4bef4/72507bfb7586aded?lnk=gst" target="_blank">discussion</a>)</li>
</ol>
<h3>Current technical issues/bugs</h3>
<ol>
<li>Cross-compiling for Android is currently a miserable
experience. The Android NDK appears to have been put together by a
team which had never seen a proper cross-compiler before. Since I
only had a week for this exploration, I mostly <a href="http://dev.laptop.org/git/users/cscott/android-libs/tree/jni/Makefile.devel" target="_blank">kludged things together</a>
to get past this, but any serious work with Android should start by
defining and upstreaming proper autoconf "target triplets" for
Android-on-{ARMv5, ARMv7, x86} and building a proper cross-compiler.
Then patches to various tools and libraries could start being
upstreamed. Using the bespoke <code>Android.mk</code> build system of the NDK is
a non-starter. No serious obstacles here, just work to
do.</li>
<li>Xoom hardware is ARMv7, but <a href="http://groups.google.com/group/android-ndk/browse_thread/thread/a19fc6df3d661d79" target="_blank">Android emulator is ARMv5 only</a>.
Unfortunately, gdb is broken on the Xoom. So we're
building for ARMv5 at the moment, so we can debug in the (slow) emulator.</li>
<li>No good support for shared libraries may cause activity bloat.
May be able to be worked around using the <a href="http://developer.android.com/reference/android/os/storage/StorageManager.html" target="_blank">new Opaque Binary Blob (OBB) feature</a>.</li>
<li>Much existing code (fontconfig, gettext, gtk, etc) expects to read
configuration files from the filesystem. Currently we are using the
default fall-back configurations. OBB support may help here as well.
There are a number of different <a href="http://developer.android.com/guide/topics/data/data-storage.html" target="_blank">storage APIs in Android</a>, but none seems quite right.
</li>
<li>It would be nice to implement a ring-style XO home screen without
completing replacing the android Launcher. No clear way to constrain
app layout on home screen w/o completely replacing the Launcher.
Is it worth hacking the <a href="http://android.git.kernel.org/?p=platform/packages/apps/Launcher2.git;a=summary" target="_blank">Launcher source</a>?</li>
<li>Mesh on Android using OLSRd current requires root access. In order
to run on unrooted Android devices, we need (a) proper power
management for Ad Hoc mode wifi, (b) APIs to enable Ad Hoc mode, and
(c) APIs to manipulate kernel routes.</li>
<li>We're building libraries without thread support because Android's
"Bionic" libc has an eccentric thread library. Linking with
<code>-lpthread</code> fails because the thread functionality is bundled into <code>-lc</code>.
Probably just providing an empty <code>libpthread.so</code> would help a lot.</li>
<li>Some work has been done to build GNU libc for Android. This bloats
activities even further, but might help ease library porting.</li>
<li>Porting gobject-introspection will be painful because <a href="http://mail.gnome.org/archives/gtk-devel-list/2009-March/msg00062.html" target="_blank">its makefiles
are not set up for cross-compiling</a>. Some steps want to run on the
target hardware, which is difficult in the Android environment.</li>
</ol>
<h3>Bottom line</h3>
<p>I can see how the whole Sugar stack can be put together on the Android
platform. The hardest part is probably just setting up packaging
and a good and repeatable build environment for the different
components, and getting enough adoption of this that patches to
support Android can be pushed upstream. Many of the important pieces
can be developed in parallel (Theme, Journal, Mesh, Friends, Home,
library porting, etc). A little early to tell how hard it will be
to port existing Sugar activities to the new Python/pygobject/GTK3
framework.</p></description>
<comments>https://cananian.livejournal.com/62756.html?view=comments#comments</comments>
<category>sugar</category>
<category>olpc</category>
<category>android</category>
<lj:security>public</lj:security>
<lj:reply-count>5</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/62667.html</guid>
<pubDate>Mon, 04 Apr 2011 21:48:52 GMT</pubDate>
<title>Exploring New Technologies</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/62667.html</link>
<description><p>Last Monday I rejoined <a href="http://laptop.org" target="_blank">One Laptop Per Child</a> as Director, New
Technologies. My mandate is hardware and software for the XO-3,
OLPC's upcoming ARM-based tablet computer for education in the
developing world. The new machine should be lower cost, lower power,
more indestructible, more powerful, and potentially more expandable
than ever. There are <a href="http://wiki.laptop.org/go/Deployments" target="_blank">about two million machines</a> in the XO-1 family
(XO-1, XO-1.5) in the hands of kids
today. The XO-3 will build upon
this impressive foundation to reach further into the poorest and
least-connected regions of the world.</p>
<p>I will kick-off my work with a series of <b>four week-long sprints</b>
between now and <a href="http://wiki.sugarlabs.org/go/Uruguay_Summit_2011" target="_blank">eduJAM Uruguay</a>
to investigate a
number of possible directions for the educational software stack on
the XO-3 tablet. On the XO-1&mdash;series machines OLPC ships <a href="http://en.wikipedia.org/wiki/Sugar_(desktop_environment)" target="_blank">Sugar</a>, an
impressive collection of educational software developed by
<a href="http://sugarlabs.org/" target="_blank">Sugar Labs</a>. How can we best keep
the best of Sugar while yanking the UI forward into a touch-friendly
tablet world?</p>
<ol>
<li>This week (April 4-8) I'll begin by working on a <b>port of the <a href="http://gtk.org" target="_blank">GTK3</a> UI library to
<a href="http://en.wikipedia.org/wiki/Android_(operating_system)" target="_blank">Android</a></b>. The GTK3 library contains touch support missing from the
GTK2 library on which Sugar is currently based. The end goal here
would be a full port of the Python/GTK-based Sugar APIs, running on
something like the Honeycomb Android OS. Our existing educational
activities could be ported to the new APIs without too much
difficulty, but we'd largely use the existing Android OS facilities
instead of the parts of Sugar concerned with low-level system
management. To clarify: this is a preliminary exploration&mdash;we
haven't decided to base the tablet software on Android (or anything
else) yet.</li>
<li>The next week brings a new direction. During the week of April 11-15
I will start <b>porting Python/GTK3 to <a href="http://en.wikipedia.org/wiki/Google_Chrome" target="_blank">Chrome</a> or <a href="http://en.wikipedia.org/wiki/ChromeOS" target="_blank">ChromeOS</a> via the Google
<a href="http://en.wikipedia.org/wiki/Google_Native_Client" target="_blank">NativeClient plugin</a></b>. This path would result in activities which more
fully integrate with web technologies&mdash;even in disconnected regions
of the world. On desktop machines, Sugar activities could be run
inside the Chrome browser, while ChromeOS (or another embedded OS
running chrome/webkit) would provide the system management functions
on tablet machines like the XO-3. As with the Android port, this is
an exploration, not a definite software direction.</li>
<li>The week of April 18-22 I hope to <b>focus on <a href="http://en.wikipedia.org/wiki/Wireless_mesh_network" target="_blank">mesh networking</a></b>. This has
a somewhat checkered history in our deployments; I hope to identify
the remaining roadblocks and map a way forward to make this a flagship
feature of the XO-3 software.</li>
<li>The week of April 25-29 is for the <b>existing Python-based Sugar
codebase</b>. In order to continue moving forward, it needs to migrate to
GTK3, <a href="http://live.gnome.org/GObjectIntrospection" target="_blank">gobject-introspection</a>, and some other key enabling technologies.
I believe it would also benefit from language-independent APIs and
better modularization to allow a more incremental migration path.</li>
</ol>
<p>The following week is <b><a href="http://wiki.sugarlabs.org/go/Conozco_Uruguay_Tour" target="_blank">Conozco Uruguay</a> and the <a href="http://wiki.sugarlabs.org/go/Uruguay_Summit_2011" target="_blank">Uruguay EduJAM</a></b> where I'll present my
progress on these initial exploratory projects and discuss the path ahead
with the wider OLPC and Sugar communities. Clearly, a week each is not
enough time to finish any of these projects! But the focused effort should
help to better identify the promise, roadblocks, and challenges in
each of these paths, which then in turn will help us to plan the future.</p></description>
<comments>https://cananian.livejournal.com/62667.html?view=comments#comments</comments>
<category>sugar</category>
<category>olpc</category>
<category>chromeos</category>
<category>networking</category>
<category>android</category>
<category>google</category>
<category>python</category>
<category>nativeclient</category>
<category>sugarlabs</category>
<category>sugarcamp</category>
<category>jobs</category>
<category>programming</category>
<category>mesh</category>
<lj:security>public</lj:security>
<lj:reply-count>10</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/61568.html</guid>
<pubDate>Thu, 02 Dec 2010 21:02:49 GMT</pubDate>
<title>What's Wikileaks up to?</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/61568.html</link>
<description><p>A recent <a href="http://www.economist.com/blogs/democracyinamerica/2010/12/after_secrets" target="_blank">article in the Economist</a> points out that Wikileaks is not unique: modern network tools have made anonymous communication ubiquitous. You can't stop "wikileaks" by attacking Julian Assange alone. The article is incorrect, however, in claiming that anonymity is <i>easy</i> &mdash; in some sense <a href="http://en.wikipedia.org/wiki/Federalist_Papers" target="_blank">anonymous leafleteers in Colonial America</a> were better off. <a href="http://en.wikipedia.org/wiki/Bradley_Manning" target="_blank">Bradley Manning currently sits in jail</a>. <a href="http://boingboing.net/2010/09/14/haystack-is-burning.html" target="_blank">Haystack was fundamentally flawed</a>. There continues to be a role for organizations who desire to facilitate anonymous speech to identify and provide trustworthy and user-friendly tools and procedures.</p>
<p>Aaron Brady achieves a more fundamental insight by <a href="http://zunguzungu.wordpress.com/2010/11/29/julian-assange-and-the-computer-conspiracy-%E2%80%9Cto-destroy-this-invisible-government%E2%80%9D/" target="_blank">examining Julian Assange's aims</a>. Assange's goal is to hobble "conspiracies", that is, the small cliques of power and secrecy embedded in most organizations, and he seeks to do this by causing them to fear information sharing. By this metric, Wikileaks <a href="http://swampland.blogs.time.com/2010/11/29/state-pulls-the-plug-on-siprnet/" target="_blank">seems to be succeeding</a>. (Read Aaron Brady's essay for the details.)</p>
<p>But it's worth pausing to consider: are open organizations truly better? Is openness practically achievable? This is an organizational problem which was on the front burner at <a href="http://en.wikipedia.org/wiki/OLPC" target="_blank">OLPC</a> while I worked there: OLPC pledged an open development and governance model, but was continually charged with being closed, insular, and secretive in practice. We reorganized previously-internal mailing lists and pledged to conduct all important business on public archived lists. Yet there was continual backsliding. Sometimes private email was used merely to prevent embarrassment or confusion&mdash;to fact-check before making a public statement. Other times it was claimed that <i>some</i> measure of secret/private communication was a fundamental part of business or negotiation, necessary for interacting with external entities. In order to evaluate the latest components/plans/schedules of our partners, we had to sign NDAs. The secrecy requirements of the third-party then contaminated related discussions. In the end, even an organization with a goal of openness ended up embedding pockets of secrecy, which always threatened to grow and spread unless they were occasionally beaten back. Attempting to stand for open principles was often claimed to make OLPC "uncompetitive," as in: we couldn't hope to get the best deals/access to the latest components/whatever if we insisted on being open about everything.</p>
<p>The quest for openness in business seems to parallel the role of Wikileaks in national affairs. As with OLPC's business negotiations, we are being told that secrecy is an essential part of the diplomatic process, and that publishing internal cables hobbles America's ability to achieve its goals. The claim is that Wikileaks threatens to make America "uncompetitive."</p>
<p>Is this true? Openness is an ethical position, but not a black-and-white one. Very few people argued that OLPC (or America) should have <i>no</i> secrets &mdash; the debate was always "how many?" In practice if the desired answer was "as few as possible", there was always a Wikileaks-like need to continually drag private content to public forums in order to combat the creep of secrecy. Perhaps the same is true of governments.</p>
<p>Then again, over-reaching openness threatens <i>individual privacy</i> &mdash; where to draw the line? Must all our personal mistakes be made in public? Must all our <i>national</i> mistakes be made in public?</p></description>
<comments>https://cananian.livejournal.com/61568.html?view=comments#comments</comments>
<category>security</category>
<category>olpc</category>
<category>echelon</category>
<category>legal</category>
<category>wikileaks</category>
<lj:security>public</lj:security>
<lj:reply-count>0</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/60302.html</guid>
<pubDate>Thu, 27 May 2010 17:46:33 GMT</pubDate>
<title>Congratulations, OLPC!</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/60302.html</link>
<description><p>Today OLPC announced a <a href="http://blog.laptop.org/2010/05/27/xo3-marvell-and-olpc/" target="_blank">partnership with Marvell</a> to develop the XO-3. This is great news &mdash; according to my little birdies this will put development efforts at OLPC on substantially more solid financial footing. And software development for new tablet computers is non-trivial! Here's hoping that OLPC, which led the netbook movement, can similarly spur the nacent tablet computer market. So far tablets are seen as content <em>consumers</em>, with all "real" content creation (ie not just jotting notes or makng minor edits) being done on seperate "real" computers. OLPC's vision should insist on fully productive machines which allow kids to create and contribute, not just passively consume. (In particular, the killer app for kids on XO laptops to date is making movies and telling stories.)</p>
<p>In addition to funding further software development, the Marvell partnership ought to give OLPC the muscle to continue pushing forward the hardware state of the art. A lot of the reality of modern electronics manufacturing depends on guaranteeing enough production volume to sustain the interest of suppliers and their engineers. For low volumes you instead get "least effort" solutions from your partners, which result in higher costs and poorer results. So I'm cautiously optimistic that the "capture" of OLPC resources for Marvell's high volume "first world" tablet efforts will in the end be a means to accomplishing the XO-3 goals for "the rest". But care and caution are waranted. OLPC is not large enough to do multiple things at once; its resources and attention are dissipated easily.</p></description>
<comments>https://cananian.livejournal.com/60302.html?view=comments#comments</comments>
<category>olpc</category>
<lj:security>public</lj:security>
<lj:reply-count>1</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/59091.html</guid>
<pubDate>Thu, 19 Nov 2009 19:27:35 GMT</pubDate>
<title>Chrome OS, litl, and OLPC</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/59091.html</link>
<description>Well, Google just announced Chrome OS, to be available next Christmas. Some parts of it are very similar to what you can already put under the tree <b>this</b> Christmas from litl (actually, you can buy one <a href="http://store.litl.com/" target="_blank">right now</a>) &mdash; and other parts are familiar from my time at OLPC. For example, the legacy-free BIOS and signed bootloader are what OLPC shipped two years ago on the XO-1. The XO-1 was not an "always connected" device, though &mdash; in fact the opposite: it assumed connectivity was infrequent and low-bandwidth. At OLPC, the signed code scheme was part of an theft-deterrence system, crucial for OLPC's target third-world deployments. It wasn't very popular among our first-world users, and I'm not actually sure why Google implemented it for Chrome OS. Phone company lock-in (due to largely misplaced concerns about maintaining the integrity of their networks) are why phone apps are locked down with signature schemes; this isn't necessary (and verges on Evil) for what's intended as a general-purpose computing device.
<p>
The somewhat oddly-technical (and often slightly-wrong) middle section of the Chrome OS presentation veered off at one point about filesystem partitions (!) and how having a read-only partition is a novel feature of their OS. Read-only partitions are one of the <i>oldest</i> security mechanisms &mdash; my boot floppy had the write-protect notch taped over back when I was booting DOS &mdash; and a near-universal feature of thin-client deployments (which Chrome OS certainly is). OLPC maintained a mostly-read-only root, but primarily to extend the lifetime of the flash disk (flash lifetime was not touched on in the Chrome OS presentation). Litl mounts a read-only root with a writable unionfs on top, which actually works much better in practice: improved maintainability because all the various Linux system daemons can still "do their thing" as they expect, but you can wipe the top partition whenever you like to return to a clean state (at litl we do this on every update). (If you haven't hacked the lower levels of a Linux distribution, you'd probably be surprised at how many system daemons assume they can write various places in the root partition, and you really don't want to maintain hacked versions of all of them.) Since ChromeOS gave an Ubuntu shout-out at one point, I strongly suspect the unionfs scheme is actually what they are doing as well &mdash; and, for that matter, what all the other Ubuntu Mobile downstreams are doing. Not new.
<p>
The emphasis on a read-only root partition is rather misleading from a security standpoint (as much of the middle portion of the presentation was). If you're not storing your files locally, it doesn't mean that you suddenly have no security concerns. It just means you have <i>different</i> security concerns. Cross-site scripting attacks give a malicious website access to your Google account through your web browser: these sorts of things are the malware for a WebOS. You have a different attack surface, but a vulnerability in your browser or flash plugin still gives access to private data. Mentioning that they encrypt the data on disk seems to be pure <a href="http://en.wikipedia.org/wiki/Snake_oil_(cryptography)" target="_blank">snake oil</a>: your browser has access to the unencrypted data, and that's your most vulnerable surface anyway.
<p>
Overall, Chrome OS is a nice validation of some of the cloud-computing ideas we've been working on at <a href="http://litl.com" target="_blank">litl</a>, and it's always nice to see more legacy-free hardware (like the OLPC XO-1 and the litl webbook), but the presentation was oddly underwhelming. They're not really "reimagining the PC" &mdash; they're just removing all the applications on the PC except for Chrome. You still interact with "the PC" the same way you currently interact with Chrome. For reimagination, watch the <a href="http://litl.com/support/" target="_blank">videos at litl</a>.</description>
<comments>https://cananian.livejournal.com/59091.html?view=comments#comments</comments>
<category>olpc</category>
<category>chromeos</category>
<category>google</category>
<lj:security>public</lj:security>
<lj:reply-count>1</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/58744.html</guid>
<pubDate>Wed, 04 Nov 2009 19:27:15 GMT</pubDate>
<title>litl's technical secrets revealed!</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/58744.html</link>
<description><p><b>Update:</b> Lucas has written up some additional <a href="http://blogs.gnome.org/lucasr/2009/11/04/litl-webbook-some-technical-comments/" target="_blank">technical details</a> &mdash; and he mentions our update system, which was one of the first bits I worked on when I arrived. We heavily dog-food the updater, using <a href="http://buildbot.net/" target="_blank">buildbot</a> to push out the latest bits to developers every night.</p>
<p><b>Update 2:</b> Welcome, slashdot! The videos at <a href="http://litl.com/support/" target="_blank">http://litl.com/support/</a> give a good idea of what the UI is like.</p>
<p><b>Update 3:</b> Non-technical press coverage: <a href="http://www.wired.com/gadgetlab/2009/11/litl-webbook/" target="_blank">Wired</a>, <a href="http://blogs.wsj.com/digits/2009/11/04/litl-introduces-its-web-based-netbook/" target="_blank">WSJ</a>, <a href="http://www.xconomy.com/boston/2009/11/04/the-litl-computer-that-could-boston-startup-tries-a-new-take-on-the-home-internet-appliance/" target="_blank">Xconomy</a>, <a href="http://www.crunchgear.com/2009/11/04/litl-webbook-aims-to-blend-portable-computing-with-a-tv-like-experience/" target="_blank">CrunchGear</a></p>
<p><b>Update 4:</b> More words: <a href="http://innergeekmoments.blogspot.com/2009/11/litl-theres-server-component-too.html" target="_blank">dignacio on litl's server side</a>, <a href="http://www.j5live.com/2009/11/04/litls-little-netbook/" target="_blank">J5</a>, <a href="http://twitter.com/#search?q=%23litl" target="_blank">twitter</a></p>
<p><a href="http://litl.com" target="_blank">litl</a> launches today, so I can finally
talk a bit about the cool technologies behind our software stack.</p>
<p>On the server side, litl is a cloud computer, built on <a href="http://en.wikipedia.org/wiki/Google_App_Engine" target="_blank">Google App
Engine</a>, <a href="http://en.wikipedia.org/wiki/Amazon_S3" target="_blank">Amazon
S3</a>, and <a href="http://en.wikipedia.org/wiki/Django_(web_framework)" target="_blank">Django</a>
&mdash; all of which are fantastic technologies.
All machine data is stored in the cloud, so you can have a
gorilla stomp on your litl, pick up another one, log on and instantly
recreate your environment. (Since we developers are always abusing
our prototype hardware, we've tested this a lot!)</p>
<p>On the client side, the litl software (naturally, code-named "big")
is built on <a href="http://live.gnome.org/Gjs/" target="_blank">gjs</a>, which is the
smallest possible wrapper around <a href="http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrrldwideweb" target="_blank">JavaScript</a>
necessary to make it a large-scale programming language. I've really
enjoyed programming in JavaScript, which might seem odd to people who
(a) have had frustrating experiences with global variables and crazy
incompatibilites trying to make JavaScript work on the web, and (b)
know that I'm a <a href="http://cscott.net/Publications/thesis.pdf" target="_blank">static types</a> and
<a href="http://cscott.net/Publications/p072-ananian.pdf" target="_blank">compiler-bondage</a>
sort of guy. So I'll spend a little time here talking about gjs.</p>
<p>From a language standpoint gjs adds just one feature: a minimal
module/namespacing mechanism built on a single top-level definition: the name "<code>imports</code>".
Modules are imported using (typically constant) definitions, such as:</p>
<pre style="background: #eef; border: 1px solid #ccc; margin: 1em; padding: 1em; width: 40em;">
const StringUtil = imports.stringUtil;
s = StringUtil.sprintf("%d", 3);
</pre>
<p>The dynamic <code>stringUtil</code> property of the
<code>imports</code> object is an object whose properties are the
top-level definitions in the file <code>stringUtil.js</code>, found on
the import path. Subdirectories are additional dot-separated
components, as in Java package names; <code>imports.util</code> is a
dynamic object representing modules found in a <code>util</code>
directory on the path. You may need to compare this to the
namespacing mechanism in the abandoned <a href="http://www.ecmascript.org/es4/spec/overview.pdf" target="_blank">ES4</a>
proposal to appreciate how small and elegant this is.</p>
<p>Further, this module system integrates with the <a href="http://library.gnome.org/devel/gobject/unstable/index.html" target="_blank">GObject system</a> via
<a href="http://live.gnome.org/GObjectIntrospection/" target="_blank">GObject
introspection</a> annotations for library code. This allows
easy integration with libraries written in C
or any other introspectable language. For example:</p>
<pre style="background: #eef; border: 1px solid #ccc; margin: 1em; padding: 1em; width: 40em;">
const Gtk = imports.gi.Gtk;
Gtk.init(0, null);
let w = new Gtk.Window({ type: Gtk.WindowType.TOPLEVEL });
w.connect('destroy', Gtk.main_quit );
let button = new Gtk.Button({ label: "Hello, world!" });
button.connect('clicked', function() { w.destroy(); } );
w.add(button);
w.show_all();
Gtk.main();
</pre>
<p>The gjs system is built on the <a href="http://www.mozilla.org/js/spidermonkey/" target="_blank">SpiderMonkey</a>
JavaScript engine, the one used in <a href="http://www.mozilla.com/en-US/firefox/upgrade.html" target="_blank">Firefox</a>,
so JavaScript execution benefits from all the <a href="http://ejohn.org/blog/tracemonkey/" target="_blank">JIT</a> and performance work
done upstream. Further, it means that we can code in <a href="https://developer.mozilla.org/en/New_in_JavaScript_1.8" target="_blank">JavaScript
1.8</a>, Mozilla's dialect of JavaScript with lots of bells and
whistles (mostly borrowed from Python):</p>
<pre style="background: #eef; border: 1px solid #ccc; margin: 1em; padding: 1em; width: 40em;">
gjs&gt; function range(n) { for (let i=0; i&lt;n; i++) yield i; }
gjs&gt; [i*2 for (i in range(5))]
0,2,4,6,8
</pre>
<p>(In a later post perhaps I'll describe how you can use the
<code>yield</code> expression to build a continuation-based system for
writing asynchronous callbacks for UI code in a natural manner.)</p>
<p>Overall,
JavaScript as a system programming language feels a lot like Lisp must
have for the programming generation before mine: minimal
syntax, very powerful and orthogonal core abstractions, and (dare I
say it) not much type-checking or busy-work to get in your way.
(<code>gjs</code> is not a homage to <a href="http://en.wikipedia.org/wiki/Gjs" target="_blank">Sussman</a>, but it should
be!) JavaScript is a programming language for those who know what they're
doing and aren't afraid of a little functional abstraction. (Now if
only there was a way to disable <a href="http://www.mozilla.org/js/language/js20-2000-07/rationale/syntax.html" target="_blank">semicolon
insertion</a>!)</p>
<p>OK, enough about gjs. The litl software stack is based on <a href="http://www.canonical.com/" target="_blank">Canonical</a>'s distribution
of Ubuntu for <a href="http://www.ubuntu.com/products/mobile" target="_blank">mobile/embedded
devices</a>, and the Canonical folks have been great partners.
It's been a joy to get changes integrated upstream, and Canonical has done a
lot of excellent work accommodating their distribution to litl's
unique needs. On the UI side, we use X11 and some GTK widgets, but
implement our own (very simple) window manager. Most of the
actual look and feel is done with <a href="http://en.wikipedia.org/wiki/Clutter_(toolkit)" target="_blank">Clutter</a>
(hardware-accelerated 3d animated effects, whee!), and we have a
Flash-based API for external developers. We also have
hardware-accelerated <a href="http://en.wikipedia.org/wiki/H.264" target="_blank">h.264</a> video.</p>
<p>Regardless of the technical fun, though, I have to say that the
best thing about working at litl is its management: developing with
all the other rockstars here is made the more fun by the knowledge
that management will help ensure that our goals are realistic and that
we'll be able to hit our targets, with time left over to polish before
release. It's just much more fun to code when you know you'll be
proud of the end result.</p></description>
<comments>https://cananian.livejournal.com/58744.html?view=comments#comments</comments>
<category>javascript</category>
<category>olpc</category>
<category>litl</category>
<category>gjs</category>
<category>gnome</category>
<lj:security>public</lj:security>
<lj:reply-count>5</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/58238.html</guid>
<pubDate>Mon, 05 Oct 2009 18:18:18 GMT</pubDate>
<title>Flash Filesystems</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/58238.html</link>
<description><p>Dave Woodhouse in a recent article <a href="http://www.advogato.org/person/dwmw2/diary/211.html" target="_blank">calls shenanigans on
hardware translation for flash devices</a>. I agree: flash memory is
a Horse Of A Different Color, and trying to gussy it up to look like
a rotating disk of magnetized rust is using a bad and leaky abstraction that
will only end in tears. But I don't think the engineers' better
judgment will prevail: the use of hardware
translation is driven by Windows/DOS compatibility concerns, since
Microsoft (to my knowledge) has shown no desire in writing a new
filesystem for flash drives. <a href="http://en.wikipedia.org/wiki/OLPC" target="_blank">OLPC</a> used a raw flash device in the
<a href="http://wiki.laptop.org/images/7/71/CL1A_Hdwe_Design_Spec.pdf" target="_blank">XO-1</a>, but in their <a href="http://wiki.laptop.org/go/XO-1.5" target="_blank">follow-on</a> had to switch to a hardware-translation device
because market/scale economics were making those
devices cheaper and cheaper while the original raw flash device was
(a) not increasing in volume (aka, getting relatively more expensive),
(b) not increasing in size (no one wanted to make new ones), and
(c) getting discontinued (aka, impossible to buy). The best
one can hope for is that a raw interface be offered <i>in addition</i> to
the standard "Windows-compatible" one, for specialized embedded or
high-performance applications &mdash; but the chicken and egg problem applies:
until there are compelling gains, these interfaces won't be purchased
in sufficient volumes to yield reasonable prices, and no one is
writing the optimized filesystems because you can't find
reasonably-priced flash devices to run them on.
The end result is likely to be that <a href="http://www.jwz.org/doc/worse-is-better.html" target="_blank">Worse Is Better</a>, and we'll be left
with another set of legacy chains. Given enough time and transistors,
the hardware may eventually grow Heroic Measures to work
around the bad abstraction (see: the x86 instruction set).</p>
<p>If your filesystem is large enough and the amount of data
being rewritten small enough, the flash problems "probably"
won't bite you until after the obsolescence of the device &mdash; flash storage
doesn't have to be good, it just has to be "not too bad" until, say, 3
years after purchase. Like non-removable rechargeable batteries that
slowly degrade over time, you'll find your filesystem slowly
degrading &mdash; one more reason to eventually buy a new one, and I've never
known manufacturers to be especially sorry about that. Heroic Measures may never be needed/taken.</p>
<p>Leaving amateur market economics (and despair), let's revisit a cryptic and probably overlooked
paragraph in my <a href="http://wiki.laptop.org/go/Olpcfs#Implementations_on_flash_memory" target="_blank">olpcfs</a> proposal:</p>
<blockquote>
<p>Implementations tuned for flash memory can use <a href="http://doi.acm.org/10.1145/1292609.1292616" class="external text" title="http://doi.acm.org/10.1145/1292609.1292616" rel="nofollow" target="_blank">Adaptive Packed Memory Arrays</a> for efficient CAS. This is an open research topic, but there is some evidence that a high-performance scalable flash-based filesystem can more profitably be implemented using cache-oblivious B-Trees and APMAs, rather than more "traditional" filesystem structures.
</p>
</blockquote>
<p>Here I'm trying to build a little bridge between filesystem designers
and functional data structure researchers, two groups who probably
rarely sit down together for a beer. I think <a href="http://doi.acm.org/10.1145/1292609.1292616" target="_blank">Packed Memory Arrays</a> are
the "B-trees of flash filesystems": a better way to build an on-disk
index given the peculiar characteristics of flash memory. Just as
<a href="http://en.wikipedia.org/wiki/Be_File_System" target="_blank">BeOS</a> demonstrated that your filesystem could be "B-trees all the way
down", I believe you could build a compelling filesystem using PMAs as
the primary data structure. Ultimately, I suspect that the
development strategy Dave Woodhouse describes &mdash; small incremental
changes to existing filesystems whose philosophies are "close enough"
&mdash; will probably prevail over a ground-up PMA rewrite. Incremental
improvements and shared codebases are the Right Strategy for
successful open source projects: you get more developers and testers
for those parts which aren't flash-specific, and you've already gotten
yourself out of the <a href="http://en.wikipedia.org/wiki/Cathedral_and_the_Bazaar" target="_blank">Cathedral</a> with some working code to kick things off.</p>
<p>But if anyone's interested in attempting a clean slate design, PMAs are
my advice. Maybe you'll come up with something so wonderful it will
make a compelling <a href="http://www.nobius.org/~dbg/practical-file-system-design.pdf" target="_blank">book</a> (and inspire folks like me), even if
ultimately you don't win in the marketplace.</p>
<p>(But maybe you'll win! Flash storage and your optimized filesystem will prevail, and one day we'll think of rotating media in the same way we now think of core memory, floppy disks, tape drives, and the x86 instruction set... er, hmm.)</p></description>
<comments>https://cananian.livejournal.com/58238.html?view=comments#comments</comments>
<category>olpcfs</category>
<category>olpc</category>
<lj:security>public</lj:security>
<lj:reply-count>2</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/57486.html</guid>
<pubDate>Tue, 04 Aug 2009 15:54:51 GMT</pubDate>
<title>Sugar waves: time to get started!</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/57486.html</link>
<description>While I was abroad, it seems that Google <a href="http://googlewavedev.blogspot.com/2009/07/google-wave-federation-protocol-and.html" target="_blank">released their wave server/federation code</a>. So you can now get started tackling some of the projects I outlined in <a href="http://cananian.livejournal.com/56585.html" target="_blank">my previous post on Waves and Sugar</a>: getting a basic federation server running on the school server and/or writing a server running locally on the XO which exports the content of the Journal/filesystem for collaboration. I'm hoping someone other than me thinks this is an exciting idea, and runs with it!</description>
<comments>https://cananian.livejournal.com/57486.html?view=comments#comments</comments>
<category>journal</category>
<category>sugar</category>
<category>olpc</category>
<category>google wave</category>
<category>google</category>
<category>journal2</category>
<lj:security>public</lj:security>
<lj:reply-count>0</lj:reply-count>
</item>
<item>
<guid isPermaLink='true'>https://cananian.livejournal.com/57130.html</guid>
<pubDate>Mon, 03 Aug 2009 16:03:55 GMT</pubDate>
<title>OLPC kerfuffle</title>
<author>cananian</author>
<link>https://cananian.livejournal.com/57130.html</link>
<description><p>It seems I missed a nice little <a href="http://linux.slashdot.org/story/09/07/20/1628228/Negroponte-Sees-Sugar-As-OLPCs-Biggest-Mistake" target="_blank">Slashdot</a>/<a href="http://www.zdnetasia.com/insight/hardware/0,39043471,62056166,00.htm" target="_blank">Negroponte</a>/<a href="http://radian.org/notebook/nonsense-omelet" target="_blank">Krstić</a> OLPC/Sugar row while I was away in Europe savoring the efficient intercity rail. While Tomeu and OLPCnews choose to blame particular words or phrases ("<a href="http://blog.tomeuvizoso.net/2009/07/on-negropontes-omelettes.html" target="_blank">Sugar</a>", "<a href="http://www.olpcnews.com/people/negroponte/olpc_biggest_mistake_sugar.html" target="_blank">$100 laptop</a>"), both <a href="https://www.blogger.com/comment.g?blogID=664175667937540078&amp;postID=4369316166455399161" target="_blank">J5</a> and <a href="http://gregdek.livejournal.com/52052.html" target="_blank">gregdek</a> seem to think the Real Problem was the fact that OLPC wouldn't upstream its patches.</p>
<p>I beg to disagree. As I <a href="http://gregdek.livejournal.com/52052.html?view=385876#t385876" target="_blank">wordily tried to explain</a> in a comment to gregdek's post, I think Ivan is mostly right here: OLPC tried to do "seven new things" (as Mary Lou explained to me when I was hired) -- and "new things" end up costing a lot of debugging and development time, in one of the Iron Laws Of Writing New Code And Making New Hardware. But another problem was just Picking The Wrong Partners. With the exception of the display (one of the few unalloyed successes of the XO hardware), most of our hardware and software partners were working at cross purposes. Red Hat didn't really want to build an embedded OS product, "mesh networking" to Marvel meant household networks between your TV and your stereo with maybe 10 participants, the Geode was an orphaned offering from AMD, the display and flash NAND controller was a unloved one-off, etc. Success is found by aligning your partners' interests with your own.</p>
<p>At Litl our OS partner has many other embedded-systems clients, and has developed the toolsets to handle forks and customization without all the angst I'd grown used to at OLPC. We just say, "we need feature X turned on/off" or "set to Y" or just "somehow Z needs to happen" and it's done. We're not fighting, we're not destabilizing their core OS, we don't waste time with elaborate justifications why This Is The Right Thing To Do. If the change is appropriate to upstream, they upstream it, and maybe the work benefits the other embedded-systems clients. There's no drama, because We All Want The Same Thing.</p>
<p>I think "upstreaming" is entirely the wrong hero for OLPC here. If anything, I think OLPC's best hope is to continue to <b>aggressively innovate</b> -- no one buys a computer because its code has been upstreamed. Unfortunately, I don't think OLPC has enough current funding to do anything but follow the upstream, so maybe this current round of praise for Fedora-ization is just the old cliché: making a virtue of necessity.</p></description>
<comments>https://cananian.livejournal.com/57130.html?view=comments#comments</comments>
<category>sugar</category>
<category>olpc</category>
<category>litl</category>
<category>negroponte</category>
<lj:security>public</lj:security>
<lj:reply-count>1</lj:reply-count>
</item>
</channel>
</rss>