This directory contains a number of simple Timber examples.
In addition to the pages that describe the programs and comment on
the code, the source files are here and can be compiled and run.
Module Echo is stored in file Echo.t and is compiled
and linked by the shell command
which produces an executable file called Echo which can be
run by the command
This is generalized in the expected way to other programs;
the --make option makes sure that all
(recursively) imported modules are compiled in the proper order
before linking is done.
Some programs require a command line argument as described in the
A brief summary of the programs is the following:
- Echo. The archetypical reactive program: user input is
read line by line and echoed to the screen.
- Counter. The quintessential stateful class; its instances
maintain an integer value that can be increased and decreased.
- Echo2. Slight extension of Echo: the output
lines are decorated with line numbers, thus adding state to the
- Echo3. Another extension: The last input line is
repeatedly echoed once per second, showing use of Timber time
- EchoServer. Still a variation: Echoing user input
over the Internet.
- EchoServer2. A variation of the previous: limiting
the number of concurrently served clients.
- Reflex. A simple reaction time tester.
- MasterMind. A bit more complex: The user chooses a
secret in MasterMind and the program does the guessing.
- Primes. A degenerate reactive program: computes and prints the number of
primes smaller than a given bound and terminates.
- PingTimeServers. Asks a number of network time servers for the current time.