Check-in [4ddb2570c5]

Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:New TIP: Externalize libtommath
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4ddb2570c5ca1744cd6d5b83b11300a9fd5ecc287d5029bbcdb9431ae15e861b
User & Date: jan.nijtmans 2019-04-10 19:52:18.635
Context
2019-04-11
12:29
Clarify variable in TIP 536 per comment by aku check-in: 78ebdca682 user: kevin_walzer tags: trunk
2019-04-10
19:52
New TIP: Externalize libtommath check-in: 4ddb2570c5 user: jan.nijtmans tags: trunk
2019-04-08
17:05
Add example of how Tcl_CreateInterpWithStubs is used for TIP 531. check-in: 45ac09482b user: resuna tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to index.json.
1

2
3
4
5
6
7
8
{"tip": {

	"537":{"url":"./tip/537.md","keywords":"Tcl","created":"7-April-2019","post-history":"","state":"Draft","tcl-branch":"regexp-api-64bit","tcl-version":"9.0","vote":"","type":"Project","title":"# TIP 537: Enable 64-bit indexes in regexp matching","author":["Jan Nijtmans <[email protected]>"],"is-jest":false},
	"536":{"url":"./tip/536.md","keywords":"Tk","created":"29-March-2019","post-history":"","state":"Draft","tk-branch":"mac_services","tcl-version":"8.6","vote":"","type":"Project","title":"# TIP 536: Improvements to Mac-specific IPC in Tk","author":["Kevin Walzer <[email protected]>"],"is-jest":false},
	"535":{"url":"./tip/535.md","keywords":"Tcl","created":"10-March-2019","post-history":"","state":"Final","tcl-branch":"scale-tick-format","tcl-version":"8.6","vote":"Done","type":"Project","title":"# TIP 535: Remove trailing zeroes in scale ticks","author":["Francois Vogel <[email protected]>"],"is-jest":false},
	"534":{"url":"./tip/534.md","keywords":"Tcl","created":"02-March-2019","post-history":"","state":"Draft","tcl-branch":"dkf-experimental-fast-number-hash","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 534: Faster Hashing of Small Integers","author":["Donal K. Fellows <[email protected]>"],"is-jest":false},
	"533":{"url":"./tip/533.md","keywords":"Tk, menubutton","":"","[menu man page](https":"//www.tcl.tk/man/tcl/TkCmd/menu.htm).","state":"Final","type":"Project","tk-branch":"bug-70e531918e","author":["Marc Culler"],"three arguments":"two coordinates and an index.  That function uses the","[70e531918e](https":"//core.tcl-lang.org/tk/tktview/70e531918e6d99cbdd8b527386fec15872c64216).","created":"13-Jan-2019","by calling <b>":":tk::PostOverPoint</b> which, like the proposed extension, accepts","a method <b>[nsmenu popupmenupositioningitem":"atLocation:inView]</b> which draws the","title":"# TIP 533: Extension of the menu post command.","the [bug-70e531918e](https":"//core.tcl-lang.org/tk/timeline?r=bug-70e531918e)","post-history":"","vote":"Done","tcl-version":"8.6","is-jest":false},
	"532":{"url":"./tip/532.md","moreover the following issues have been solved":"","keywords":"Tk, bind, event, event loop","":"","[generic/tkbind.c](http":"//core.tcl.tk/tk/artifact/e41f45f7f6ac3447?ln=3287-3307).","this has been observed in applications [scid](http":"//scid.sourceforge.net), and","state":"Draft","branch [bug6e8afe516d-87](https":"//core.tcl-lang.org/tk/timeline?r=bug6e8afe516d-87)","type":"Project","tk-branch":"bug6e8afe516d","issue (1)":"Legacy implementation is computing the time difference of nth click with first click,","says (<code>man bind</code>)":"","author":["Gregor Cramer <[email protected]>"],"(same with applications [scid](http":"//scid.sourceforge.net), and","[bind-33.13](https":"//core.tcl-lang.org/tk/artifact/6377cb0d762b7261?ln=6550-6566).","5. legacy implementation cannot handle homogeneous equal sequences properly, see this script":"","branch [bug6e8afe516d](https":"//core.tcl-lang.org/tk/timeline?r=bug6e8afe516d)","2. immediately after startup of application [scidb](http":"//scidb.sourceforge.net)","[bug6e8afe516d](https":"//core.tcl-lang.org/tk/timeline?r=bug6e8afe516d)","created":"09-Jan-2019","manual (<code>man bind</code>) says":"","[bind-32.2](https":"//core.tcl-lang.org/tk/artifact/6377cb0d762b7261?ln=6123-6143)).","title":"# TIP 532: Re-implementation of event loop processing.","how to choose the most specific binding, has to be changed":"","4. see following code":"","can be expressed in a different way":"","[bind-32.4](https":"//core.tcl-lang.org/tk/artifact/6377cb0d762b7261?ln=6158-6171).","this problem occurs often in application [scidb](http":"//scidb.sourceforge.net),","post-history":"","[bind-32.6](https":"//core.tcl-lang.org/tk/artifact/6377cb0d762b7261?ln=6172-6191).","vote":"Pending","tcl-version":"8.6 and 8.7","[severe bugs in binding (tkbind.c)](https":"//core.tcl-lang.org/tk/tktview/6e8afe516df85f6213f436ef7c2fab2ec2d11c76).","[scid vs pc](http":"//scidvspc.sourceforge.net).","the following problems, caused by event ring overflow, have been solved":"","is-jest":false},
	"531":{"url":"./tip/531.md","keywords":"Tcl, stubs","":"","state":"Draft","type":"Project","author":["Shannon Noe <[email protected]>"],"created":"14-Dec-2018","title":"# TIP 531: Static Tcl Interpreter Creation Function","post-history":"","vote":"Pending","tcl-version":"8.7","tcl-branch":"tip-531","/usr/local/include/tcl8.6/tcldecls.h":"#define Tcl_CreateInterp \\","is-jest":false},

>







1
2
3
4
5
6
7
8
9
{"tip": {
	"538":{"url":"./tip/538.md","keywords":"Tcl","created":"9-April-2019","post-history":"","state":"Draft","tcl-branch":"digit-bit-60","tcl-version":"8.7","vote":"","type":"Project","title":"# TIP 538: Externalize libtommath","author":["Jan Nijtmans <[email protected]>"],"is-jest":false},
	"537":{"url":"./tip/537.md","keywords":"Tcl","created":"7-April-2019","post-history":"","state":"Draft","tcl-branch":"regexp-api-64bit","tcl-version":"9.0","vote":"","type":"Project","title":"# TIP 537: Enable 64-bit indexes in regexp matching","author":["Jan Nijtmans <[email protected]>"],"is-jest":false},
	"536":{"url":"./tip/536.md","keywords":"Tk","created":"29-March-2019","post-history":"","state":"Draft","tk-branch":"mac_services","tcl-version":"8.6","vote":"","type":"Project","title":"# TIP 536: Improvements to Mac-specific IPC in Tk","author":["Kevin Walzer <[email protected]>"],"is-jest":false},
	"535":{"url":"./tip/535.md","keywords":"Tcl","created":"10-March-2019","post-history":"","state":"Final","tcl-branch":"scale-tick-format","tcl-version":"8.6","vote":"Done","type":"Project","title":"# TIP 535: Remove trailing zeroes in scale ticks","author":["Francois Vogel <[email protected]>"],"is-jest":false},
	"534":{"url":"./tip/534.md","keywords":"Tcl","created":"02-March-2019","post-history":"","state":"Draft","tcl-branch":"dkf-experimental-fast-number-hash","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 534: Faster Hashing of Small Integers","author":["Donal K. Fellows <[email protected]>"],"is-jest":false},
	"533":{"url":"./tip/533.md","keywords":"Tk, menubutton","":"","[menu man page](https":"//www.tcl.tk/man/tcl/TkCmd/menu.htm).","state":"Final","type":"Project","tk-branch":"bug-70e531918e","author":["Marc Culler"],"three arguments":"two coordinates and an index.  That function uses the","[70e531918e](https":"//core.tcl-lang.org/tk/tktview/70e531918e6d99cbdd8b527386fec15872c64216).","created":"13-Jan-2019","by calling <b>":":tk::PostOverPoint</b> which, like the proposed extension, accepts","a method <b>[nsmenu popupmenupositioningitem":"atLocation:inView]</b> which draws the","title":"# TIP 533: Extension of the menu post command.","the [bug-70e531918e](https":"//core.tcl-lang.org/tk/timeline?r=bug-70e531918e)","post-history":"","vote":"Done","tcl-version":"8.6","is-jest":false},
	"532":{"url":"./tip/532.md","moreover the following issues have been solved":"","keywords":"Tk, bind, event, event loop","":"","[generic/tkbind.c](http":"//core.tcl.tk/tk/artifact/e41f45f7f6ac3447?ln=3287-3307).","this has been observed in applications [scid](http":"//scid.sourceforge.net), and","state":"Draft","branch [bug6e8afe516d-87](https":"//core.tcl-lang.org/tk/timeline?r=bug6e8afe516d-87)","type":"Project","tk-branch":"bug6e8afe516d","issue (1)":"Legacy implementation is computing the time difference of nth click with first click,","says (<code>man bind</code>)":"","author":["Gregor Cramer <[email protected]>"],"(same with applications [scid](http":"//scid.sourceforge.net), and","[bind-33.13](https":"//core.tcl-lang.org/tk/artifact/6377cb0d762b7261?ln=6550-6566).","5. legacy implementation cannot handle homogeneous equal sequences properly, see this script":"","branch [bug6e8afe516d](https":"//core.tcl-lang.org/tk/timeline?r=bug6e8afe516d)","2. immediately after startup of application [scidb](http":"//scidb.sourceforge.net)","[bug6e8afe516d](https":"//core.tcl-lang.org/tk/timeline?r=bug6e8afe516d)","created":"09-Jan-2019","manual (<code>man bind</code>) says":"","[bind-32.2](https":"//core.tcl-lang.org/tk/artifact/6377cb0d762b7261?ln=6123-6143)).","title":"# TIP 532: Re-implementation of event loop processing.","how to choose the most specific binding, has to be changed":"","4. see following code":"","can be expressed in a different way":"","[bind-32.4](https":"//core.tcl-lang.org/tk/artifact/6377cb0d762b7261?ln=6158-6171).","this problem occurs often in application [scidb](http":"//scidb.sourceforge.net),","post-history":"","[bind-32.6](https":"//core.tcl-lang.org/tk/artifact/6377cb0d762b7261?ln=6172-6191).","vote":"Pending","tcl-version":"8.6 and 8.7","[severe bugs in binding (tkbind.c)](https":"//core.tcl-lang.org/tk/tktview/6e8afe516df85f6213f436ef7c2fab2ec2d11c76).","[scid vs pc](http":"//scidvspc.sourceforge.net).","the following problems, caused by event ring overflow, have been solved":"","is-jest":false},
	"531":{"url":"./tip/531.md","keywords":"Tcl, stubs","":"","state":"Draft","type":"Project","author":["Shannon Noe <[email protected]>"],"created":"14-Dec-2018","title":"# TIP 531: Static Tcl Interpreter Creation Function","post-history":"","vote":"Pending","tcl-version":"8.7","tcl-branch":"tip-531","/usr/local/include/tcl8.6/tcldecls.h":"#define Tcl_CreateInterp \\","is-jest":false},
534
535
536
537
538
539
540
541
542
	"5":{"url":"./tip/5.md","created":"17-Oct-2000","post-history":"","state":"Final","vote":"Done","tcl-version":"8.4","type":"Project","title":"# TIP 5: Make TkClassProcs and TkSetClassProcs Public and Extensible","author":["Eric Melski <[email protected]>"],"is-jest":false},
	"4":{"url":"./tip/4.md","created":"26-Oct-2000","post-history":"","state":"Draft","vote":"Pending","type":"Informative","title":"# TIP 4: Tcl Release and Distribution Philosophy","discussions-to":"news:comp.lang.tcl","author":["Brent Welch <[email protected]>","Donal K. Fellows <[email protected]>","Larry W. Virden <[email protected]>","Larry W. Virden <[email protected]>"],"is-jest":false},
	"3":{"url":"./tip/3.md","created":"14-Sep-2000","post-history":"","state":"Accepted","vote":"Done","type":"Process","title":"# TIP 3: TIP Format","author":["Andreas Kupries <[email protected]>","Donal K. Fellows <[email protected]>"],"is-jest":false},
	"2":{"url":"./tip/2.md","created":"12-Sep-2000","post-history":"","state":"Draft","vote":"Pending","type":"Process","title":"# TIP 2: TIP Guidelines","author":["Andreas Kupries <[email protected]>","Donal K. Fellows <[email protected]>","Don Porter <[email protected]>","Mo DeJong <[email protected]>","Larry W. Virden <[email protected]>","Kevin Kenny <[email protected]>"],"is-jest":false},
	"1":{"url":"./tip/1.md","created":"14-Sep-2000","post-history":"","state":"Active","vote":"No voting","type":"Informational","title":"# TIP 1: TIP Index","author":["TIP Editor <[email protected]>"],"is-jest":false},
	"0":{"url":"./tip/0.md","created":"11-Dec-2000","post-history":"","state":"Final","vote":"Done","type":"Process","title":"# TIP 0: Tcl Core Team Basic Rules","author":["John Ousterhout <[email protected]>"],"is-jest":false},
	"@min": 0,
	"@max": 537
}, "@timestamp": 1554652566}







|
|
535
536
537
538
539
540
541
542
543
	"5":{"url":"./tip/5.md","created":"17-Oct-2000","post-history":"","state":"Final","vote":"Done","tcl-version":"8.4","type":"Project","title":"# TIP 5: Make TkClassProcs and TkSetClassProcs Public and Extensible","author":["Eric Melski <[email protected]>"],"is-jest":false},
	"4":{"url":"./tip/4.md","created":"26-Oct-2000","post-history":"","state":"Draft","vote":"Pending","type":"Informative","title":"# TIP 4: Tcl Release and Distribution Philosophy","discussions-to":"news:comp.lang.tcl","author":["Brent Welch <[email protected]>","Donal K. Fellows <[email protected]>","Larry W. Virden <[email protected]>","Larry W. Virden <[email protected]>"],"is-jest":false},
	"3":{"url":"./tip/3.md","created":"14-Sep-2000","post-history":"","state":"Accepted","vote":"Done","type":"Process","title":"# TIP 3: TIP Format","author":["Andreas Kupries <[email protected]>","Donal K. Fellows <[email protected]>"],"is-jest":false},
	"2":{"url":"./tip/2.md","created":"12-Sep-2000","post-history":"","state":"Draft","vote":"Pending","type":"Process","title":"# TIP 2: TIP Guidelines","author":["Andreas Kupries <[email protected]>","Donal K. Fellows <[email protected]>","Don Porter <[email protected]>","Mo DeJong <[email protected]>","Larry W. Virden <[email protected]>","Kevin Kenny <[email protected]>"],"is-jest":false},
	"1":{"url":"./tip/1.md","created":"14-Sep-2000","post-history":"","state":"Active","vote":"No voting","type":"Informational","title":"# TIP 1: TIP Index","author":["TIP Editor <[email protected]>"],"is-jest":false},
	"0":{"url":"./tip/0.md","created":"11-Dec-2000","post-history":"","state":"Final","vote":"Done","type":"Process","title":"# TIP 0: Tcl Core Team Basic Rules","author":["John Ousterhout <[email protected]>"],"is-jest":false},
	"@min": 0,
	"@max": 538
}, "@timestamp": 1554905221}
Changes to index.md.
116
117
118
119
120
121
122








