<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Advogato blog for cananian</title>
    <link>http://www.advogato.org/person/cananian/</link>
    <description>Advogato blog for cananian</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Fri, 10 Feb 2012 18:13:36 GMT</pubDate>
    <item>
      <pubDate>Tue, 1 Nov 2011 23:07:12 GMT</pubDate>
      <title>A collection of Nell demos</title>
      <link>http://www.advogato.org/person/cananian/diary.html?start=88</link>
      <guid>http://cananian.livejournal.com/65380.html</guid>
      <description>&lt;p&gt;Here are some banged-together demos of various pieces of
&lt;a href="http://laptop.org" &gt;One Laptop per Child&lt;/a&gt;'s
&lt;a href="http://cananian.livejournal.com/65077.html" &gt;Project Nell&lt;/a&gt;.
The ultimate goal is a Nell &lt;a href="http://wiki.laptop.org/go/Nell" &gt;demo&lt;/a&gt;
for &lt;a href="http://en.wikipedia.org/wiki/Consumer_Electronics_Show" &gt;CES&lt;/a&gt;
in January 2012, but these bits should be considered as tech demos,
benchmarks, and proofs of concept, not actual pieces of that demo (yet).
&lt;/p&gt;

&lt;p&gt;Most of these demos require WebGL support.  Visit &lt;a href="http://get.webgl.org/" &gt;get.webgl.org&lt;/a&gt; for information about
enabling WebGL in your browser; there is WebGL support in Chrome,
Firefox, Safari, and Opera&#x2014;although it often requires enabling
experimental features in the browser preferences.&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="http://dev.laptop.org/~cscott/nelldemo.20111101/tile_test.html" &gt;Tiles&lt;/a&gt;.  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
  &lt;a href="http://vocamus.net/dave/?p=1168" &gt;blog entry&lt;/a&gt; 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.&lt;br/&gt;
  (Drag with left mouse button to rotate, middle mouse button to zoom,
  right mouse button to pan.)
  &lt;/li&gt;
  
  &lt;li&gt;&lt;a href="http://dev.laptop.org/~cscott/nelldemo.20111101/nell_home_test.html" &gt;Nell at home&lt;/a&gt;.  Basic idea
  (including transition) for activities which include dialog with
  Nell or story-telling.&lt;br/&gt;
  Standalone model viewers:
  &lt;a href="http://dev.laptop.org/~cscott/nelldemo.20111101/watchtower_test.html" &gt;Castle&lt;/a&gt; (from &lt;a href="http://www.blendswap.com/3D-models/architecture/watchtower/" &gt;blendswap&lt;/a&gt;),
  &lt;a href="http://dev.laptop.org/~cscott/nelldemo.20111101/sintel_test.html" &gt;"Nell"&lt;/a&gt; (Sintel, from &lt;a href="http://www.blendswap.com/3D-models/characters/sintel-lite-2-57b/" &gt;blendswap&lt;/a&gt;),
  &lt;a href="http://dev.laptop.org/~cscott/nelldemo.20111101/sintel_lite_test.html" &gt;Alternate (lightweight) Nell model&lt;/a&gt;,
  &lt;a href="http://dev.laptop.org/~cscott/nelldemo.20111101/maison_test.html" &gt;Alternate (heavyweight) house model&lt;/a&gt;
  (from &lt;a href="http://www.blendswap.com/3D-models/architecture/little-house/" &gt;blendswap&lt;/a&gt;).&lt;br/&gt;
  In model viewers: drag with left mouse button to rotate, middle
  mouse button to zoom, right mouse button to pan.
  &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://dev.laptop.org/~cscott/nelldemo.20111101/music.html" &gt;Music maker&lt;/a&gt;. Uses WebGL and the Web
  Audio APIs to let you draw and perform music.&lt;br/&gt;
  Inspired by Andr&#xE9; Michelle's
  &lt;a href="http://lab.andre-michelle.com/tonematrix" &gt;ToneMatrix&lt;/a&gt; and
  &lt;a href="http://lab.andre-michelle.com/karplus-strong-guitar" &gt;Karplus-Strong
  Guitar&lt;/a&gt; (see also
  &lt;a href="http://en.wikipedia.org/wiki/Karplus-Strong_string_synthesis" &gt;wiki&lt;/a&gt; 
  and this 2008 &lt;a href="http://lac.linuxaudio.org/" &gt;Linux Audio Conference&lt;/a&gt;
  &lt;a href="https://ccrma.stanford.edu/realsimple/faust_strings/faust_strings.pdf" &gt;paper&lt;/a&gt;),
  as well as &lt;a href="http://labs.dinahmoe.com/" &gt;DinahMoe&lt;/a&gt;'s
  &lt;a href="http://labs.dinahmoe.com/ToneCraft/" &gt;ToneCraft&lt;/a&gt; and
  the &lt;a href="http://www.global.yamaha.com/tenori-on/" &gt;Tenori-on&lt;/a&gt;.
  &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=4Mr27yY8-A8" &gt;Quake on XO-1.75&lt;/a&gt;
  (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&#x2014;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.)
  &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://twolivesleft.com/Codify/" &gt;Codify&lt;/a&gt;&#x2014;not
  one of our demos (it's a commercial iPad app) but it demonstrates
  the direction we'd like to push &lt;a href="http://wiki.laptop.org/go/Pippy" &gt;Pippy&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;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 &lt;a href="http://git.sugarlabs.org/~cscott/turtleart/cscott-gtk3/commits/gtk3" &gt;source
  code repository for the TurtleArt port&lt;/a&gt; if you'd like to watch or
  participate in this hackage.  (See &lt;a href="http://repl.it" &gt;repl.it&lt;/a&gt;
  for one of the more unusual ways to get Python running in the web
  context.)  The rest of the demo source code is on &lt;a href="https://github.com/cscott/nelldemo" &gt;github&lt;/a&gt; (or just "View Source" in your browser).&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Sat, 1 Oct 2011 06:06:58 GMT</pubDate>
      <title>Introducing Nell</title>
      <link>http://www.advogato.org/person/cananian/diary.html?start=87</link>
      <guid>http://cananian.livejournal.com/65077.html</guid>
      <description>&lt;p&gt;Between now and January &lt;a href="http://en.wikipedia.org/wiki/Consumer_Electronics_Show" &gt;CES&lt;/a&gt;, Chris Ball and I will be building &lt;i&gt;Nell&lt;/i&gt; for the &lt;a href="http://en.wikipedia.org/wiki/OLPC" &gt;OLPC&lt;/a&gt; &lt;a href="http://blog.laptop.org/2011/07/22/olpc-xo-3-design-update/" &gt;XO-3&lt;/a&gt; tablet.
Nell is a name, not an acronym, but if you want to pronounce it as
"Narrative Environment for &lt;a href="http://wiki.laptop.org/go/Learning_Learning" &gt;Learning Learning&lt;/a&gt;," I won't stop you.&lt;/p&gt;

&lt;p&gt;Nell's development will be demo-oriented&#x2014;we're going to try to write the most
interesting bits first and learn as we go&#x2014;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.&lt;/p&gt;

&lt;p&gt;Here are four of the big ideas behind Nell, along with pointers to some of our sources of inspiration.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Narrative.&lt;/b&gt; 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 &lt;a href="http://pr-if.org/" &gt;Boston IF group&lt;/a&gt; in particular.  (Check out
the talks from our
"&lt;a href="http://blog.printf.net/articles/2011/06/18/narrative-interfaces" &gt;Narrative
Interfaces day&lt;/a&gt;" at OLPC.)
&lt;a href="http://users.soe.ucsc.edu/~jskorups/wiki/wide_ruled/wide_ruled_v2" &gt;Wide
Ruled&lt;/a&gt; (&lt;a href="http://eis.ucsc.edu/sites/default/files/Skorupski_DAC09_WideRuledLessonsLearned.pdf" &gt;conference
paper&lt;/a&gt;) and &lt;a href="https://research.cc.gatech.edu/inc/mark-riedl" &gt;Mark Riedl&lt;/a&gt;
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 &lt;a href="http://experimentalgameplay.com/blog/2011/09/story-game-in-september-2011/" &gt;Story
Game&lt;/a&gt; competition.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Emotion.&lt;/b&gt; The Radiolab podcast "&lt;a href="http://www.radiolab.org/2011/may/31/" &gt;Talking To Machines&lt;/a&gt;" 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 &lt;a href="http://en.wikipedia.org/wiki/Furby#Furbish-English_phrases" &gt;Furbish&lt;/a&gt;
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.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Talking and Listening.&lt;/b&gt; The "Talking To Machines" podcast also discusses &lt;a href="http://en.wikipedia.org/wiki/ELIZA" &gt;ELIZA&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Cleverbot" &gt;Cleverbot&lt;/a&gt;, which
dovetails with my interest in the popular &lt;a href="http://wiki.sugarlabs.org/go/Activities/Speak" &gt;Speak
activity&lt;/a&gt; for Sugar and related toys like &lt;a href="http://outfit7.com/apps/talking-tom-cat/" &gt;Talking Tomcat&lt;/a&gt; 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 &lt;a href="http://csc.media.mit.edu/" &gt;Common Sense Computing
Initiative&lt;/a&gt; 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 &lt;a href="http://csc.media.mit.edu/conceptnet" &gt;ConceptNet&lt;/a&gt; for its
database and practical NLP tools, and inspiration from
"Empathy Buddy," "StoryFighter," and the other projects described in their
&lt;a href="http://web.media.mit.edu/~push/Beating-Common-Sense.pdf" &gt;Beating
Common Sense&lt;/a&gt; paper.  It's also worth noting that open source
speech tools are good and getting better (the &lt;a href="http://voxforge.org/" &gt;VoxForge&lt;/a&gt; site points to most of them);
also interesting is &lt;a href="http://festvox.org/transform/transform.html" &gt;this technique&lt;/a&gt;
for matching a synthesized voice to that of the user.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Collecting, nurturing, and rewarding.&lt;/b&gt; Collector games such as &lt;a href="http://en.wikipedia.org/wiki/Pocket_Frogs" &gt;Pocket Frogs&lt;/a&gt; and
&lt;a href="http://www.facebook.com/iphoneflowergarden" &gt;Flower Garden&lt;/a&gt;
are sticky activities which
encourage kids to come back to the device and continue working toward a goal over a long period of time.
&lt;a href="http://www.technologyreview.com/printer_friendly_article.aspx?id=37874" &gt;Memrise&lt;/a&gt;
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 &lt;a href="http://openbadges.org/" &gt;Open Badges infrastructure&lt;/a&gt; into an achievement/reward system.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 15 Jun 2011 22:05:16 GMT</pubDate>
      <title>Narrative Interfaces</title>
      <link>http://www.advogato.org/person/cananian/diary.html?start=86</link>
      <guid>http://cananian.livejournal.com/64747.html</guid>
      <description>&lt;p&gt;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?&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.timeanddate.com/worldclock/fixedtime.html?msg=Narrative+Interfaces+Talks+at+OLPC&amp;amp;iso=20110617T14&amp;amp;p1=43&amp;amp;ah=2&amp;amp;am=30" &gt;This Friday (June 17) at 2pm Eastern&lt;/a&gt; we're inviting some folks over to OLPC's new offices at the &lt;a href="http://www.americantwine.com/" &gt;American Twine&lt;/a&gt; building to discuss &lt;i&gt;Narrative Interfaces&lt;/i&gt;, as part of the proposed XO-3 software stack.  &lt;a href="http://nickm.com/" &gt;Nick Montfort&lt;/a&gt; will give a short talk on &lt;a href="http://curveship.com/" &gt;&lt;i&gt;Curveship&lt;/i&gt;&lt;/a&gt;, his model-based interactive fiction system, and &lt;a href="http://printf.net/" &gt;Chris Ball&lt;/a&gt; will present some related recent hacking.  &lt;a href="http://web.media.mit.edu/~anjchang/" &gt;Angela Chang&lt;/a&gt; will present her &lt;i&gt;Tinkerbooks&lt;/i&gt; early-literacy platform, which allows kids to interactively change the written story on the page.  And I'll discuss Neal Stephenson's novel &lt;a href="http://en.wikipedia.org/wiki/The_Diamond_Age" &gt;&lt;i&gt;The Diamond Age&lt;/i&gt;&lt;/a&gt; (a recap of &lt;a href="http://www.dailymotion.com/video/xip6ep_en-the-diamond-age_tech" &gt;a short talk I gave at EduJAM in Uruguay&lt;/a&gt;), and give concrete suggestions for how Diamond Age's &lt;i&gt;Primer&lt;/i&gt; 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.&lt;/p&gt;

&lt;p&gt;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 &lt;a href="http://creativecommons.org/" &gt;Creative Commons&lt;/a&gt;-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.&lt;/p&gt;

&lt;p&gt;We will also live-stream the meeting at &lt;a href="http://www.ustream.tv/channel/cscottnet" &gt;ustream.tv/channel/cscottnet&lt;/a&gt;.  Afterwards we'll post higher-quality video and a list of cited works. Thanks in advance to everyone who will participate, online and off!&lt;/p&gt;

&lt;p&gt;&lt;b&gt;UPDATE:&lt;/b&gt; video now up; see &lt;a href="http://blog.printf.net/articles/2011/06/18/narrative-interfaces" &gt;this writeup on Chris Ball's blog&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 24 May 2011 23:50:32 GMT</pubDate>
      <title>Small systems... and distributed ones</title>
      <link>http://www.advogato.org/person/cananian/diary.html?start=85</link>
      <guid>http://cananian.livejournal.com/64330.html</guid>
      <description>&lt;p&gt;Today I stumbled across some very interesting projects by &lt;a href="https://github.com/SamuraiJack" &gt;Nickolay Platonov&lt;/a&gt; which I'd like to discuss in an OLPC context.&lt;/p&gt;

&lt;p&gt;I've been hacking away at &lt;a href="http://cscott.net/Projects/TurtleScript" &gt;TurtleScript&lt;/a&gt; fueled partly by a drive for minimalism: a small system is a learnable system.  To that end, the language is based on &lt;a href="http://www.crockford.com/" &gt;Douglas Crockford&lt;/a&gt;'s "Simplified JavaScript" (as recognized by &lt;a href="http://javascript.crockford.com/tdop/tdop.html" &gt;this top-down operator precedence parser&lt;/a&gt;) which tries hard to include only JavaScript's "&lt;a href="http://www.livestream.com/etsy/video?clipId=pla_1463e546-47ed-4a93-b59a-bd52b236e8b8" &gt;Good Parts&lt;/a&gt;".  For example, the &lt;a href="https://github.com/cscott/TurtleScript/blob/beeba5c138d88af40297f93689ecbe7721724819/crender.js#L333" &gt;initial code&lt;/a&gt; for the TurtleScript system uses &lt;a href="http://javascript.crockford.com/prototypal.html" &gt;prototype inheritance&lt;/a&gt; (via &lt;code&gt;Object.create&lt;/code&gt;) rather than classical class-style inheritance.  In fact, the &lt;code&gt;new&lt;/code&gt; operator isn't even included in the Simplified JavaScript/TurtleScript language.&lt;/p&gt;

&lt;p&gt;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 &lt;a href="http://joose.it/" &gt;Joose&lt;/a&gt; library, which gives a very &lt;a href="http://joose.github.com/Joose/doc/html/Joose.html" &gt;readable syntax&lt;/a&gt; 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 &lt;code&gt;new&lt;/code&gt; operator.&lt;/p&gt;

&lt;p&gt;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?&lt;/p&gt;

&lt;p&gt;And once we're looking at libraries... Nickolay Platonov is now working on &lt;a href="http://joose.it/blog/2011/04/08/syncler-distributed-applications-for-human-beings/" &gt;Syncler&lt;/a&gt;, based on the &lt;a href="http://joose.it/blog/wp-content/uploads/2011/03/Bayou-updates-propagation.pdf" &gt;Bayou&lt;/a&gt; system.  Unobstructive replication mechanisms would certainly make it easier to construct the sorts of collaborative applications we've wanted for &lt;a href="http://en.wikipedia.org/wiki/Sugar_(desktop_environment)" &gt;Sugar&lt;/a&gt;.  I have two concerns with Syncler's current state.  First, the use of &lt;a href="http://joose.it/blog/2011/02/14/joosex-cps-tutorial-part-i/" &gt;explicit continuation-passing style&lt;/a&gt; greatly impairs readability.  The JavaScript &lt;code&gt;yield&lt;/code&gt; keyword &lt;a href="http://blog.ometer.com/2010/11/28/a-sequential-actor-like-api-for-server-side-javascript/" &gt;helps a lot&lt;/a&gt; when writing asynchronous code.  (It's not supported by all JavaScript engines, but &lt;code&gt;yield&lt;/code&gt; wouldn't be hard to add to TurtleScript.)  Second, Syncler's event model uses explicit callbacks.  I've been greatly impressed with the &lt;a href="http://www.flapjax-lang.org/" &gt;Flapjax&lt;/a&gt; event model (and its &lt;a href="http://lamp.epfl.ch/~imaier/pub/DeprecatingObserversTR2010.pdf" &gt;strongly-typed functional cousin&lt;/a&gt;).  Both of these changes ought to make asynchronous code much more readable&#x2014;and isn't that an important part of &lt;a href="http://en.wikipedia.org/wiki/Grok" &gt;grokking&lt;/a&gt; a system?&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Fri, 20 May 2011 06:07:54 GMT</pubDate>
      <title>Turtles All The Way Down</title>
      <link>http://www.advogato.org/person/cananian/diary.html?start=84</link>
      <guid>http://cananian.livejournal.com/64140.html</guid>
      <description>&lt;p&gt;&lt;img src="http://cscott.net/Projects/TurtleScript/images/hello-world.png" /&gt;&lt;/p&gt;
&lt;p&gt;Inspired by &lt;a href="http://croquetweak.blogspot.com/" &gt;Bert Freudenberg&lt;/a&gt;, &lt;a href="http://piumarta.com/software/" &gt;Ian Piumarta&lt;/a&gt;, and &lt;a href="http://wiki.sugarlabs.org/go/User:Walter" &gt;Walter Bender&lt;/a&gt;, I started hacking on "Turtles All The Way Down" (aka &lt;a href="http://cscott.net/Projects/TurtleScript/" &gt;TurtleScript&lt;/a&gt;) on the plane back from Uruguay.
Now there's a nice &lt;a href="http://cscott.net/Projects/TurtleScript/ctiles.html" &gt;rendering demo&lt;/a&gt; to show what a tile-based editor for JavaScript might look like, as well as a &lt;a href="http://cscott.net/Projects/TurtleScript/tdop.html" &gt;bytecode compiler and interpreter&lt;/a&gt; for the language.  The &lt;a href="https://github.com/cscott/TurtleScript/blob/f977f782bb2bda06d26e5eeb1259db95dd48f2ca/bytecode_table.js" &gt;bytecode instruction set&lt;/a&gt; is still too large; encouraged by Craig Chambers' work on &lt;a href="http://selflanguage.org/documentation/published/implementation.html" &gt;SELF&lt;/a&gt; I think I ought to be able to replace all the unary and binary operators, conditional jumps, and slot selectors by a single &lt;code&gt;mapof&lt;/code&gt; operator.  I can put a better &lt;a href="http://piumarta.com/software/cola/objmodel2.pdf" &gt;object model&lt;/a&gt; on the interpreter, too;
I've written some &lt;a href="http://cscott.net/Projects/TurtleScript/#simplifying-the-environment" &gt;notes on the matter&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Sat, 30 Apr 2011 02:13:01 GMT</pubDate>
      <title>Next Steps for New Technologies</title>
      <link>http://www.advogato.org/person/cananian/diary.html?start=83</link>
      <guid>http://cananian.livejournal.com/63783.html</guid>
      <description>&lt;p&gt;I've reached the end of the month.  I've accomplished my
Android and NativeClient-related &lt;a href="http://cananian.livejournal.com/62667.html" &gt;goals&lt;/a&gt;, 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 &lt;a href="http://wiki.sugarlabs.org/go/Uruguay_Summit_2011" &gt;EduJAM&lt;/a&gt;.)&lt;/p&gt;

&lt;h3&gt;GObject Introspection (Android or NaCl)&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Start by porting &lt;a href="http://en.wikipedia.org/wiki/Libffi" &gt;libffi&lt;/a&gt;.  An android port would be
  straightforward, but since libffi involves code generation
  (&lt;a href="https://github.com/atgreen/libffi/blob/master/src/arm/ffi.c#L557" &gt;ARM&lt;/a&gt;, &lt;a href="https://github.com/atgreen/libffi/blob/master/src/x86/ffi.c#L475" &gt;x86&lt;/a&gt;), this is going to require a bit of assembly
  magic and the new "JIT"/"shared library" support in the NaCl plugin.&lt;/li&gt;

&lt;li&gt;Then port &lt;a href="http://blogs.gnome.org/johan/2008/06/01/introduction-to-gobject-introspection/" &gt;gobject-introspection&lt;/a&gt;.  GObject-Introspection relies on
  libffi for its guts, but the &lt;strong&gt;hard&lt;/strong&gt; part of this port will be refactoring
  g-i's build process, which is &lt;a href="http://mail.gnome.org/archives/gtk-devel-list/2009-March/msg00062.html" &gt;not cross-compilation
  friendly&lt;/a&gt;.  Might need to rewrite some tools.  If targeting NaCl, you might consider finishing the &lt;a href="https://groups.google.com/group/native-client-discuss/msg/1e61ab5f7bd71797" &gt;code allowing execution of unsandboxed NaCl binaries&lt;/a&gt;.&lt;/li&gt;

&lt;li&gt;Turn gobject-introspection on its head: generate GIR and a
  C binding for the platform "native" interface.  For NaCl,
  this would be a &lt;a href="http://www.w3.org/DOM/Bindings" &gt;GObject-using C-level binding
  of the browser-native DOM&lt;/a&gt;; 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.&lt;/li&gt;

&lt;li&gt;Demos!  Change browser DOM from Python, write native Android apps
  in Python.  Add a gobject-introspection binding to &lt;a href="http://dev.laptop.org/git/users/wmb/cforth" &gt;cforth&lt;/a&gt;,
  then do the same from forth.  (Forth might be a simpler place to
  start than Python.  Or not.)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;GTK (Android or NaCl)&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt; 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 &lt;a href="http://blogs.gnome.org/alexl/2011/03/15/gtk-html-backend-update/" &gt;broadway&lt;/a&gt; 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.&lt;/li&gt;

&lt;li&gt; Demo: "Hello GTK world" in Android/NaCl.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Sugar partitioning.&lt;/h3&gt;
&lt;p&gt;Bring Sugar closer to being a true
multi-language multi-library platform.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt; 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.&lt;/li&gt;

&lt;li&gt; Rewrite "Hello, Sugar" activity in C (or &lt;a href="http://en.wikipedia.org/wiki/Vala_(programming_language)" &gt;vala&lt;/a&gt;), using &lt;code&gt;#include&lt;/code&gt; for &lt;code&gt;import&lt;/code&gt;
  and &lt;a href="http://en.wikipedia.org/wiki/GObject" &gt;GObject&lt;/a&gt; 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.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Miscellanous topics&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt; &lt;a href="http://en.wikipedia.org/wiki/Google_Chrome_OS" &gt;ChromeOS&lt;/a&gt; w/ touch support.
     &lt;p&gt;Find an appropriate machine, do an installation, what are the
     roadblocks/rough spots?  Can we install on &lt;a href="http://www.engadget.com/2011/01/09/marvell-powered-olpc-xo-1-75-only-draws-2-watts-of-power-finall/" &gt;XO-1.75&lt;/a&gt; as a testbed?&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;TurtleArt as JavaScript viewer/editor.
     &lt;p&gt;Revisit &lt;a href="https://github.com/cscott/TurtleScript#readme" &gt;TurtleScript&lt;/a&gt; work, but skip over the
     time-consuming "construct an editor" step by reusing the
     (excellent) &lt;a href="http://wiki.laptop.org/go/Turtle_Art" &gt;TurtleArt&lt;/a&gt; code.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt; Mesh: android &lt;a href="http://lists.olsr.org/pipermail/olsr-dev/2011-April/004439.html" &gt;olsrd&lt;/a&gt; frontend, build testbed, research 802.11 DCF issues.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;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.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Sat, 30 Apr 2011 02:13:01 GMT</pubDate>
      <title>Pango/Android -vs- Pango/NaCl</title>
      <link>http://www.advogato.org/person/cananian/diary.html?start=82</link>
      <guid>http://cananian.livejournal.com/63595.html</guid>
      <description>&lt;p&gt;At the end of &lt;a href="http://cananian.livejournal.com/62756.html" &gt;my Sugar/Android&lt;/a&gt; week, I had a simple
&lt;a href="http://en.wikipedia.org/wiki/Pango" &gt;Pango&lt;/a&gt;-on-&lt;a href="http://en.wikipedia.org/wiki/Cairo_(graphics)" &gt;Cairo&lt;/a&gt; demo running.  This was built on a stack
of ported libraries, including &lt;a href="http://en.wikipedia.org/wiki/Gettext" &gt;gettext&lt;/a&gt;, &lt;a href="http://cgit.freedesktop.org/pixman/tree/README" &gt;pixman&lt;/a&gt;,
&lt;a href="http://en.wikipedia.org/wiki/FreeType" &gt;freetype&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Libxml2" &gt;libxml2&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Fontconfig" &gt;fontconfig&lt;/a&gt;, and &lt;a href="http://en.wikipedia.org/wiki/Glib" &gt;glib&lt;/a&gt;,
as well as &lt;a href="http://en.wikipedia.org/wiki/Cairo_(graphics)" &gt;cairo&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Pango" &gt;pango&lt;/a&gt;.  You can run the demo
yourself by &lt;a href="http://en.wikipedia.org/wiki/Sideloading" &gt;sideloading&lt;/a&gt; &lt;a href="http://dev.laptop.org/~cscott/Android/Pango/pango-demo.apk" &gt;pango-demo.apk&lt;/a&gt; onto your Android
device (tested on a Motorola &lt;a href="http://en.wikipedia.org/wiki/Motorola_Xoom" &gt;Xoom&lt;/a&gt;), and you can &lt;a href="http://dev.laptop.org/git/users/cscott/android-libs/tree/" &gt;browse the
source code&lt;/a&gt; to see what it entailed (here's the &lt;a href="http://dev.laptop.org/git/users/cscott/android-libs/tree/jni/Makefile.devel" &gt;scariest
part&lt;/a&gt;).  (I was inspired by Akita Noek's &lt;a href="https://github.com/anoek/android-cairo" &gt;android-cairo project&lt;/a&gt;,
but I ended up reworking the build scheme and redoing most of the
ports.)&lt;/p&gt;

&lt;a href="http://dev.laptop.org/~cscott/Android/Pango/screenshot.png" &gt;&lt;img src="http://dev.laptop.org/~cscott/Android/Pango/screenshot.png" width="300" alt="Screenshot of Pango demo on Android" title="Pango demo on Android" /&gt;&lt;/a&gt;

&lt;p&gt;It made sense to start my Sugar/&lt;a href="http://en.wikipedia.org/wiki/Google_Native_Client" &gt;NaCl&lt;/a&gt; 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 &lt;a href="http://dev.laptop.org/git/users/cscott/naclports" &gt;source code&lt;/a&gt; is a fork from
the upstream &lt;a href="http://code.google.com/p/naclports/" &gt;naclports&lt;/a&gt; project, and the process was generally much cleaner.
(But see my previous post for some &lt;a href="http://cananian.livejournal.com/63325.html" &gt;caveats regarding naclports&lt;/a&gt;.)
If you're using Chrome 10 or 11, you can &lt;a href="http://dev.laptop.org/~cscott/NaCl/Pango/cairo.html" &gt;run the demo in your
browser&lt;/a&gt; (follow the instructions on that page).  The
Wesnoth team has a parallel project which &lt;a href="https://groups.google.com/group/native-client-discuss/msg/8bfa6401e4951551?pli=1" &gt;ported some of these libraries as well&lt;/a&gt;, but
not in an upstreamable manner.&lt;/p&gt;

&lt;a href="http://dev.laptop.org/~cscott/NaCl/Pango/screenshot.png" &gt;&lt;img src="http://dev.laptop.org/~cscott/NaCl/Pango/screenshot.png" width="300" alt="Screenshot of Pango demo on Native Client" title="Pango demo on NaCl" /&gt;&lt;/a&gt;

&lt;p&gt;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&amp;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.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Both ports took about two weeks.&lt;/b&gt;  I blew my &lt;a href="http://cananian.livejournal.com/62667.html" &gt;original schedule&lt;/a&gt;,
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"&amp;mdash;but having gdb available made
debugging on Android easier.  (There is an unintegrated NaCl branch that
&lt;a href="https://groups.google.com/group/native-client-discuss/browse_thread/thread/e11fdea235fa3702" &gt;integrates NaCl gdb in the browser&lt;/a&gt;, though!)&lt;/p&gt;

&lt;p&gt;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&amp;mdash;even if you store
the user's own documents in a &lt;a href="http://wiki.laptop.org/go/Journal_Activity" &gt;Journal&lt;/a&gt;, software still expects
to find configuration, caches, and other data in a filesystem.&lt;/p&gt;

&lt;p&gt;Android provides the &lt;b&gt;POSIX filesystem APIs&lt;/b&gt;, but the filesystem an app can
touch is segmented and sandboxed.  As discussed previously, Android's
&lt;a href="http://developer.android.com/reference/android/os/storage/StorageManager.html" &gt;Opaque Binary Blob&lt;/a&gt; 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 &lt;a href="http://www.html5rocks.com/tutorials/appcache/beginner/" &gt;AppCache&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;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 &lt;a href="https://groups.google.com/group/native-client-discuss/msg/4b84cd47910430e2" &gt;--wrap linker indirection&lt;/a&gt; or through an appropriate
backend to newlib/glibc/glib).  For the NaCl demo app, I wrote a
rather-elaborate &lt;a href="http://dev.laptop.org/git/users/cscott/naclports/tree/src/examples/graphics/cairo/cairo_files.c" &gt;in-memory filesystem&lt;/a&gt; --- only to find that an
even-more-elaborate one &lt;a href="http://dev.laptop.org/git/users/cscott/naclports/tree/src/packages/scripts/memory_filesys" &gt;already existed in naclports&lt;/a&gt;.  But the
longer-term solution uses message-passing (&lt;a href="https://sites.google.com/a/chromium.org/dev/nativeclient/how-tos/simple-rpc" &gt;SRPC&lt;/a&gt; in NaCl, &lt;a href="http://developer.android.com/guide/topics/intents/intents-filters.html" &gt;intents&lt;/a&gt; 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.&lt;/p&gt;

&lt;p&gt;More problematic are the &lt;b&gt;networking APIs&lt;/b&gt;.  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, &lt;a href="http://en.wikipedia.org/wiki/WebSockets" &gt;WebSockets&lt;/a&gt; and even P2P via the
&lt;a href="http://rtc-web.alvestrand.com/home/papers/juberti-p2ptransport-api.pdf" &gt;HTML5 P2P APIs&lt;/a&gt;.  But it's not clear that (for example) glib's
elaborate &lt;a href="http://git.gnome.org/browse/glib/tree/gio/libasyncns/asyncns.c" &gt;asynchronous DNS name resolver implementation&lt;/a&gt; can (or
should!) be implemented in a NaCl port.&lt;/p&gt;

&lt;p&gt;In the end, the porting effort and abstraction shifts needed for
Native Client and Android are &lt;b&gt;roughly comparable&lt;/b&gt;.  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.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Sat, 30 Apr 2011 02:13:01 GMT</pubDate>
      <title>Sugar-on-Native Client investigation</title>
      <link>http://www.advogato.org/person/cananian/diary.html?start=81</link>
      <guid>http://cananian.livejournal.com/63325.html</guid>
      <description>&lt;p&gt;This post will describe the state of Native Client in general, based on
week 2 of my &lt;a href="http://cananian.livejournal.com/62667.html" &gt;original four week plan&lt;/a&gt;.  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
&lt;a href="http://en.wikipedia.org/wiki/Sugar_(desktop_environment)" &gt;Sugar learning environment&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To begin, the Native Client (NaCl) plugin is fairly mature in a number of
areas.  Version &lt;a href="http://code.google.com/chrome/nativeclient/docs/releasenotes.html" &gt;0.2 of the NaCl SDK&lt;/a&gt; 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 &lt;code&gt;about:flags&lt;/code&gt; dialog to enable it.  The
NaCl toolchain is much more standard than the Android NDK toolchain &lt;a href="http://cananian.livejournal.com/62756.html" &gt;I
discussed previously&lt;/a&gt;, and the robust &lt;a href="http://code.google.com/p/naclports/" &gt;naclports&lt;/a&gt; tree shows
that the patches required for NaCl ports of common packages &lt;a href="http://code.google.com/p/naclports/source/browse/trunk/src/packages/scripts/pixman-0.16.2/nacl-pixman-0.16.2.patch" &gt;tend not
to be too evil&lt;/a&gt;.  The &lt;a href="http://wiki.tcl.tk/28211" &gt;Tcl
interpreter&lt;/a&gt; and &lt;a href="http://dev.laptop.org/~cscott/NaCl/Qt/" &gt;Qt tookit port&lt;/a&gt; demos show that fairly complex pieces of code can be deployed today on NaCl.&lt;/p&gt;

&lt;p&gt;On the other hand, there are three main difficulties:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt; The default NaCl toolchain uses &lt;a href="http://en.wikipedia.org/wiki/Newlib" &gt;newlib&lt;/a&gt; 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 &lt;a href="http://codingrelic.geekhold.com/2008/11/six-million-dollar-libc.html" &gt;discussion of Bionic in the
Android SDK&lt;/a&gt;).  However, there also exists &lt;a href="https://groups.google.com/group/native-client-discuss/msg/16bcc685269fa09e" &gt;a branch of the SDK which
uses glibc&lt;/a&gt;.  The glibc branch supports several additional
features, like &lt;a href="http://code.google.com/p/nativeclient/issues/detail?id=565" &gt;shared library support&lt;/a&gt;.  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 &lt;i&gt;only&lt;/i&gt; 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.)&lt;/li&gt;

