sagebrush 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,277 @@
1
+ A. HISTORY OF THE SOFTWARE
2
+ ==========================
3
+
4
+ Python was created in the early 1990s by Guido van Rossum at Stichting
5
+ Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands
6
+ as a successor of a language called ABC. Guido remains Python's
7
+ principal author, although it includes many contributions from others.
8
+
9
+ In 1995, Guido continued his work on Python at the Corporation for
10
+ National Research Initiatives (CNRI, see https://www.cnri.reston.va.us)
11
+ in Reston, Virginia where he released several versions of the
12
+ software.
13
+
14
+ In May 2000, Guido and the Python core development team moved to
15
+ BeOpen.com to form the BeOpen PythonLabs team. In October of the same
16
+ year, the PythonLabs team moved to Digital Creations, which became
17
+ Zope Corporation. In 2001, the Python Software Foundation (PSF, see
18
+ https://www.python.org/psf/) was formed, a non-profit organization
19
+ created specifically to own Python-related Intellectual Property.
20
+ Zope Corporation was a sponsoring member of the PSF.
21
+
22
+ All Python releases are Open Source (see https://opensource.org for
23
+ the Open Source Definition). Historically, most, but not all, Python
24
+ releases have also been GPL-compatible; the table below summarizes
25
+ the various releases.
26
+
27
+ Release Derived Year Owner GPL-
28
+ from compatible? (1)
29
+
30
+ 0.9.0 thru 1.2 1991-1995 CWI yes
31
+ 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
32
+ 1.6 1.5.2 2000 CNRI no
33
+ 2.0 1.6 2000 BeOpen.com no
34
+ 1.6.1 1.6 2001 CNRI yes (2)
35
+ 2.1 2.0+1.6.1 2001 PSF no
36
+ 2.0.1 2.0+1.6.1 2001 PSF yes
37
+ 2.1.1 2.1+2.0.1 2001 PSF yes
38
+ 2.1.2 2.1.1 2002 PSF yes
39
+ 2.1.3 2.1.2 2002 PSF yes
40
+ 2.2 and above 2.1.1 2001-now PSF yes
41
+
42
+ Footnotes:
43
+
44
+ (1) GPL-compatible doesn't mean that we're distributing Python under
45
+ the GPL. All Python licenses, unlike the GPL, let you distribute
46
+ a modified version without making your changes open source. The
47
+ GPL-compatible licenses make it possible to combine Python with
48
+ other software that is released under the GPL; the others don't.
49
+
50
+ (2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
51
+ because its license has a choice of law clause. According to
52
+ CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
53
+ is "not incompatible" with the GPL.
54
+
55
+ Thanks to the many outside volunteers who have worked under Guido's
56
+ direction to make these releases possible.
57
+
58
+
59
+ B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
60
+ ===============================================================
61
+
62
+ Python software and documentation are licensed under the
63
+ Python Software Foundation License Version 2.
64
+
65
+ Starting with Python 3.8.6, examples, recipes, and other code in
66
+ the documentation are dual licensed under the PSF License Version 2
67
+ and the Zero-Clause BSD license.
68
+
69
+ Some software incorporated into Python is under different licenses.
70
+ The licenses are listed with code falling under that license.
71
+
72
+
73
+ PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
74
+ --------------------------------------------
75
+
76
+ 1. This LICENSE AGREEMENT is between the Python Software Foundation
77
+ ("PSF"), and the Individual or Organization ("Licensee") accessing and
78
+ otherwise using this software ("Python") in source or binary form and
79
+ its associated documentation.
80
+
81
+ 2. Subject to the terms and conditions of this License Agreement, PSF hereby
82
+ grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
83
+ analyze, test, perform and/or display publicly, prepare derivative works,
84
+ distribute, and otherwise use Python alone or in any derivative version,
85
+ provided, however, that PSF's License Agreement and PSF's notice of copyright,
86
+ i.e., "Copyright (c) 2001 Python Software Foundation; All Rights Reserved"
87
+ are retained in Python alone or in any derivative version prepared by Licensee.
88
+
89
+ 3. In the event Licensee prepares a derivative work that is based on
90
+ or incorporates Python or any part thereof, and wants to make
91
+ the derivative work available to others as provided herein, then
92
+ Licensee hereby agrees to include in any such work a brief summary of
93
+ the changes made to Python.
94
+
95
+ 4. PSF is making Python available to Licensee on an "AS IS"
96
+ basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
97
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
98
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
99
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
100
+ INFRINGE ANY THIRD PARTY RIGHTS.
101
+
102
+ 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
103
+ FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
104
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
105
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
106
+
107
+ 6. This License Agreement will automatically terminate upon a material
108
+ breach of its terms and conditions.
109
+
110
+ 7. Nothing in this License Agreement shall be deemed to create any
111
+ relationship of agency, partnership, or joint venture between PSF and
112
+ Licensee. This License Agreement does not grant permission to use PSF
113
+ trademarks or trade name in a trademark sense to endorse or promote
114
+ products or services of Licensee, or any third party.
115
+
116
+ 8. By copying, installing or otherwise using Python, Licensee
117
+ agrees to be bound by the terms and conditions of this License
118
+ Agreement.
119
+
120
+
121
+ BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
122
+ -------------------------------------------
123
+
124
+ BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
125
+
126
+ 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
127
+ office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
128
+ Individual or Organization ("Licensee") accessing and otherwise using
129
+ this software in source or binary form and its associated
130
+ documentation ("the Software").
131
+
132
+ 2. Subject to the terms and conditions of this BeOpen Python License
133
+ Agreement, BeOpen hereby grants Licensee a non-exclusive,
134
+ royalty-free, world-wide license to reproduce, analyze, test, perform
135
+ and/or display publicly, prepare derivative works, distribute, and
136
+ otherwise use the Software alone or in any derivative version,
137
+ provided, however, that the BeOpen Python License is retained in the
138
+ Software, alone or in any derivative version prepared by Licensee.
139
+
140
+ 3. BeOpen is making the Software available to Licensee on an "AS IS"
141
+ basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
142
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
143
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
144
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
145
+ INFRINGE ANY THIRD PARTY RIGHTS.
146
+
147
+ 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
148
+ SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
149
+ AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
150
+ DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
151
+
152
+ 5. This License Agreement will automatically terminate upon a material
153
+ breach of its terms and conditions.
154
+
155
+ 6. This License Agreement shall be governed by and interpreted in all
156
+ respects by the law of the State of California, excluding conflict of
157
+ law provisions. Nothing in this License Agreement shall be deemed to
158
+ create any relationship of agency, partnership, or joint venture
159
+ between BeOpen and Licensee. This License Agreement does not grant
160
+ permission to use BeOpen trademarks or trade names in a trademark
161
+ sense to endorse or promote products or services of Licensee, or any
162
+ third party. As an exception, the "BeOpen Python" logos available at
163
+ http://www.pythonlabs.com/logos.html may be used according to the
164
+ permissions granted on that web page.
165
+
166
+ 7. By copying, installing or otherwise using the software, Licensee
167
+ agrees to be bound by the terms and conditions of this License
168
+ Agreement.
169
+
170
+
171
+ CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
172
+ ---------------------------------------
173
+
174
+ 1. This LICENSE AGREEMENT is between the Corporation for National
175
+ Research Initiatives, having an office at 1895 Preston White Drive,
176
+ Reston, VA 20191 ("CNRI"), and the Individual or Organization
177
+ ("Licensee") accessing and otherwise using Python 1.6.1 software in
178
+ source or binary form and its associated documentation.
179
+
180
+ 2. Subject to the terms and conditions of this License Agreement, CNRI
181
+ hereby grants Licensee a nonexclusive, royalty-free, world-wide
182
+ license to reproduce, analyze, test, perform and/or display publicly,
183
+ prepare derivative works, distribute, and otherwise use Python 1.6.1
184
+ alone or in any derivative version, provided, however, that CNRI's
185
+ License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
186
+ 1995-2001 Corporation for National Research Initiatives; All Rights
187
+ Reserved" are retained in Python 1.6.1 alone or in any derivative
188
+ version prepared by Licensee. Alternately, in lieu of CNRI's License
189
+ Agreement, Licensee may substitute the following text (omitting the
190
+ quotes): "Python 1.6.1 is made available subject to the terms and
191
+ conditions in CNRI's License Agreement. This Agreement together with
192
+ Python 1.6.1 may be located on the internet using the following
193
+ unique, persistent identifier (known as a handle): 1895.22/1013. This
194
+ Agreement may also be obtained from a proxy server on the internet
195
+ using the following URL: http://hdl.handle.net/1895.22/1013".
196
+
197
+ 3. In the event Licensee prepares a derivative work that is based on
198
+ or incorporates Python 1.6.1 or any part thereof, and wants to make
199
+ the derivative work available to others as provided herein, then
200
+ Licensee hereby agrees to include in any such work a brief summary of
201
+ the changes made to Python 1.6.1.
202
+
203
+ 4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
204
+ basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
205
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
206
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
207
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
208
+ INFRINGE ANY THIRD PARTY RIGHTS.
209
+
210
+ 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
211
+ 1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
212
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
213
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
214
+
215
+ 6. This License Agreement will automatically terminate upon a material
216
+ breach of its terms and conditions.
217
+
218
+ 7. This License Agreement shall be governed by the federal
219
+ intellectual property law of the United States, including without
220
+ limitation the federal copyright law, and, to the extent such
221
+ U.S. federal law does not apply, by the law of the Commonwealth of
222
+ Virginia, excluding Virginia's conflict of law provisions.
223
+ Notwithstanding the foregoing, with regard to derivative works based
224
+ on Python 1.6.1 that incorporate non-separable material that was
225
+ previously distributed under the GNU General Public License (GPL), the
226
+ law of the Commonwealth of Virginia shall govern this License
227
+ Agreement only as to issues arising under or with respect to
228
+ Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
229
+ License Agreement shall be deemed to create any relationship of
230
+ agency, partnership, or joint venture between CNRI and Licensee. This
231
+ License Agreement does not grant permission to use CNRI trademarks or
232
+ trade name in a trademark sense to endorse or promote products or
233
+ services of Licensee, or any third party.
234
+
235
+ 8. By clicking on the "ACCEPT" button where indicated, or by copying,
236
+ installing or otherwise using Python 1.6.1, Licensee agrees to be
237
+ bound by the terms and conditions of this License Agreement.
238
+
239
+ ACCEPT
240
+
241
+
242
+ CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
243
+ --------------------------------------------------
244
+
245
+ Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
246
+ The Netherlands. All rights reserved.
247
+
248
+ Permission to use, copy, modify, and distribute this software and its
249
+ documentation for any purpose and without fee is hereby granted,
250
+ provided that the above copyright notice appear in all copies and that
251
+ both that copyright notice and this permission notice appear in
252
+ supporting documentation, and that the name of Stichting Mathematisch
253
+ Centrum or CWI not be used in advertising or publicity pertaining to
254
+ distribution of the software without specific, written prior
255
+ permission.
256
+
257
+ STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
258
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
259
+ FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
260
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
261
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
262
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
263
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
264
+
265
+ ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION
266
+ ----------------------------------------------------------------------
267
+
268
+ Permission to use, copy, modify, and/or distribute this software for any
269
+ purpose with or without fee is hereby granted.
270
+
271
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
272
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
273
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
274
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
275
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
276
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
277
+ PERFORMANCE OF THIS SOFTWARE.
package/NOTICE.md ADDED
@@ -0,0 +1,27 @@
1
+ # Licensing notice for sagebrush
2
+
3
+ This package (`dist/sagebrush.cjs` and `bin/sagebrush.cjs`) bundles:
4
+
5
+ 1. **The pyjs compiler and runtime** (TypeScript from
6
+ github.com/sagemathinc/sagebrush, `src/`). Copyright (c) 2026
7
+ SageMath, Inc. **No license has been chosen yet, so no rights are
8
+ granted beyond viewing and running this package as published.** A
9
+ license, expected to be component-by-component, is coming soon.
10
+
11
+ 2. **pyparse**, a Python 3.14 parser generated from CPython's
12
+ `Grammar/python.gram`, `Grammar/Tokens` and `Parser/Python.asdl`, with
13
+ TypeScript ports of parts of CPython's `Parser/` directory, and a
14
+ Unicode character-name table generated from Python's `unicodedata`.
15
+ Derived from CPython, Copyright (c) 2001 Python Software Foundation;
16
+ distributed under the PSF License Agreement (`LICENSE-CPython.txt`).
17
+
18
+ 3. **Python standard-library modules copied unchanged from CPython 3.14**
19
+ (embedded as source): `operator`, `copy`, `copyreg`, `functools`,
20
+ `reprlib`, `abc`, `_py_abc`, `_weakrefset`, `numbers`, `fractions`,
21
+ `colorsys`, `json`, `pickle`, `_compat_pickle`. Copyright (c) 2001
22
+ Python Software Foundation; PSF License Agreement
23
+ (`LICENSE-CPython.txt`).
24
+
25
+ 4. Other embedded Python modules (`collections`, `io`, `unittest`,
26
+ `warnings`, `posixpath`, …) written for this project: the same terms as
27
+ (1).
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # sagebrush
2
+
3
+ Python 3.14 on a JavaScript runtime, aimed at research mathematics.
4
+
5
+ ```
6
+ npx sagebrush # interactive prompt (tab completion, history)
7
+ npx sagebrush script.py # run a program
8
+ npx sagebrush -c 'print(2**200)'
9
+ ```
10
+
11
+ or `npm install -g sagebrush`, then `sagebrush`.
12
+
13
+ - The whole thing is one JavaScript file (about 2 MB) with its Python
14
+ library embedded. It runs on Node 22+, Deno (`deno run -A`) and Bun, and
15
+ starts in roughly 80 ms.
16
+ - The language is CPython 3.14's own grammar (the parser is generated from
17
+ `Grammar/python.gram`); syntax errors match CPython's.
18
+ - Big integers, `fractions`, `complex`/`cmath`, `re`, `json`, `struct`,
19
+ `collections`, `functools`, `pickle`, … are included. Pure-Python
20
+ packages work too: mpmath 1.3 passes its entire test suite.
21
+ - Sandboxing comes for free from the runtime:
22
+ `deno run --allow-read $(which sagebrush)` can read but never write, and
23
+ denied operations raise `PermissionError`.
24
+
25
+ This is an early release of the Python front end of
26
+ [Sagebrush](https://github.com/sagemathinc/sagebrush); the Rust/WebAssembly
27
+ mathematics engines (modular forms, elliptic curves, …) are published
28
+ separately as `sagebrush-web` and will be exposed here as Python modules.
29
+
30
+ See `NOTICE.md` for licensing.
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ // Turn on Node's compile cache (faster starts after the first), then run.
3
+ try {
4
+ require("node:module").enableCompileCache?.();
5
+ } catch {}
6
+ require("../dist/sagebrush.cjs");