Tuesday, May 14, 2013

Guile 100 #7: Animated GIFs

Challenge #7 in the Guile 100 Programs Project is to write a function that creates an animated GIF from a datacube of 8-bit color indices and a 256 color palette.   It is the third challenge in this month's theme, which is "Web 1.0 -- Web 1990s style".

The Guile 100 Programs Project is an attempt to collaboratively generate a set of examples of how to use the GNU Guile implementation of Scheme.

There is a 100 USD bounty for writing a readable solution to one of the problems.  Anyone can fork the repo and tell me to pull it or just send me a solution by e-mail at guile100 [at] lonelycactus.com

Three other problems remain open.
This week I received solutions to
There's one more problem left in Web 1.0.  Probably something to do with Gopher.  See you next week!
 
 

Monday, May 13, 2013

Lessons from Ceefax


Whilst meandering on the Web, I ran across a YouTube video of the BBC 2's Ceefax service.  Ceefax was the British version of Teletext, which was, in effect, hundreds of TV channels that displayed text or mosaic graphics.  Because this was in the analog TV signal and had to be backwards compatible with 30 year old televisions, the text resolution was quite poor.  24 lines by 40 columns.  Mostly it stuck to an eight color palette.  Each page had a theme: news, sports, weather, travel. Each page displayed about eighty words of text, and the message changed every 20 to 30 seconds.

Normally these pages had no audio, but, in the late night hours, BBC 2's main channel would mirror the main Ceefax page, and add some rather odd instrumental music accompaniment.

Ceefax is no more, since the analog television signal has been decommissioned in the UK.  Long live Ceefax.

Coincidentally, I'd been playing quite a bit with both GNU Serveez and Cairo, and I saw an opportunity to tie both together into a fun project.  So I've been writing a client/server to create a Teletext-like service.  The server is written using the Serveez server framework.  The server pushes rendered text and audio out to the client.  The client is written in GTK using Cairo to render authentic-looking bitmapped fonts that can do double-wide, double-tall, double-size, and, most importantly, *blink*!

Font property test of my Ceefax-like client

I'm well along now.  The only remaining step before declaring it Alpha is to get it to play the Ogg stream for my dodgy instrumental music. For that part, I've been hooking the Ogg Vorbis libraries to the PulseAudio API.  I know that GStreamer is the way I'm supposed to do that sort of thing, but, I find that using the raw PulseAudio API much more amenable to the way I think.

As an aside, Gnome has chosen javascript as its official language.  I tried it out.  I wanted to use it, but, the GTK documentation just isn't there yet.  I ended up writing my client in C.


Font test of my Ceefax-like client

---
Reading the Teletext specifications lead me to reading all the Videotex specifications.  Videotex was a set of standards for a hardware terminal.

The best example of an implementation of Videotex was France's Minitel service, also recently decommissioned, apparently.

I'm amazed by the effort in these old standards, and the wisdom contained therein.  Keeping in mind that these standards are over 20 years old now.  It is almost hilarious how often we've reinvented the wheel since then.

What fascinated me most about the Videotex standards was the fundamental conceit that there is only stdout and stdin.  (Videotex was designed with a modem in mind.)  Just as old Unix or Plan 9 believed that everything, including hardware, is a file, Videotex believed that everything was stdout/stdin.  Escape sequences would let the server send to the client interspersed text, raster graphics, vector graphics, audio, color palettes, and fonts, all through stdin!  These standards pre-date HTTP and HTML by a decade or so.  They describe a terminal that is way more interesting that the Platonic ideal of a terminal presented in ECMA-48, which is a specification burdened by trying to cover both terminals and line printers.

But a feature complete Videotex terminal was never implemented as far as I know. Neither was a feature complete ECMA-48 terminal implemented, for that matter.

Monday, April 29, 2013

Guile 100: Challenge #6. plus new rules