&lt;li&gt; The naclports project, although fairly robust, is driven between the
&lt;a href="http://en.wikipedia.org/wiki/Between_Scylla_and_Charybdis" &gt;Scylla and Charybdis&lt;/a&gt; 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 &lt;a href="http://nativeclient.googlecode.com/svn/data/site/pnacl.pdf" &gt;pNaCl&lt;/a&gt; as well.
It's &lt;a href="http://build.chromium.org/p/client.nacl.ports/console" &gt;auto-built&lt;/a&gt; against the latest SDK sources, but should also work
on the latest &lt;i&gt;released&lt;/i&gt; 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.&lt;/li&gt;

&lt;li&gt; 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 "&lt;a href="http://en.wikipedia.org/wiki/NPAPI" &gt;NPAPI&lt;/a&gt;" plugin
interface to interact with the browser.  It was followed by the
"Pepper" plugin interface, which was &lt;a href="https://wiki.mozilla.org/NPAPI:Pepper" &gt;itself abandoned&lt;/a&gt;.  Current
work uses the &lt;a href="http://code.google.com/p/ppapi/" &gt;Pepper2&lt;/a&gt; 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 &lt;a href="https://sites.google.com/a/chromium.org/dev/nativeclient/how-tos/debuggingtips" &gt;gdb support
strategies&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of these difficulties is insurmountable&amp;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&amp;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.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 27 Apr 2011 19:16:08 GMT</pubDate>
      <title>How does the iPad "use the iPhone's GPS"?</title>
      <link>http://www.advogato.org/person/cananian/diary.html?start=80</link>
      <guid>http://cananian.livejournal.com/63130.html</guid>
      <description>&lt;p&gt;A few months ago, a number of stories came out covering the iPad's remarkable-seeming ability to &lt;a href="http://blog.urbanape.com/post/3798485232/show-me-the-way" &gt;share the GPS of a tethered iPhone&lt;/a&gt;.  Apple's latest &lt;a href="http://www.apple.com/pr/library/2011/04/27location_qa.html" &gt;location database FAQ&lt;/a&gt; confirms the suspicions I voiced at the time: there's no actual GPS sharing involved.  Instead, Apple is using the simultaneous GPS and Wifi radios on your iPhone to "crowd-source" what I'll call a "skyhook" database (after the &lt;a href="http://www.skyhookwireless.com/" &gt;first company to publicly use the technique&lt;/a&gt;).  This correlates Wifi base station identifiers with their GPS locations &lt;i&gt;in real time&lt;/i&gt; -- including (most likely) the real time location of the "base station" created by the iPhone when it is in tethering mode.  All nearby Apple devices use this database to compute their location (based on all visible wifi base stations).  Since the nearby device sees the iPhone's "base station" and the iPhone is busily updating the position of that "base station" in real time (along with all the other base stations the iPhone can see), the iPad (lacking a GPS of its own) gains the apparent magical ability to compute a very accurate position for itself.&lt;/p&gt;