123
124
125
126
127
128
129
<th>Type</th>
<th>Tcl Version</th>
<th>Status</th>
<th>Title</th>
<th>Impl.</th>
</tr></thead><tbody>









<tr class='project projectdraft projectdraft90 project90'>
<td valign='top'><a href='./tip/537.md'>537</a></td>
<td valign='top'>Project</td>
<td valign='top'>9.0</td>
<td valign='top'>Draft</td>
<td valign='top'># TIP 537: Enable 64-bit indexes in regexp matching</td>
<td valign='top'><a href='/tcl/timeline?r=regexp-api-64bit'>Link</a></td>







>
>
>
>
>
>
>
>







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<th>Type</th>
<th>Tcl Version</th>
<th>Status</th>
<th>Title</th>
<th>Impl.</th>
</tr></thead><tbody>

<tr class='project projectdraft projectdraft87 project87'>
<td valign='top'><a href='./tip/538.md'>538</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top'># TIP 538: Externalize libtommath</td>
<td valign='top'><a href='/tcl/timeline?r=digit-bit-60'>Link</a></td>
</tr>
<tr class='project projectdraft projectdraft90 project90'>
<td valign='top'><a href='./tip/537.md'>537</a></td>
<td valign='top'>Project</td>
<td valign='top'>9.0</td>
<td valign='top'>Draft</td>
<td valign='top'># TIP 537: Enable 64-bit indexes in regexp matching</td>
<td valign='top'><a href='/tcl/timeline?r=regexp-api-64bit'>Link</a></td>
Added tip/538.md.


























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# TIP 538: Externalize libtommath
	Author:         Jan Nijtmans <[email protected]>
	State:          Draft
	Type:           Project
	Vote:
	Created:        9-April-2019
	Post-History:
	Keywords:       Tcl
	Tcl-Version:    8.7
	Tcl-Branch:     digit-bit-60
