Regular expression code implementation review between Tcl vs Python

Helmut Giese hgiese at ratiosoft.com
Tue Nov 11 11:39:32 EST 2003


On 11 Nov 2003 07:58:14 -0800, Google_Post at slink-software.com (K_Lee)
wrote:

>I documented the regex internal implementation code for both Tcl and Python.
>
>As much as I like Tcl, I like Python's code much more.  
>Tcl's Stub interface to the external commands is confusing to 
>outsider.   I still don't get why the stub interface is needed.
Simple. Let's create an example.
 If you don't use it, than you have to link your extension against the
current version of Tcl, say, tcl84.lib. Easy, no problem.

But tomorrow Tcl 8.5 comes out and you have the problem, that
tcl85.dll is running (used by tclsh or wish) and your extension needs
tcl84.dll, since (during its linking) you created an un-breakable
connection between the two. 
Solutions:
- Stick with the older version of Tcl.
- Re-compile the extension now linking against Tcl85.lib (and repeat
for Tcl 8.6, 8.7, etc.)
- Don't link against Tcl8.x lib but use the 'stub interface'. This
avoids creating this fixed connection between your extension and a
particular version of Tcl, and you can use the extension with any
future version of Tcl and be happy ever after (unless the stub
interface itself changes, but this will be in a completely different
time frame- if it should ever happen at all).

>One aspect I don't understanding about python is that the Python
>language itself is object oriented and all the internal is implement
>as C object.   Why not C++ object?  
Just my 0.02: I suppose that C++ compilers still differ a lot more on
different platforms (concerning their conformance to the standard)
than C compilers do. So, if portability is high on your check list, C
still is the language of choice - but in the future C++ will catch up
(IMHO).
Best regards
Helmut Giese





More information about the Python-list mailing list