
Beauty of Tcl/Tk in one tweet - alexkarta
https://twitter.com/ankovcom/status/1272053135264100354
======
draegtun
I prefer Rebol or Red VID dialect.

Here's the same code in Red VID...

    
    
        Red []
    
        view compose [
            text (rejoin [{The sum of } figs: [1 2 3 4] { is: }])
            answer: text {}
            return
            button "Push me to calculate" on-click [answer/text: to-string sum figs]
        ]

~~~
pkphilip
Been looking at Red and Rebol for a long time but unfortunately they can't get
this to work in Linux (the last time I tried it)

~~~
draegtun
@9214 pointed you to Linux GTK builds of Red. My example was tested in macOS
so haven't tried it on Linux but you'll need GTK & 32bit compatibility
libraries installed for it to work.

Rebol/View as always worked on Linux though you will also need 32bit compat +
Freetype libraries -
[https://stackoverflow.com/questions/34524169/rebol-2-stopped...](https://stackoverflow.com/questions/34524169/rebol-2-stopped-
working-after-upgrading-to-ubuntu-15-10)

And there's a 64-bit Rebol 3 with R3-GUI from Atronix, which should only need
Freetype library installed -
[https://www.atronixengineering.com/downloads](https://www.atronixengineering.com/downloads)

The VID has changed a little bit over time. Here's the example in Rebol2
View...

    
    
        Rebol []
    
        view layout compose [
            across
            text (rejoin [{The sum of } figs: [1 2 3 4] { is: }])
            answer: text {......}
            return
            button "Push me to calculate" 200x20 [
                answer/text: to-string sum figs
                show answer
            ]   
        ] 
    

And here it is in Rebol 3 / R3-GUI...

    
    
        load-gui
    
        view compose [
            hgroup [
                text (rejoin [{The sum of } figs: [1 2 3 4] { is: }])
                answer: text {......}
                return
                button "Push me to calculate" on-click [
                    set-face answer to-string sum figs
                ]
            ]
        ]
    

Both scripts above worked fine on my Ubuntu 18 Linux.

NB. Rebol doesn't come with a SUM function so here's one defined...

    
    
        sum: func [s /local total] [
            total: 0
            forall s [total: total + s/1]
            total
        ]

------
ruslan
TclTk is extremely cryptic. I used to code IVR scripts for Cisco access
servers in early 20th, most of them still in use today. A couple of
unsuccessful attempts were made to customize them by other people, but nobody
(including me myself) knows how do they work. The art had been lost forever.

~~~
alexkarta
In comparison to many popular languages (e.g., Python, Java), to success with
Tcl (not only about Tcl), one needs to be a real fan, because it's not about
engineering, it's about passion and art

------
Matheus28
Perhaps proof that beauty is subjective

------
desiderantes
Beauty is in the eye of the beholder. Sadly, OP was hallucinating with this
tweet.

