3 ms·
> best thing about TCL is easy syntax and that everything is a string :) What? That's the worst thing about TCL.
by IshKebab 9mo ago
> best thing about TCL is easy syntax and that everything is a string :)
What? That's the worst thing about TCL.
- iberator 9mo agoI love it. Living proof that languages doesn't need forced types. Data is Data. It's kinda object programming as visioned in the 70". So easy and trivial language.
- IshKebab 9mo ago> Living proof that languages doesn't need forced types. The opposite surely? TCL is practically dead, and only lingers on in the EDA industry (which has zero taste). Virtually every successful language today has at least a few different basic types for numbers, arrays, strings, maps and so on.
- bmacho 9mo agoTcl has these types as well. They are special strings. Number: string of digits. List: strings separated by space. Dictionary: key value pairs in a list.
- IshKebab 9mo agoNo they aren't. Everything is a string. The runtime does some optimisation where it actually does use different types under the hood but they don't change the semantics. If you try to pass a list into a function expecting a string it will just treat the list as a string. No type error or anything, not even at runtime. CMake is the same. Terrible design. Real types are useful.
- deleted 9mo ago[deleted]
- ux266478 9mo agoTCL's typicing discipline comes from shell languages and awk, which are decidedly not dead. The overwhelming majority of programmers have less than no taste, so language usage rates in general don't really mean much.
- isr 9mo agoWell, if you use flightaware to track flights, you're using tcl. The vast majority of their codebase is in tcl.
- zwischenzug 9mo agoIf you place a sports bet online, odds (!) are that it will run through tcl in its business logic. I may even have written some of it.
- bmacho 9mo agoIt's only the interface that is of a string. An array is a list of strings with space between, but only for the programmer. The runtime is free to use an actual array.
- IshKebab 9mo agoI'm aware. It's awful because of the implications for the programmer, not the runtime.
- antirez 9mo agoIt depends on the use case. For instance you open a socket, write there any value you have without serialization, read it in the other side, data transfer done.
- petcat 9mo agoThe convenience of not having to marshal data over a network is certainly a use case. But I'll admit that two of the worst programs I ever saw were written in Perl and TCL. Somehow just a big jumble of inscrutable regexes. When "everything is a string" then you have no choice but to literally treat everything as a string. Painful. Very cool project though.
- graemep 9mo agoThat sounds more like someone who over-uses regexes - the developer is the problem, not the language TCL has a lot of options for manipulating strings - take a look at just the built in string command for a start: https://www.tcl-lang.org/man/tcl8.4/TclCmd/string.htm https://www.tcl-lang.org/man/tcl8.4/TclCmd/string.htm I have seen terrible code in Python, C, and more.
- Treblemaker 9mo agoThe objections to tcl I see most often seem to reflect an outdated or incomplete understanding of the language and its capabilities. As with many interpreted languages, maybe it's just too easy to iterate interactively with code until it "just works", rather than taking the time to design the code before writing it, leading to perception that it is a "write-only" language. However, despite its reputation, even Perl can be written in a way that is human-readable. I agree with you that it is more a reflection of the programmer or the work environment than of the language itself.
- Treblemaker 9mo ago> When "everything is a string" then you have no choice but to literally treat everything as a string. As someone who has been developing tcl almost daily for more than 30 years, both object oriented and imperative code, I have not found it necessary to think this way. Can you explain what leads you to this conclusion?