3 ms·
The parser's behavior is not specified except in the implementation, which is messy C. I was once loosely involved in a project that tried to reimplement it, wh
by gnachman 14y ago
The parser's behavior is not specified except in the implementation, which is messy C. I was once loosely involved in a project that tried to reimplement it, which turns out to be extremely difficult, and was laughed at by Brent Welch. Indeed, it failed on countless edge cases. lex and yacc (or whatever) at least isolate this part of the language, making it much easier to have more than one implementation.
- asnarb 14y agoTcl's syntax is completely specified in the man page: http://www.tcl.tk/man/tcl8.5/TclCmd/Tcl.htm http://www.tcl.tk/man/tcl8.5/TclCmd/Tcl.htm (well, nearly completely -- there are couple of minor details left out -- but the man page is complete enough to fully understand the syntax. More people should read it.) Messy C? Most people who've worked on it seem to think it's rather clean. (Not the bytecode compiler though -- that is indeed a mess. But most of the implementation is solid, readable code.)
- schlenk 14y agoTcl's C implementation is far from messy. Its actually one of the best commented C based language code bases i have ever seen. But your project was doomed by false assumptions. (oh, and Tcl has more than one implementation, e.g. there is a version based on Parrot for example, http://code.google.com/p/partcl/ http://code.google.com/p/partcl/ or the JACL interpreter based on the JVM).