I'm teaching a compiler construction course (upper level undergraduate, intro graduate) at the University of Iowa this spring, using the Pi. I'll divide this reply into two halves -- one half is general, applicable to any class using the Pi. The other half is about my class.
---- part 1: logistics of classroom use
The Pi is cheap, but what about using it? Keyboards, cables, displays, etc? We've decided to work things as follows:
We will have a stock of Pi kits available for sign-out. The kit includes a 1-amp power supply and a Model B rev 2.0 Pi mounted in the Raspberry colored enclosure you can get from MCM Electronics.
We will have several workstations in the student lab space equipped with a flat-panel display, keyboard, mouse, and network cable, plus a wall outlet. Plug in the cables from monitor, mouse, etc., and you have a workstation you can use.
Students must provide their own SD card. This eliminates our liability for the contents of their file system. They keep the SD card when they return the Pi, so we don't have to sanitize any disks. SD cards are cheap.
Students who have old USB mice and keyboards, and who have access to an HDMI display, are free to use those. Most modern flat-screen TVs have HDMI, and old mice and keyboards are commonplace (I'm currently using an olde Apple mouse from the Bondi-Blue generation of I-mac as I type this). We also provide a list of sources for everything, including part numbers, local retail outlets that stock the parts, etc, for those students interested in buying new.
Just this evening, I mounted 20 brand-new Pis in their cases. The case we chose has 4 screws to close it, and none of the detailed fiddly work you need to go through to assemble those pretty laser-cut cases. Assembly went very quickly, and I had the time to test a number of the assembled Pis to verify that they are good -- and I encountered no problems.
In sum, students may opt to spend money, but the expected cost per student to use the Pi is less than the cost of many modern textbooks. The course is not textbook-based -- the necessary resources are all on the web.
---- part 2: The class.
Why teach compiler construction on the Pi? Why not use a PC? The big reason is the ARM CPU. The ARM CPU is far nicer, from a pedagogical perspective, than the X86 architecture found inside PC compatibles. Intel tried hard to kill the X86 in the late 1980s (Microsoft reacted by buying enough Intel stock to prevent that). The X86 is horrible because it is the product of evolution, not intelligent design. It has features that made great sense on a bottom-of-the-line 8-bit microprocessor like the 8088, but are horrible on a 32-bit machine. In contrast, the ARM is a clean CPU, designed to be what it is instead of evolved from a work into a dinosaur.
But of course, there are ARM emulators available on PCs. I've taught using emulators for decades. It works, but students know they're not using a real machine, and the result is, they feel less motivated. I'd like to teach the course so that, when they finally build a working compiler, they can see their code running directly on a real computer. The Raspberry gives me that opportunity.
As things progress, I'll post materials on the course web site (which is not yet ready to go live, but which will be linked from my home page when it is).
-- Doug Jones