Over the years I've found myself looking at Tcl, and wondering what the fuss was about. Then I came across one of John Ousterhout's articles in the Dr Dobb's Journal and as I read through it, I was suddenly enlightened. Tcl is actually a very smart little language.
I gladly accepted the challenge of writing my own interpreter for a Tcl-like language, and present the result here as Fiz (a name I just sucked out of my thumb). As it stands, Fiz is probably not very useful for production use, but it has some features that I like:
I must add the disclaimer that Fiz is probably very slow (I say probably because I did not bother to benchmark it).
All variables are strings, and performing arithmetic involves doing an
atoi() to convert the variable to an integer.
It also does a lot of
strdup() internally. I'll add that at the time of this writing (2010) computers are so fast that
I'm not bothered by it; there are other interpreters that fill the "fast and embeddable" niche.
I was also found and got inspiration from Salvatore Sanfilippo's Picol Tcl interpreter. His is very elegant - he got his interpreter down to about 550 lines of code. You may notice that I borrowed some ideas from him.
Update (14/01/2016): The source code is available on Github: https://github.com/wernsey/Fiz (and has actually been for some time).
The code is written in platform independent C, so you should be able to compile it by typing
make on the command prompt if
you're using Linux. It also works if you use MinGW on Windows.