Challenge #6 in the Guile 100 Programs Project is to write a Guile CGI script that accesses a MySQL-family database.   It is the second challenge in this month's theme, which is "Web 1.0 -- Web 1990s style".

The Guile 100 Programs Project is an attempt to collaboratively generate a set of examples of how to use the GNU Guile implementation of Scheme.

There is a 100 USD bounty for writing a readable solution to problems.

Also, I'm changing up the rules.  I had made it pretty complicated to contribute, I suppose, because I don't really want to create competition for fear of alienating anyone.  But, the barrier to entry was too high, perhaps?  So anyone can fork the repo and tell me to pull it or just send me a solution by e-mail at guile100 [at] lonelycactus.com

Three other problems remain open.
If the backlog reaches six open problems, I guess I'll kill the project then.
 

Monday, April 08, 2013

Guile 100 #5: Guile meets PHP

Challenge #5 in the Guile 100 Programs Project is to write a CGI script that serves up HTML pages with embedded Scheme, a la PHP.  It is the first challenge in this month's theme, which is "Web 1.0 -- Web 1990s style".

Also we have a solution for Challenge #2, which was to re-implement the command `ls' in Scheme.

The Guile 100 Programs Project is an attempt to collaboratively generate a set of examples of how to use the GNU Guile implementation of Scheme.

There is a 100 USD bounty for writing a readable solution to this problem.

Boring details after the jump.

Monday, April 01, 2013

Guile 100 #4: tar files

Challenge #4 in the Guile 100 Programs Project is quite simple. Write a script that will create a tar file from a list of files.  It is the fourth and final challenge in this month's theme, which is "/bin - reimplementing common Posix tools".

The Guile 100 Programs Project is an attempt to collaboratively generate a set of examples of how to use the GNU Guile implementation of Scheme.

There is a 100 USD bounty for writing a readable solution to this problem.

More details after the jump.

Monday, March 25, 2013

Guile 100 #3: LZW Compression

Challenge #3 in the Guile 100 Programs Project is to write a version the Posix program `compress'.  This includes the task of writing procedures to do LZW compression. It is the third challenge in this month's theme, which is "/bin - reimplementing common Posix tools".

Also, a solution  to problem #1, `echo' and `cat' is posted.  Chris Jester-Young was the volunteer for that, and I've edited his code slightly.  Please check it out and let me know what you think.

The Guile 100 Programs Project is an attempt to collaboratively generate a set of examples of how to use the GNU Guile implementation of Scheme.

To help ensure that each challenge has at least one completed implementation, an "official volunteer" will be chosen at random from those that have expressed interest in the project.  If that official volunteer can complete the task in two weeks, he or she will receive a bounty of 100 USD.  The official volunteer for this week's challenge will be chosen on Wednesday Mar 27.

For more information, check out the project's website at http://www.lonelycactus.com/guile100
 
To request to join the project as a potential official volunteer, or to otherwise contact the project, e-mail guile100@lonelycactus.com
On a personal note, first week back to the gym after a winter of sloth.  Very, very sore.

Monday, March 18, 2013

Guile 100 Programs Project Challenge #2, ls

Challenge #2 in the Guile 100 Programs Project is to write a version of the Posix program ls. ls is a program that lists the files in a directory, and it is the second challenge in this month's theme, which is "/bin - reimplementing common Posix tools".
The completed version need only support the standard flags -a -l and -R

The Guile 100 Programs Project is an attempt to collaboratively generate a set of examples of how to use the GNU Guile implementation of Scheme.

To help ensure that each challenge has at least one completed implementation, an "official volunteer" will be chosen at random from those that have expressed interest in the project.  If that official volunteer can complete the task in two weeks, he or she will receive a bounty of 100 USD.  The official volunteer for this week's challenge will be chosen on Wednesday Mar 20.

For more information, check out the project's website at http://www.lonelycactus.com/guile100
 
To request to join the project as a potential official volunteer, or to otherwise contact the project, e-mail guile100@lonelycactus.com