-----

# Abstract

This TIP proposes to add the possibility to link Tcl with an external libtommath library, if available, for shared builds.

# Rationale

Tcl - since 8.6 - has a built-in libtommath library with modifications. By now, many of those modifications
were adopted upstream. This makes it possible to change the built Tcl library, using the external libtommath
library as-is, in stead of using it's own fork. libtommath will continue to be delivered together with
the Tcl source code.

# Specification and Documentation

Starting with libtommath 1.1.0, it is possible to build Tcl without the internal libtommath, but - in stead - linking
with the unmodified, externally built, libtommath. This has the following consequences:

  - On 64-bit platforms (win64, linux-64), libtommath will now be built in 64-bit mode, while Tcl's libtommath used to be
    built in 32-bit mode.  Extensions which depend on the internal structure of the libtommath types will need
    to be re-compiled.

  - On win32/win64, a pre-built libtommath dll will be available, so libtommath will get the same status as
    zlib. Only when Tcl is build statically (--disable-shared) a (subset of) libtommath will still be built-in,
    the same subset that Tcl depends on.

  - One of Tcl's modifications (in mp\_sqrt) [doesn't work in 64-bit mode](https://travis-ci.org/tcltk/tcl/builds/512875496).
    In the implementation branch this modification is reverted. It can be put back as soon as the code is fixed for
    64-bit mode and accepted upstream.

  - Extensions can now choose whether they want to depend on libtommath directly or not. When using "tclTomMath.h",
    they will be linked to Tcl's libtommath stub table, when using "tommath.h" they will be linked directly
    to the external libtommath library. Both ways will continue to be supported. Extensions using "tommath.h"
    can use all available libtommath functions. When using "tclTomMath.h" only a subset is available.

  - "tclTomMath.h" is no longer part of "tclInt.h". So extension depending on "tclInt.h" but using libtommath
    functions will need to be adapted.

  - The types "mp\_digit" and "mp\_word" are no longer declared by tcl.h.  Extensions using those types will need
    to start using the "tclTomMath.h" or "tommath.h" includes as well.

# Implementation

All makefiles are adapted to detect external presence of libtommath 1.1.0 or later. If so, this library will be used
for shared builds, otherwise the built-in libtommath will continue to be used as before.

An implementation of this TIP is present in the [digit-bit-60](https://core.tcl-lang.org/tcl/timeline?r=digit-bit-60) branch.

# Copyright

This document has been placed in the public domain.