2 ms·
I found Tcl hard to write, read and debug. (But I'm quite impressed with some of Ousterhout's writing.) In contrast, Python is easy to read, write and debug.
by jll29 3y ago
I found Tcl hard to write, read and debug. (But I'm quite impressed with some of Ousterhout's writing.)
In contrast, Python is easy to read, write and debug.
I quite like the small footprint of Lua as an embedded script language, which is easy to read, write and runs relatively fast.
I'd probably use Lua or a Scheme as an embedded scripting language if I had the need (generally, I try to not let my programs get so big that the require embedded scripting, but instead attempt to create orthogonal CLI commands that do one thing well and that can be scripted from the outside via POSIX sh).
- giraffe_lady 3y agoEveryone likes lua but out of the box it's pretty poor for string manipulation, a particular strength of tcl. I don't consider them to have much overlap for that reason. Lua's match system is cool for what it is, and how small its implementation is. But it's really not powerful in the end and lua has almost no other string tools in the standard lib.
- synergy20 3y agolua has decent string lib in the stdlib, you can also use 3rd party libraries such as https://github.com/stein197/lua-string https://github.com/stein197/lua-string, I'm not familiar with tcl, can you elaborate why tcl is much better than lua in string manipulations?
- nick__m 3y agoIn tcl strings are first class citizens as everything in tcl is a basically a string.
- giraffe_lady 3y agoLua has a very minimal string library that doesn't include basic things like escaping and interpolation. It doesn't include regex. I understand the choices behind these decisions and don't disagree with them. But what it means is now you're not just embedding lua, you're embedding lua, vendoring extensions to the standard library, and selecting a regex implementation compatible with your expected runtime and distribution method. Tcl is built around string manipulation, it's the main and, for a long time, only data type. It has regex built in, a full set of string manipulation functions, and an interpolation primitive. It's not about what's better. They are both full blown programming languages and you can implement any behavior you care to. In lua you have to care to implement string functions if you're going to do anything complex with strings. Tcl comes with them. That's all.
- gnubison 3y agoAlthough Lua patterns are quite elegant and, in my opinion, more readable than normal regex. Despite having a small string library, Lua still works for many use cases.
- pfix 3y agoNot OP, but I think the reasoning behind that argument is: TCL has only one data type: string. Everything you do in TCL is reduced to string manipulations up to having optional function arguments starting with a - like a shell command. A string in TCL is like a list in Lisp, the most fundamental building block.