7 ms·
Tcl is awesome.
by meeper16 11y ago
Tcl is awesome.
- tonyjstark 11y agocan you elaborate? I always wonder if I should learn it, how it would make me think in new ways and how I would use it. Tcl looks strange and that makes it very interesting for me so how do you use it and why do you use Tcl for it?
- meeper16 11y agoI do a lot of text mining and it's one of the most efficient languages I've used over the years for doing things like this.
- a8da6b0c91d 11y agoThat's an unusual assertion. Perl has much better facilities for working with unicode, and many other advanced facilities for parsing and so forth.
- bch 11y ago> Perl has much better facilities for working with unicode Which facilities are those ? > many other advanced facilities for parsing Be curious to hear what those are, but note that Tcl is hilariously simple to extend and build up custom constructs to suit ones needs.
- eviltwinskippy 11y agoNot to mention that Tcl has Unicode in the core, has had Unicode in the core for at least 8 years, and the long and short is that EVERY string operation is Unicode aware. You can have unicode procedure names, if that was your fancy.
- bch 11y ago...right, which is why I was wondering where Perl's support is superior. Tcl's support isn't perfect nor complete, but it's still pretty impressive.
- wrenky 11y agoI would like to see what advanced facilities perl has for text parsing that TCL doesn't!
- kbenson 11y agoMe too, but I suspect it might take someone of tchrist's level with experience in both languages to give a good answer. I would be interested in how TCL handles the issues tchirst has to deal with outlined in his famous SO post[1]. Note: If you read that post and think, "Wow, Perl requires a lot of setup for unicode and TCP doesn't require nearly as much" without understanding the specifics of why each step is there, and how TCL handles the same issue, you are likely underthinking the issue. 1: http://stackoverflow.com/questions/6162484/why-does-modern-perl-avoid-utf-8-by-default http://stackoverflow.com/questions/6162484/why-does-modern-p...
- _pmf_ 11y agoIt offers the syntactic freedom of Lisp/Scheme without the parentheses.
- _ph_ 11y agoThe top level of parenthesis-es is left out, the other levels replaced by brackets :). But joking aside, I greatly enjoy both Lisp and Tcl as languages.
- a8da6b0c91d 11y agoA huge, seriously annoying problem with TCL is lack of deterministic cleanup for resources. If you don't manually close a filehandle, for example, it will leak. Doing this sort of bookkeeping in 2015 is infuriating.
- sebcat 11y agoproc with {file as name block} { uplevel 1 [list set $name $file] uplevel 1 [list eval $block] uplevel 1 [list close $file] } with [open foo.txt w] as file { puts $file "Hello, World!" } I'm sure it's possible to do it in a cleaner way without [set], but my Tcl is a bit rusty.
- a8da6b0c91d 11y agoStill leaks on an exception. That's also an annoying construct to be forced to use.
- nilkn 11y agoYou could easily wrap the middle uplevel in a catch block to handle exceptions, and this sort of "with" construct is pretty common in a lot of very popular languages today. While it would be nice if this were baked into the language, it's pretty astonishing how extensible Tcl is without even having to touch the realm of C extensions.
- reacweb 11y agoTCL/TK is incredibly powerful to put a GUI in front of a bunch of scripts. You can easily bind a regexp in a log file to events that update widgets. I wish I had learned it 20 years ago.
- ash 11y agoCould you give an example of that?
- mdaniel 11y agoIf by "that" you mean an example of a GUI on top of scripts, the `git gui` and `gitk` that ship with git are in Tcl/Tk and shell out to the git commands that do the work As others have mentioned, they are very, very not "native UI" friendly - OSX is an especially bad instance - but they do run on all of Git's platforms without a 20MB runtime to go along with them. If Tk's widgets were just a little less harsh, those two would absolutely be my go-to graphical git clients.
- stevekemp 11y agoThis is a great introduction, by antirez of redis-fame. http://antirez.com/articoli/tclmisunderstood.html http://antirez.com/articoli/tclmisunderstood.html
- msravi 11y agoTcl is also the de-facto default language for almost all VLSI tools
- wainstead 11y agoThis post occasionally makes the rounds and is an enlightening read: http://antirez.com/articoli/tclmisunderstood.html http://antirez.com/articoli/tclmisunderstood.html
- wrenky 11y agoWe use TCL for almost everything that isn't C/C++, its insanely flexible. You can completely redefine the syntax if you want as there are NO keywords. Meta programming is easy, as all TCL commands follow the same format- Its only con is the lack of widespread use, so sometimes you'll have to write your own packages. Dont worry to much though, the syntax grows on you :)
- sigzero 11y agoYup, I whip up little one off utilities all the time with Tcl/Tk.