Re: New list commands ... What do you think ?



MartinLemburg@UGS schrieb:
Hi Richard,

yes - sometimes its about overengineering.
That's the risk of every developer (re)writing basic commands.

Another point is, that I don't want to know how many times the wheel
was reinvented instead of reused!
To use the tcllib is IMHO only second best, if the needed functionality
is so fundamental and basic, that it should be provided by the core,
not by a thirdparty extension.
So if the TCT would decide: ok, tcllib is part of the core distribution,
we just install it, nothing would really change (other than one download
instead of two), but you were happy?

My first reply was to show how may commands could be needed and to
allow some discussion about some of them, that are really good for core
introduction, like:

lremove - deleting all pattern matching elements of a list
Try:
interp alias {} lremove {} lsearch -all -not -inline
set new [lremove $list $pattern]


Some other commands are so near to mathematics, especially to
statistics, that they could be collected e.g. in tcllib, which is
perhabs already done.
Probably, there are quite some math:: packages in Tcllib.

But there the questions is ... why not providing binary standard
extensions like already done with "dde" or "registry"? Why not a
"stat(istic)s" extension? Some of the tcllib extensions are very
runtime consuming and could be done more efficiencly in C using the tcl
C API.

(Yes, I know that e.g. md5 falls back to use the critcl variant of the
md5 package, which is very quick. But only if critcl is installed! Why
not providing time critical packages completely in C?)
This isn't true. Critcl builds a package which is loaded. You don't need
the critcl package to use it, just to build it.


For me the arguments for integrating more binary extensions, like e.g.
"dde", into the core tcl distribution (not ActiveTcl) are that:

* providing basic mathmatics (expr command) is not enough for many
applications, so everybody reinvents e.g. a new vector/matrix algebra
package. But statstics or vector/matrix algebra are IMHO basic
mathmatic areas too! That's a reason for me to wanting them not in the
core, but with the core.
* some of the mentioned areas of functionality
(vectors/matrices/statistics/...) needs intensive calculations and are
better done in C(++). Let those binary extensions provide a typical tcl
command interface and ship them as standard extensions with the tcl
core
Thats basically a policy problem.
1. Tcllib ships with pure Tcl code to be portable but explicitly allows
accelerator code, _if_ a pure Tcl version is provided. That prohibits
the lazy wrapping of code with swig etc. to enter the standard lib, like
it happens with PHP all the time (see how huge but crude their API is
often).
2. The bundling of more packages with the Tcl core would only fix the
mistakes of packagers which don't include Tcllib (including the built
accelerator packages) or other useful packages with their systems.

So what you propose is changing the core style from 'lean and mean' to
'fat and powerful' aka 'batteries included'. Won't happen. Could also
revive the package repository discussion in this context.

* critcl is for me not a solution in getting binary extensions from
within tcl. It makes the system more complex than needed and is
supports not all OS' and not our compiler/linker system to be used
(VC7.1/8.x).

What is a better and simpler cross platform solution for getting binary
extensions? TEA with the whole auto* toolchain?
You know that you could fix critcl to work with your compiler?

Michael
.



Relevant Pages

  • Re: New list commands ... What do you think ?
    ... there are some real candiates for including into the core. ... If new core commands breaks existing scripts, ... runtime consuming and could be done more efficiencly in C using the tcl ... For me the arguments for integrating more binary extensions, ...
    (comp.lang.tcl)
  • ANNOUNCE: TclRAL Version 0.9.0
    ... TclRAL is a "C" based extension to Tcl that makes available Tuple and Relation ... interfaces, adds new commands and discards much accumulated cruft. ... The project is hosted at Sourceforge and the TEA compliant source package is ...
    (comp.lang.tcl)
  • Re: Cant access TCLLib when TCL is embedded in my application
    ... TCL is embedded in my application as a "Macro" utility. ... set LibraryPath; ... package require math::statistics; ... > as do the commands I have written for it. ...
    (comp.lang.tcl)
  • Re: Tcl and .Net?
    ... package of Tcl or C code with some useful procs and ... you do [package require mypack]. ... It apparently offers some CLR interface. ... How does one construct Tcl commands to connect to an arbitrary example of such an interface? ...
    (comp.lang.tcl)
  • Re: Tcl and .Net?
    ... What commands would exist? ... package of Tcl or C code with some useful procs and ... you do [package require mypack]. ... It apparently offers some CLR interface. ...
    (comp.lang.tcl)