[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] Wireworld animated GIF renderer - also questions on sty
From: |
John Morrice |
Subject: |
[Help-smalltalk] Wireworld animated GIF renderer - also questions on style and distribution |
Date: |
Mon, 6 Dec 2010 22:07:30 +0000 |
Hi list!
Recently I found a Rosetta code task which asked readers to submit
implementations of the Wireworld cellular automaton in various
languages. See:
http://rosettacode.org/wiki/Wireworld
I noticed that Smalltalk was not on the list, so I decided to try
learning it and completing the task. My efforts can be found here:
https://github.com/elginer/jwgif
You can have a peek at the animated output here:
https://github.com/elginer/jwgif/blob/master/3cycle.gif
What it does:
* Reads wireworld programs in the format described on the Rosetta
Code page.
* Produces animated (pseudo) GIFs of the simulation, using libplot from
GNU Plotutils.
* Crashes with uninformative error messages on incorrect input because
it does no error handling whatsoever.
This is my first Smalltalk program. I really enjoyed writing it - but I
am yet a complete newbie! I've only read the GNU Smalltalk tutorial and
parts of the user guide at
http://www.gnu.org/software/smalltalk/manual/gst.html
Inevitably I have questions:
* I have not parcelled my program as a package. I've read about
Smalltalk packages though, and I see that a package can depend on a
shared object being installed.
However, my program contains C code which is compiled to a shared
library and then loaded dynamically in Smalltalk. I couldn't see
anything in the user manual which would suggest that C source can be
distributed as part of a package, and compiled on the user's machine.
Am I right or are there Smalltalk tools that help with this?
More broadly: am I doing it wrong?
What is the convention for dealing with this?
* I'm used to choosing method and function names in Ruby,
Haskell and C that describe the intent of the function. In
Smalltalk I'm finding this difficult because I need multiple
selector names, one: for each: parameter, so I have to choose multiple
selector names which together describe the intent. I'm not sure
why, but I find this very difficult. Any advice?
Cheers guys,
Johnny
- [Help-smalltalk] Wireworld animated GIF renderer - also questions on style and distribution,
John Morrice <=