Re:The Tcl War (1994)
by kevin_thibedeau on Sunday July 03, 2016 @12:31PM
(#12026574)
You don't have to treat everything as a string. I've written a Tcl interpreter in VHDL and it avoids the traditional pre 8.0 string interpretation. It parses everything into an AST and interprets that instead. This saves on the overhead of string processing mostly static code inside another interpreter that isn't optimal for such tasks.
>You don't have to treat everything as a string.
Oh, I agree with you on that. My point was that Tcl makes it especially easy to "cheat" and avoid building an AST. You may do this when you only care about writing an interpreter in few LOC, like the original version of Picol, quickly.
A Tcl interpreter in VHDL sounds interesting. Do you have a public repository for it?
Re:The Tcl War (1994)
by kevin_thibedeau on Monday July 04, 2016 @08:43PM
(#12033781)
I have it up on Github. It's 90% complete waiting for me to get some free time.
Tiny Tcl implementations are fun in general and perhaps easier to produce than tiny Scheme implementations — as long as you are willing to concede that everything really is a string. :-) (I.e., no caching binary representations; you have to parse from scratch each time.) In a similar vein as TH1 but with a little more functionality there are Picol (https://tcl.wiki/Picol) and LIL (http://runtimeterror.com/tech/lil/).
Disclosure: I maintain an expanded fork of Picol. The original version of it written by antirez was only ~550 LOC but with suchenwi's additions and mine it is now around 3100. There is a link to it on the wiki page. The change that I am most fond of is making it an stb-style (https://github.com/nothings/stb/) header library.