witch
takes a dictionary
of pattern-body pairs; how is this a new language? I'm also confused about the inclusion of string
- are all ensemble
s to be considered separate languages? The syntax for variables and namespaces used by set
and $, would also seem to be an essential part of the syntax of Tcl itself rather than being a separate little language. A syntax on its own doesn't make a language.Peter da Silva
: I don't think the lindex command index and other similar special cases really qualify as "languages" (and, really, some of them should be considered mistakes)AMG
, in a perverse mood: Maybe calling every command a separate "little language" is just a nice way of saying that their interfaces are inconsistent. Certainly I recognize that it's good we have little languages as opposed to the rigid structure imposed by a language like C
or (shudder) Java
, but that doesn't mean we should abuse this power to avoid worrying about making the standard library of commands self-consistent. (Yeah, yeah, I know the idiosyncrasies from command to command are usually driven by historical reasons, but I'm just trying to make a point.)
An alternative to little languages is sometimes to have a great many parameters for the programmer to set. Tcl/Tk features with that kind of interface include:
Some problems lend themselves towards one approach, some rather to the other. As a matter of Tcl Advocacy
it is however interesting to observe that most languages other than Tcl have a syntactical rigidity that makes it difficult to take the little language route.
Some little languages that are not part of the Tcl/Tk core are:
The term "little language" is also used in a book by Kernighan and Pike: The practice of programming. That is a book I quite enjoyed reading and it uses examples in Awk
for other little languages.
This begs the question of what the semantics of Tcl would be without any little languages, which implies being without any commands. To this end, tcl-null
discusses Tcl stripped of all commands, as a beautiful but useless language - the process of adding back a minimal subset of Tcl built-in commands is launched as a game for the obsessive.
See Also edit
- Little Languages, C2 wiki