&lt;p&gt;The real interesting part of this story involves user consent and privacy&amp;mdash;do iPhone users generally know that their devices are registering their location in Apple's database in real time whenever tethering is turned on?  Any device which can query Apple's location database for the MAC address of your iPhone can track the position of your iPhone whenever you are tethering.  That's basically what the magical ability of the iPad/iPhone pair tells us.  Did you know that?&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 12 Apr 2011 21:14:03 GMT</pubDate>
      <title>Sugar-on-Android, week one</title>
      <link>http://www.advogato.org/person/cananian/diary.html?start=79</link>
      <guid>http://cananian.livejournal.com/62756.html</guid>
      <description>&lt;p&gt;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.  &lt;i&gt;Warning: technical content ahead...&lt;/i&gt;&lt;/p&gt;

&lt;h3&gt;Basic design of Sugar-on-Android&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Cross-compile gobject/GTK/gobject-introspection/cairo/dbus for Android;
distribute these key libraries as &lt;a href="http://developer.android.com/sdk/ndk/" &gt;NDK&lt;/a&gt; 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. (&lt;a href="http://dev.laptop.org/git/users/cscott/android-libs" &gt;Source code&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Use cairo or OpenGL backends of GTK3 to render legacy Sugar activities directly to Android
canvas.&lt;/li&gt;
&lt;li&gt;Modularize sugar; use &lt;a href="http://www.freedesktop.org/wiki/Software/dbus" &gt;D-Bus&lt;/a&gt; for inter-module communication.
Interprocess communication mechanism is Android &lt;a href="http://developer.android.com/guide/topics/intents/intents-filters.html" &gt;'intents'&lt;/a&gt;; these can
&lt;a href="http://developer.android.com/resources/articles/can-i-use-this-intent.html" &gt;redirect to the web or the Android Market for missing dependencies&lt;/a&gt;.  (&lt;a href="http://blogs.gnome.org/uraeus/2011/04/12/gstreamer-and-android/" &gt;Collabora reportedly already has a D-Bus implementation for Android&lt;/a&gt;.)  Sugar components can also become Android &lt;a href="http://developer.android.com/guide/topics/fundamentals/services.html" &gt;Services&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Implement Sugar &lt;a href="http://wiki.sugarlabs.org/go/Human_Interface_Guidelines/The_Laptop_Experience/Zoom_Metaphor" &gt;Home/Groups/Neighborhood&lt;/a&gt; views and &lt;a href="http://wiki.sugarlabs.org/go/Human_Interface_Guidelines/The_Laptop_Experience/The_Journal" &gt;Journal&lt;/a&gt; as four separate Android
&lt;a href="http://developer.android.com/guide/topics/appwidgets/index.html" &gt;App Widgets&lt;/a&gt;.  These could also be implemented by &lt;a href="http://developer.android.com/resources/samples/Home/index.html" &gt;providing a new Android home application&lt;/a&gt;, 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 &lt;a href="http://developer.android.com/resources/samples/CubeLiveWallpaper/index.html" &gt;Live Wallpaper&lt;/a&gt; is also similar in function, but not as good a fit.)&lt;/li&gt;
&lt;li&gt;The Sugar &lt;a href="http://wiki.sugarlabs.org/go/Human_Interface_Guidelines/The_Laptop_Experience/The_Journal" &gt;Journal&lt;/a&gt; becomes an Android &lt;a href="http://developer.android.com/guide/topics/providers/content-providers.html" &gt;"Content Provider"&lt;/a&gt;, which
stores/retrieves content for other Sugar activities. (There is special Android support for &lt;a href="http://developer.android.com/resources/samples/WeatherListWidget/index.html" &gt;"collection-based Widgets"&lt;/a&gt; and &lt;a href="http://developer.android.com/resources/articles/live-folders.html" &gt;Live Folders&lt;/a&gt; which may be helpful.)&lt;/li&gt;
&lt;li&gt;Use &lt;a href="https://live.gnome.org/GObjectIntrospection" &gt;gobject-introspection&lt;/a&gt; to build a multi-language environment.
Use &lt;a href="http://live.gnome.org/JGIR" &gt;JGIR&lt;/a&gt; to expose Sugar APIs to "native"
Dalvik apps; use something like the &lt;a href="http://code.google.com/p/android-scripting/" &gt;Android Scripting Environment&lt;/a&gt; to expose Android native
APIs to GIR languages (Python, JavaScript, C, etc).&lt;/li&gt;
&lt;li&gt;[opportunity] Use the &lt;a href="http://www.olsr.org/?q=node/30" &gt;Android port of OLSRd&lt;/a&gt; to implement a &lt;a href="http://wiki.sugarlabs.org/go/Human_Interface_Guidelines/The_Laptop_Experience/Zoom_Metaphor#Neighborhood" &gt;Neighborhood view&lt;/a&gt;.
Alternatively, investigate &lt;a href="http://code.google.com/p/adhoc-on-android/" &gt;AODV routing on Android&lt;/a&gt; and/or &lt;a href="https://www.alljoyn.org" &gt;AllJoyn&lt;/a&gt; (which also requires root access, see &lt;a href="https://www.alljoyn.org/sites/default/files/80-BA001-1_C_AllJoyn-Android-NDK-Developer-Guide.pdf" &gt;pg 24-25 of the manual&lt;/a&gt;).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Key Benefits&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Sugar is integrated into Android environment; use native Android
education apps, or apps like &lt;a href="http://www.gottabemobile.com/2011/02/18/android-3-0-honeycomb-movie-studio-enables-movie-editing-on-the-go/" &gt;Movie Studio&lt;/a&gt; which have no Sugar
equivalents yet.&lt;/li&gt;
&lt;li&gt;Android APIs and customization hooks are good, and provide a
more-extensible framework for development.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Open challenges (general)&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;The web integration story is cloudy.  &lt;a href="http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/WebViewDemo/src/com/google/android/webviewdemo/WebViewDemo.java" &gt;Java and JavaScript can call each other inside a bundled WebView widget&lt;/a&gt;,
but this isn't supported in standard Browser app.  Browser plugin interface would help.&lt;/li&gt;
&lt;li&gt;No good story for building 'native' &lt;a href="http://en.wikipedia.org/wiki/Dalvik_(software)" &gt;Java/Dalvik&lt;/a&gt; or C apps on the device.
Writing a simple Dalvik compiler would help.  &lt;a href="http://en.wikipedia.org/wiki/Dalvik_(software)#External_links" &gt;Dalvik specs are available&lt;/a&gt;, and people have
written &lt;a href="http://benlynn.blogspot.com/2009/02/compiler-compilers_11.html" &gt;Dalvik compilers for toy languages&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;"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.&lt;/li&gt;
&lt;li&gt;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. (&lt;a href="http://code.google.com/p/android/issues/detail?id=545" &gt;Android bug&lt;/a&gt;, &lt;a href="http://groups.google.com/group/android-developers/browse_thread/thread/fe0978b471d4bef4/72507bfb7586aded?lnk=gst" &gt;discussion&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Current technical issues/bugs&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;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 &lt;a href="http://dev.laptop.org/git/users/cscott/android-libs/tree/jni/Makefile.devel" &gt;kludged things together&lt;/a&gt;
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 &lt;code&gt;Android.mk&lt;/code&gt; build system of the NDK is
a non-starter.  No serious obstacles here, just work to
do.&lt;/li&gt;
&lt;li&gt;Xoom hardware is ARMv7, but &lt;a href="http://groups.google.com/group/android-ndk/browse_thread/thread/a19fc6df3d661d79" &gt;Android emulator is ARMv5 only&lt;/a&gt;.
Unfortunately, gdb is broken on the Xoom.  So we're
building for ARMv5 at the moment, so we can debug in the (slow) emulator.&lt;/li&gt;
&lt;li&gt;No good support for shared libraries may cause activity bloat.
May be able to be worked around using the &lt;a href="http://developer.android.com/reference/android/os/storage/StorageManager.html" &gt;new Opaque Binary Blob (OBB) feature&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;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 &lt;a href="http://developer.android.com/guide/topics/data/data-storage.html" &gt;storage APIs in Android&lt;/a&gt;, but none seems quite right.
&lt;/li&gt;
&lt;li&gt;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 &lt;a href="http://android.git.kernel.org/?p=platform/packages/apps/Launcher2.git;a=summary" &gt;Launcher source&lt;/a&gt;?&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;We're building libraries without thread support because Android's
"Bionic" libc has an eccentric thread library.  Linking with
&lt;code&gt;-lpthread&lt;/code&gt; fails because the thread functionality is bundled into &lt;code&gt;-lc&lt;/code&gt;.
Probably just providing an empty &lt;code&gt;libpthread.so&lt;/code&gt; would help a lot.&lt;/li&gt;
&lt;li&gt;Some work has been done to build GNU libc for Android.  This bloats
activities even further, but might help ease library porting.&lt;/li&gt;

&lt;li&gt;Porting gobject-introspection will be painful because &lt;a href="http://mail.gnome.org/archives/gtk-devel-list/2009-March/msg00062.html" &gt;its makefiles
  are not set up for cross-compiling&lt;/a&gt;.  Some steps want to run on the
  target hardware, which is difficult in the Android environment.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Bottom line&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>

