[NTLUG:Discuss] 30 minutes to Tcl as a scripting language presentation
David Good
david.good1 at gmail.com
Thu Apr 10 23:27:38 PDT 2025
BTW, I made a very , very simple trainer for the game Pushfight using
TCL/TK which you can check out here :
https://github.com/davidgood1/pushfight/tree/main
It's not the prettiest of GUIs , but it was just designed to help me
quickly decide what my next move should be :)
I also archived the TCL/TK program which first got me into TCL many years
ago . It's called Moni and was a simple serial port program that I could
program to automate some stuff at my work . At that time , all of the
serial port programs that I could find were either pricey closed source
applications , or not very extensible . Somehow , I found this one and
emailed the creator who cooked up a simple Send String plugin for me over a
weekend in response to some question I asked him . I was so impressed that
I started learning TCL . I'm forever grateful to Rolf Schroedter for his
generosity at a time when I was young and impressionable ;)
https://github.com/davidgood1/moni
--David
On Fri, Apr 11, 2025 at 1:16 AM David Good <david.good1 at gmail.com> wrote:
> I've been thinking about this and have come up with three things :
> 1 . Since the language is conceptually all strings , it is very easy to
> write code that writes code . You can write functions or simple loops who
> create specific function calls or UI buttons with their respective
> callbacks or whatever else you want . The language is naturally a
> templating language , and once you start to think that way , other
> languages will seem somewhat frustrating .
>
> 2 . The event loop is so simple and well built that creating a single
> threaded , non-blocking application is very easy to reason about and will
> have very good performance . There are basically only two event types
> (channel i/o and timers) , and everything else can be built off of those :
>
> 3 . Single file executables . These are called starkits , and come in two
> flavors : a platform specific executable or a platform independent .kit
> file . These make it super-easy to develop an application (or a script) and
> pass it around without having to worry if your target user has a TCL
> interpreter or even knows what TCL is .
>
> 4 (Bonus) . You can run TCL scripts unmodified from any python interpreter
> in a pinch ! Python Tkinter just binds TCL/Tk for making GUIs in Python ,
> but the whole interpreter is there for you to use as you see fit .
>
> import tkinter as tk
> tcl = tk.Tcl()
> tcl.eval('source myfile.tcl') # or whatever command you want to run here
>
> --David
>
>
>
>
> On Fri, Apr 4, 2025 at 6:35 PM Steve Litt <slitt at troubleshooters.com>
> wrote:
>
>> David Good said on Wed, 2 Apr 2025 22:05:55 -0500
>>
>> >I'm a huge TCL/TK fan . I use it all the time , for desktop
>> >applications as well as "scripting" applications (open this file ,
>> >edit such and such , copy files to the server , etc) .
>>
>> Cool! Could you please tell us what I left out of the following Tcl
>> philosophy document:
>>
>> https://troubleshooters.com/codecorn/tcl/philosophy.htm
>>
>> Also, Tcl is a very different kind of language from C, Python, Lua,
>> Ruby, Perl, or Java. Could you please let us know the mindset you adopt
>> when programming in Tcl?
>>
>> Thanks,
>>
>> SteveT
>>
>> Steve Litt
>>
>> http://444domains.com
>>
>>
>> _______________________________________________
>> http://www.ntlug.org/mailman/listinfo/discuss
>>
>
More information about the Discuss
mailing list