News for hackers. Stuff that matters.
Re:Happy 25th Tcl by kingmanaz on Thursday January 16, 2014 @08:46AM (#7069311)
Tcl is pragmatic. I still use it for one-off projects with simple GUIs via Tk. I get grief from co-workers for the language, but my projects are typically done and correctly functioning in a fraction of the time it takes our Java and C# devs to even prototype a utility.

Below is a walkthrough of Tk which compares identical implementations of examples in Pearl, Ruby, Python, and Tcl. See if you can spot which of the scripting languages are more concise. Hell, I'd even call Tcl more readable in most of the cases:

http://www.tkdocs.com/tutorial/

Re:Happy 25th Tcl by draegtun on Thursday January 16, 2014 @11:33AM (#7070349)
Tk was very handy for whipping up GUI apps. However those comparison examples written in Perl (not Pearl!), Ruby & Python could be improved to look (at least a little!) better.

For a completely different comparison (non Tk) here is the first example (http://www.tkdocs.com/tutorial/firstexample.html) written in Rebol:

  Rebol []
 
  convert-to-metres: func [in-feet] [
      (round 0.3048 * in-feet * 10000.0) / 10000.0
  ]
 
  default-feet: 1
 
  my-window: layout [
      style input-feet field 80 left
      style label      lab   90 left
      tabs [140 230]
      across
 
      tab feet: input-feet (to-string default-feet)
      tab label "feet"
      return
 
      text "is equivalent to"
      tab in-metres: text (to-string convert-to-metres default-feet)
      tab label "metres"
      return
 
      tabs 230
      tab button "calculate" [
          in-metres/text: to-string convert-to-metres to-decimal feet/text
          show in-metres
      ]   
  ]   
 
  view/title my-window "Feet to Metres"
The above is written in the Visual Interface Dialect of Rebol 2. I made it look visually identical to the example provided however this was the first time I've ever written any VID code so I'm sure it can be improved upon :)