Re: what happen to tcl C api ?

Liste des GroupesRevenir à cl tcl 
Sujet : Re: what happen to tcl C api ?
De : user2544 (at) *nospam* newsgrouper.org.invalid (Martin (m0h))
Groupes : comp.lang.tcl
Date : 22. Feb 2025, 20:59:42
Autres entêtes
Message-ID : <1740254382-2544@newsgrouper.org>
References : 1
User-Agent : Newsgrouper/0.7.0

aotto1968 <aotto1968@t-online.de> posted:

 
what happened to the tcl "C" api?
 
i remember that about 20 years ago, when i wrote the tcl-c compiler, the language "tcl" was the language with one of the best
"c" api support. back then, not only the "public" documented c api could be used but also the semi-public api where every tcl
command was accessible with "tcl_?Cmd?ObjCmd" (e.g. Tcl_IncrObjCmd for "incr").
 
today almost the entire tcl api is "private" and therefore unusable for the extension writer. This means that a simple command
like "incr" which already has a "C" API in Tcl can only be called via Tcl-EvalXX OR has to be laboriously reconstructed from the
Tcl source code using "copy-past". The reason for the (make everything private mode) seems to be the "stubs" subsystem where
every API function has to be exported using Tcl's internal "table")
 
Here are some numbers
1) is a version of "incr" that works using the "limited public tcl-c-api "Tcl_ObjGetVar/SetVar" etc
2) is a version that works using "Tcl_Eval"
 
=> even WITHOUT the direct use of "Tcl_IncrObjCmd" the "handwritten" solution is better than the Tcl_Eval solution. I rate the
NON-exported Tcl_IncrObjCmd solution as MUCH better than my "hand-written" solution.
 
=> and now the summary: Question: Why did the TCL community "throw away" TCL's massive technological lead just to become one of
the slowest languages ​​ever?
 
Hello Andreas,

could you go into detail about how you achieved access to Tcl_ObjGetVar, Tcl_ObjSetVar, and so on from you code via MOX_? I'm curious about this because I wouldn't know how to really do this myself.

At an abstract level, my first thought would be that if Tcl_IncrObjCmd is an exported function the implementation has to be in a different file. However, it doesn't seem obvious to me why you wouldn't be able to link to that other file with the compiler.


With best regards,

Martin (m0h)

Date Sujet#  Auteur
19 Jan 25 * what happen to tcl C api ?3aotto1968
19 Jan 25 +- Re: what happen to tcl C api ?1aotto1968
22 Feb 25 `- Re: what happen to tcl C api ?1Martin (m0h)

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal