Friday, October 22, 2010

Presentations in Factor

Just a few days ago, Daniel Ehrenberg gave a presentation at the Dynamic Language Symposium 2010 in Reno, Nevada. It was quite good, and gave a nice overview of the different language features that Factor supports.

Like many of the talks about Factor, it was made (and presented!) using Factor. Specifically, the slides vocabulary, which is a simple DSL for presentations. To show how it works, let's just jump directly to an example:

( scratchpad ) USING: help.markup slides ;

( scratchpad ) {
                   { $slide "Factor!"
                       { $url "" }
                       "Development started in 2003"
                       "Open source (BSD license)"
                       "Influenced by Forth, Lisp, and Smalltalk"
                       "Blurs the line between language and library"
                       "Interactive development"
               } slides-window

When run, this pops up a window that can be used for presentations. It will look something like this:

You can control the slideshow window using the keyboard:

  • Press DOWN to move to the next slide.
  • Press UP to move to the previous slide.
  • Press F to toggle full-screen mode.

In addition, the slides vocabulary supports some other features, such as embedding code and clickable links to vocabularies or words. Here is an example which does both of these:

( scratchpad ) {
                   { $slide "Code!"
                       "Try clicking on these:"
                       { $code "2 2 +" }
                       { $vocab-link "sequences" }
                       { $link nth }
               } slides-window

If you want to customize the look-and-feel of the presentation, you need to modify the stylesheet used to render the presentation.

To see it in action, you can watch Slava Pestov give a Google Tech Talk on Factor. The slides he used are available in the Factor source tree under extra/google-tech-talk.

Slides for most of the other talks that have been given are also available (they are a nice way to get a quick overview of the "big features" in Factor):

It's so cool, even Zed Shaw gave a presentation using the slides vocabulary.


Anonymous said...

Generic word (fullscreen?) does not define a method for the word class.
Dispatching on object: x11-ui-backend

— using slides on Linux.

Steve Tsai said...

I tried to run the code in Win 7 and the background of the text is black. Therefore, all black text became black blocks. How can I fix the code for Win 7.


Unknown said...

Tsai, the exact same thing is happening to me! So you're not just crazy :)