Category Archives: scheme

Guile-2D 0.1 Release

To celebrate the GNU Project’s 30th anniversary, I have decided to
make the very first release of my 2D game development framework for
GNU Guile. GNU Guile is a Scheme implementation, and has the honor
of being the official extension language of the GNU project. Guile-2D
is a layer above SDL, OpenGL, FreeImage, and FTGL that provides
abstractions for common 2D game programming requirements such as
sprites, tilesets, animations, scripting, and collision detection.

There is a lot of work to do in order to get Guile-2D up to snuff with
the game libraries for more popular languages like Python and Lua. I
am looking for contributors who share my vision of creating a fully
featured, easy to use game library in Scheme.

Guile-2D currently supports GNU/Linux distributions. I am looking for
help to get it running on OS X and Windows.

Please refer to the INSTALL.org, README.org, and texinfo files to
learn how to install Guile-2D, run example programs, and write your
own games.

Download the release tarball
Browse the source code on GitHub

From the blog dthompson by David Thompson and used with permission of the author. All other rights reserved by the author.

The Little Schemer

Yesterday, I took a trip to the MIT Press Bookstore and picked up a
copy of The Little Schemer. I’ve only spent a few hours reading and
coding along with it, but I’ve had a lot of fun. The following is a
mini-review based on my experience thus far.

"The Little Schemer" teaches you to think recursively using an
interesting and comedic writing style and the Scheme programming
language. While Scheme is the language of choice, the real goal is to
teach you problem solving rather than the details of a specific
language. The book starts off simple, explaining what atoms, lists,
and S-expressions are. Rather than providing the definition and then
showing examples, it first gives examples in the form of a question
and answer.

Example:

Is it true that this an atom?

atom

Yes, because atom is a string of characters beginning with a
letter.

From the examples given, a definition is created. In later examples, a
Scheme procedure is written that produces the correct answers for all
of the questions stated before it. It’s fun to build the procedure,
verify that it works for all cases, and compare your implementation
with the book’s.

"The Little Schemer" defines ten commandments that are essential to
correctly solving the problems in the book. Some commandments are
first given in an incomplete form, and expanded later when a greater
level of understanding has been achieved. The problems that you solve
reinforce the commandments. You might notice that you start writing
procedures without thinking much about it, much like the muscle memory
earned from using Emacs a lot. Gerald J. Sussman was right when he
said that this book "can perform the same service that Hanon’s finger
exercises or Czerny’s piano studies perform for the student of the
piano." I have no idea who Hanon and Czerny are, but I get it. For the
drummers out there, you could liken this book to Stick Control.

The writing style is very informal, comedic, and food themed. Page 13
has a space reserved for jelly stains, and page 52 tells you to "go
cons a piece of cake onto your mouth." I have laughed a number of
times while reading. Oh, and let’s not forget about the cute elephant
drawings. This is definitely not your average boring, dry computer
science book. If you are interested in a unique and enjoyable learning
experience, then I highly recommend reading "The Little Schemer".

From the blog dthompson by David Thompson and used with permission of the author. All other rights reserved by the author.

guile-2d – A 2D Game Development Framework for GNU Guile

This is the very first devlog entry for my pet project, guile-2d. As
the title suggests, guile-2d is a 2D game development framework for
GNU Guile, a Scheme implementation that has the honor of being the
official extension language of the GNU project. Guile is a language
with a growing number of features, but it still lacks a large
assortment of libraries. I like to do 2D game programming, and I saw a
niche that needed to be filled. Python has Pygame, Lua has Love, but
there’s no fun and accessible game programming library for
Guile. Guile-2d is working to correct that.

The goal of Guile-2d is to create an easy to use 2D game programming
framework. Libraries like SDL give the programmer a rather low-level
set of tools that they can use to build a game, guile-2d will provide
high-level tools over low-level SDL and OpenGL for commonly used
elements of 2D games: tile maps, sprite animation, particle systems,
collision detection, vector math, A* pathfinding, etc. Such features
will allow a game developer to very quickly produce a working
prototype with guile-2d.

Guile-2d is a framework, which means that it has some opinion about
what the right way to do things is. The most apparent example of this
is the game loop. The game loop runs at 60 frames-per-second and uses
fixed timestep updates. Those that have read Fix Your Timestep will
know that this decision is a good thing.

Perhaps the most important feature of guile-2d is the ability to do
"live coding". When the game loop starts, a REPL
(read-eval-print-loop) server is started. Using the great Geiser
extension for Emacs to connect to the REPL server, one can modify
their game as it is running. This gives users the power to evaluate
some new code and see the changes reflected immediately in the game
window. No need to restart the game unless you crash it!

This has been a brief overview of some of the features and goals of
guile-2d. If this project interests you, you can check out the source
code on Github.

From the blog dthompson by David Thompson and used with permission of the author. All other rights reserved by the author.