News for hackers. Stuff that matters.
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 :)

There are no comments on this comment yet.