README
.. image:: http://cscott.net/Projects/TurtleScript/images/hello-world.png :align: right
Project Goals
The TurtleScript experiment attempts to provide a simple logo-like
programming environment which is based on a "real" programming
language. It draws heavy inspiration from Etoys_, Scratch_, BYOB_,
Elements_, TileScript_, Turtle Art
, and Open Blocks
. As a
browser-based programming environment, it builds on ideas from the
Lively Kernel
_ and Lively Qt
. The TileScript paper
describes
our own motivations well, although we've chosen a slightly different
path.
The ultimate goal is to construct a Sugar_-like activity environment with
a pervasive and scalable View Source
_ capability. Any visible item
can be interrogated and almost all source code viewed, modified,
and saved for later use in an interactive fashion. The choice of
JavaScript is intended to leverage modern browser technology, which
already provides an advanced runtime environment and sandbox. It is
also a commercially-important programming language, which is (sadly)
important to many vocationally-minded educators.
I've also been recently (re)inspired by the Smalltalk community, and
in particular by Ian Piumarta's work on the small self-describing
systems cola_ and maru_. The SELF bytecode format described in
Chambers et al's OOPSLA 89
_ paper was a further incentive to
investigate minimal executable representations. The hope is that
a few powerful optimizations can be employed against a tiny set of
fundamental operations to create a compact and high-performance
environment which is truly "turtles all the way down
_".
.. _Etoys: http://wiki.laptop.org/go/Etoys .. _Scratch: http://scratch.mit.edu/ .. _BYOB: http://byob.berkeley.edu/ .. _Elements: http://www.chirp.scratchr.org/blog/?p=24 .. _TileScript: http://tinlizzie.org/jstile/ .. _TileScript paper: http://tinlizzie.org/jstile/#TileScript .. _Turtle Art: http://wiki.laptop.org/go/Turtle_Art .. _Open Blocks: http://education.mit.edu/drupal/openblocks .. _Lively Kernel: http://www.lively-kernel.org/index.html .. _Lively Qt: http://lively.cs.tut.fi/qt/ .. _Sugar: http://wiki.laptop.org/go/Sugar .. _View Source: http://wiki.laptop.org/go/View_Source .. _cola: http://piumarta.com/software/cola/ .. _maru: http://piumarta.com/software/maru/ .. _OOPSLA 89: http://selflanguage.org/documentation/published/implementation.html .. _turtles all the way down: http://en.wikipedia.org/wiki/Turtles_all_the_way_down
Warnings and Caveats
This README is a description of a work-in-progress. It is likely to get increasingly outdated over time. I'll attempt to periodically overhaul it to match reality, but it may always contain historical fragments, false starts, and loose ends.
State of the world: 2013-06-03
I recently wrote a "native" interpreter for TurtleScript in Mozilla's Rust_ programming language. The source code for that project can be found at http://github.com/cscott/rusty-turtle.
In the process I improved the REPL_ for TurtleScript, built out the standard library a bit, fixed bugs, and added node_ compatibility and a test suite.
More recently I've begun to think about a
TurtleScript-to-asm.js
-to-LLVM
compiler, which would let me investigate object layout and performance
optimizations without resorting to Rust, C, or another low-level
language. (Unfortunately asm.js
is not a proper subset of
TurtleScript at present, since TurtleScript doesn't have the switch
statements or bitwise operators. This gap can be mended.)
Accordingly, asm-llvm.js
_ is the beginnings of an asm.js
-to-LLVM
compiler, written in TurtleScript.
.. _Rust: http://www.rust-lang.org .. _REPL: http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop .. _node: http://nodejs.org .. _asm.js: http://asmjs.org .. _LLVM: http://llvm.org/ .. _asm-llvm.js: https://github.com/cscott/TurtleScript/blob/master/asm-llvm.js
State of the world: 2011-05-19
The source code for the project is hosted at http://github.com/cscott/TurtleScript.
It begins with a parser for the "Simplified JavaScript" of
Douglas Crockford
_ in parse.js
. I've extended the language very
slightly: it now supports block comments and '