Hacker News new | past | comments | ask | show | jobs | submit login

Why doesn't anyone ever mention my favorite language, Tcl?

foreach line [read stdin] { foreach word [split $line] { if [string match *ing $word] { puts $word } } }




One reason is that people haven't looked at Tcl in a while and so they "already know" what Tcl brings to the table. There have been a lot of changes/additions to Tcl in the last couple years alone. It is a very nice and consistent...and to borrow from Ruby...FUN language to program in.

The one thing that gets me is the "it's already been done" mentality. If you love Tcl then you want to create things in Tcl for the world to use. I have thrown out a couple ideas like "mailman in Tcl" or "nagios in Tcl"...but I always get "it's already been done". Sure, I could have done it anyway, but it gets your spirit down when you hit that wall. I know they have been done with other languages. Let's do it in Tcl to see if it can be done better!


Yeah .. I have not faced this kind of wall until now but I get your point.

The whole scripting language issue is a complicated one imo.. People want to either use 100% scripting or 100% system (i.e., C), which is not alright. Combine scripting & system according to your needs. This is why I like Tcl the most: It prevents you from using it where there might be computational bottlenecks (e.g., in algorithms). It is meant to complement C, not replace it. Anyway this is a separate thread.


Your code sample isn't quite right.

[read stdin] returns a string (not a list of strings), which is parsed as a list when you try to loop over it. The parsing breaks the string into a list of words, so the second loop is redundant. The parsing could fail if the input file isn't valid list syntax (unmatching {}'s). [split _] makes it safe.

    foreach word [split [read stdin]] {
        if [string match *ing $word] { puts $word }}
I love Tcl too! Tcl is a scripting language for C, Python is less-powerful version of Lisp.


Yes you're right hehe. less powerful version of Lisp? that's weird but oh well ..




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: