The only tool you need is the TCL interpreter, tclsh
.
For Windows, the best place to get Tcl is the ActiveTcl product from ActiveState
For MacOS and Unix-like operating systems, tclsh
will be already
installed. Typically the installed version will be 8.5.something.
To install the current stable 8.6 version:
- with MacOS, use Homebrew
- for Linux, check your package manager
- or download the source and build it.
For solving exercises using the Exercism web interface, the test runner (as of Feb 2023) uses Tcl version 8.7a4.
It's common to launch an interactive
tclsh
session to test out commands while you're coding. However, tclsh provides
only a very basic REPL interpreter with no command line editing or command
history. For an enhanced experience, a program called rlwrap
exists that adds readline
functionality:
rlwrap tclsh
To install:
- with MacOS, use Homebrew
- for Linuxes, check your package manager
- or download the source and build it.
It's so handy you'll want to always use it: add this to your ~/.bashrc
command -v rlwrap && alias tclsh='rlwrap tclsh'
The current stable version is 8.6. As indicated above, version 8.5 is still widely deployed, but it's no longer receiving patches. Version 8.7 is still pre-release, but it's very stable.
You can test which version of tclsh
you have installed
by running the following command:
echo 'puts [info patchlevel]' | tclsh