Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Announce: tclmain 0.1 released

130 views
Skip to first unread message

D Groth

unread,
Jan 28, 2023, 12:43:22 PM1/28/23
to
tclmain is a single Tcl file which supports running of Tcl applications directly from the package directory without the need to install them in a folder belonging to the users PATH variable.

Homepage: https://github.com/mittelmark/tclmain
Wikipage for discussion: https://wiki.tcl-lang.org/page/tclmain

The program tclmain provides the same feature as Python with its syntax `python -m modulename` does. tclmain looks in the package folder for files ending with `_main.tcl` or `_doc.tcl` etc. You can execute this files then with the following syntax:

tclmain -m pkgname main

Instead of -m as well -p is supported.

If the package does not provide these files the user can place such files as well in its config folder ~/.config/tclmain` on a Unix system.

The advantage in comparison is that there is a unified interface for running tcl application for the user. The developer does not need anymore an installation of the applications in the users PATH, just installing the package is enough.

For more information and examples look at the homepage and at the Wiki page.

Best regards,
Detlef

Luc

unread,
Jan 28, 2023, 3:13:21 PM1/28/23
to
I really like this idea. Thanks.

--
Luc
>>
**************************

D Groth

unread,
Jan 30, 2023, 1:45:20 AM1/30/23
to
Thanks.

Indeed, the more I code in Python the more I miss this approach in Tcl, but now it's there. The tclsh should support this out-of-the-box `tclsh -m packagename`.
May be the files should be named as well pkgMain.tcl pkgHelp.tcl pkgDemo.tcl and so on instead of the underline files. This would as well follow more the Tcl conventions. But that should be easy to implement.

BTW: I just started tclinstall in the same project which allows you to install Tcl packages using setup.tcl files like this:

`tclmain -m tclinstall setup.tcl`

Support for just copy the package folder completly will be added as well.

https://github.com/mittelmark/tclmain/tree/main/lib/tclinstall - WIP

Detlef

D Groth

unread,
Sep 30, 2023, 12:21:49 PM9/30/23
to
Dear all,

The goal of tclmain is to provide Tcl applications as part of a package without the need to install the applications in separate folder like bin. The syntax is `tclmain -p pkgname args ...` to call a function `pkgname::main argv`.

I updated to version 0.2.0 which provides support for `pkgname::main argv` procedure as entry points in addtion to pkgname_main.tcl etc files.

See the README for details.

https://github.com/mittelmark/tclmain

Detlef

D Groth

unread,
Oct 1, 2023, 6:53:56 AM10/1/23
to
Here I provide some background information about the tclmain approach, the motivation and two ways to implement it for package developers:

https://htmlpreview.github.io/?https://raw.githubusercontent.com/mittelmark/tclmain/master/doc/tclmain.html

I think Tcl is really missing this pythonic like approach of calling package derived applications without trouble.

Detlef
0 new messages