Introduction

This site provides access to various things I have put together to make my life with TCL easier; in particular, management of my shell environment (using a stripped-down Jim), but also some additional system automation tasks. These include:

  • Precompiled binaries for a variety of platforms.
  • A small library of comfort utilities and bits from the Web, most of which work in Jim. This library is intended to be included as a Git submodule, and is available at https://github.com/mdekstrand/common-tcl.

Missing Library

The missing package provides several routines that are “missing” from the basic TCL environment. These are little bits that round out existing functionality, or in some cases polyfill functions that either Jim or Tcl lack from the other's features.

Use this package with:

package require missing

List Routines

These routines work with lists.

lshift

lshift listVar removes and returns the first element of the list in listVar. Its implementation is derived from the tcl wiki.

It does not fail on an empty list.

lempty

lempty list returns true if list is empty.

lpeek

lpeek list returns the first element of the list without removing it.

luniq

luniq list returns the unique elements of list. Order is preserved — each element is returned the first time it appears in list, and subsequent occurrences are skipped.

lunshift

lunshift listVar elt... pushes one or more elements onto the beginning of a list. If multiple elements are provided, their order is preserved.

Info Routines

exists

The exists procedure is a mostly-compatible polyfill to provide Jim's exists command on Tcl.

kvlookup

The kvlookup module implements a single procedure, kvlookup, that provides flexible lookup for keys in key-value structures like arrays and dictionaries.

Load this with:

package require kvlookup

kvlookup ?-default default? (-array var | -var var | dict) key

The options are as follows:

  • -default default — return the value default instead of an error if the key is not found.
  • -array var — look up in the array named var.
  • -var var — look up in the dictionary or array (auto-detected) named var.
  • dict — look up in the provided dictionary value.
  • key — the key to retrieve.

Future versions of this will support nested key retrieval.

Logging

The logging package provides a basic logging with zero dependencies (other than the included ansifmt package) that works on both Jim and Tcl.

To use this library, simply require it:

package require logging

msg

The primary feature of this library is the msg procedure:

msg ?-level? message

The following levels are supported:

  • -debug — debug-level logging, disabled by default.
  • -info — informational messages, enabled by default.
  • -warn — warning messages, enabled by default.
  • -error — error messages, enabled by default. -err is accepted as an alias.
  • -success — the same level as -info, but highlighted to more clearly indicate a success message.

configure

The logging::configure procedure reconfigures logging behavior. It takes flags to control its output:

  • -quiet — silence -info messages, only printing warnings and errors.
  • -verbose — enable -debug messages.
  • -level level — set the logging level to 'level'

ansifmt

ansifmt is a small package that provides access to basic ANSI terminal formatting codes. It primarily exists to allow logging to color its output.

Its interface is provided through one routine, ansi::fmt:

ansi::fmt flags

It returns the corresponding ANSI escape sequence, suitable for emitting to the terminal through something like puts.

Supported flags:

  • -reset
  • -bold
  • -dim
  • -ul
  • -fg color
  • -bg color

Only the 8 base colors are supported at this time.

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white

File System Extras

read_file

The read_file procedure reads the contents of a file.

Verification Keys

The builds provided through this site are each signed in multiple ways, to allow verification with tools likely available on a range of systems.

Minisign

Minisign is the preferred way to verify the images, when it is available. Builds are signed with the following public key:

untrusted comment: minisign public key 6ADB517907FA86AF RWSvhvoHeVHbapen49u0kkwULUmzn9lIcWxvCu8z1GPssplSl/blkllw

It can be downloaded from tclbuild.minisign.pub. Signatures are in .minisig files accompanying each build.

Signify

The builds are also signed with OpenBSD's signify. Builds are signed with the following public key:

untrusted comment: tclbuild public key RWTjUTer6drtllIxvU7oBvAp1hZd0uxdBeoxBDMxdPPRpBNJMm8PSOSv

It can be downloaded from tclbuild.signify.pub. Signatures are in .sig files accompanying each build.

OpenSSL

Finally, the builds are signed with OpenSSL with the following RSA key:

-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu4EeOYc3eK6z8TMvFVcV pGZqRdaWopkvuQdlnRdMibecZWmwuT+IOebKT8iYPJFG8uZUQhzatpEE/iMcD0Ha gRemnPyTUe640EMFS1p10Pe6CR//IV0T+2E7NG+PpHygvD+OeH3Htfo96wmE8pg+ wxKZH4JfS3HboVlfFWuumQH+cdGw23YtBuJ1A2fXMN5lFz13aPWpK00YqN0J2TjX BZhJDbrk4gBQe2ijSsHkfOAu4Mi1tI++dgW8sinilXXER75RyXIwyI6OuK+oACDw gStC6/9KIs1bR6M+1UkSYL6xh078XPiYaB1UKyn/ft3769Ue4KkzEkh67umM7MJm iQIDAQAB -----END PUBLIC KEY-----

It can be downloaded from tclbuild.openssl.pub. Signatures are in .rsasig files accompanying each build.

Jim Tcl (default configuration)

These are builds of Jim Tcl in its default configuration.

macOS

Linux

Windows

License

Jim is provided under a 2-clause BSD license, and binary builds are distributed here in accordance with its terms:

Jim - A small embeddable Tcl interpreter

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE JIM TCL PROJECT ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JIM TCL PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the Jim Tcl Project.

Jim Tcl (default configuration)

These are builds of Jim Tcl using a custom configuration that only contains the extensions I need for my shell environment configurations.

macOS

Linux

Windows

License

Jim is provided under a 2-clause BSD license, and binary builds are distributed here in accordance with its terms:

Jim - A small embeddable Tcl interpreter

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE JIM TCL PROJECT ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JIM TCL PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the Jim Tcl Project.