Scheme in Javascript

Scheme’s power to simplicity ratio makes it a fun target for implementation. Today, I introduce a couple new ways of running Scheme powered by Javascript.

The first is an online Scheme interface that I’ve been working on sporadically for the last few months. Inspired by TryHaskell, it began as a series of patches to jquery-console, a jQuery terminal-ish plug-in. While my own Scheme-in-Javascript interpreter FoxScheme hasn’t yet reached a very featureful stage yet (macros are the next step), somebody else had created a similar system before me. It was a simple matter to replace FoxScheme with a different back-end system, in this case, Jason Orendorff’s Try Scheme.

Continue reading Scheme in Javascript

Convert PHP to static pages with GNU Make

I recently moved an old website to a new server. For performance reasons, the new server is running nginx instead of Apache, and didn’t have nginx set up to use PHP. (The optimal way, apparently, is to use PHP-FGM, which currently requires you to patch and build PHP yourself, at least until PHP 5.4).

That was fine, though, because this old site only really needed PHP for one little thing that we could do without. In fact, the primary reason for using PHP here was to essentially append the header and footer sections to each unique page. Basically, we had stuff like:

<?php include('../header.inc'); ?>
... page contents ...
<?php include('../footer.inc'); ?>

on every page. What I needed was an automated process to convert all of these PHP pages into static pages. GNU Make, of course, is the de facto standard for automating something like this. Let’s give it a go:

Continue reading Convert PHP to static pages with GNU Make