simple-graphics
Documentation
Login

This is simple-graphics, a turtle graphics library for Chicken Scheme.

It is designed for educational use, to let new programmers quickly have something interesting they can program the computer to do: draw pictures. This has more immediate appeal than arithmetic...

There are dedicated turtle graphics apps out there, and there's the original Logo programming language that really pioneered the use of turtle graphics in education, but my simple graphics engine is slightly special: you use it through a normal Scheme interactive prompt rather than a special "dumbed down" interpreter. That means you can start by typing in simple graphics commands that are executed immediately, then slowly progress to use the full power of Lisp - a language capable of "lowly" systems programming, commercial applications, or advanced artificial intelligence and computer science research.

Having that continuum is valuable in subtle ways. A learner can start by drawing simple pictures then, with a little assistance, connect to a Web server to obtain live temperature readings from sensors and draw a dashboard with moving gauges and charts of previous values. They can migrate towards solving "real problems" and producing useful software in a series of tractable steps. They can develop the confidence to leave the simple interactive turtle graphics environment and produce other kinds of software, such as command-line tools, network daemons, and Web applications, without needing to overcome any fundamental hurdles.

To get started, install Chicken Scheme from your package manager, as well as the SDL and Cairo libraries. You might also need to install additional the SDL_gfx library if it isn't bundled with SDL on your platform.

Then install simple-graphics with the following command:

chicken-install -s simple-graphics

If you get any errors about linkage problems, you might not have all of the required bits of SDL and Cairo installed; generally, a Google search for the error message you get and the name of your operating system will help!

Finally, when the install is complete, you can start drawing pictures with the following commands:

csi
(use simple-graphics)
(forward 5)

Please see the egg page in the Chicken Wiki for the documentation.