bare-script 4.2.4__tar.gz → 4.2.6__tar.gz
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.
- {bare_script-4.2.4/src/bare_script.egg-info → bare_script-4.2.6}/PKG-INFO +25 -5
- {bare_script-4.2.4 → bare_script-4.2.6}/README.md +24 -4
- {bare_script-4.2.4 → bare_script-4.2.6}/setup.cfg +1 -1
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/library.py +2 -0
- bare_script-4.2.6/src/bare_script/runtime_c.c +5286 -0
- {bare_script-4.2.4 → bare_script-4.2.6/src/bare_script.egg-info}/PKG-INFO +25 -5
- bare_script-4.2.4/src/bare_script/runtime_c.c +0 -1916
- {bare_script-4.2.4 → bare_script-4.2.6}/LICENSE +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/pyproject.toml +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/setup.py +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/__init__.py +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/__main__.py +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/bare.py +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/__init__.py +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/args.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/baredoc.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/baredocCLI.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/data.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/dataLineChart.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/dataTable.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/dataUtil.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/diff.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/draw.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/elementModel.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/forms.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/markdown.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/markdownElements.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/markdownHighlight.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/markdownParser.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/markdownUp.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/pager.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/qrcode.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/schemaDoc.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/unittest.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/include/unittestMock.bare +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/model.py +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/options.py +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/parser.py +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/runtime.py +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script/value.py +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script.egg-info/SOURCES.txt +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script.egg-info/dependency_links.txt +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script.egg-info/entry_points.txt +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script.egg-info/requires.txt +0 -0
- {bare_script-4.2.4 → bare_script-4.2.6}/src/bare_script.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bare-script
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.6
|
|
4
4
|
Summary: bare-script
|
|
5
5
|
Home-page: https://github.com/craigahobbs/bare-script
|
|
6
6
|
Author: Craig A. Hobbs
|
|
@@ -193,10 +193,30 @@ markdownPrint('Hello, Markdown!')
|
|
|
193
193
|
|
|
194
194
|
## C Runtime
|
|
195
195
|
|
|
196
|
-
The package ships with an optional CPython C extension
|
|
197
|
-
runtime for faster script execution.
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
The package ships with an optional CPython C extension, `runtime_c`, that mirrors the pure-Python
|
|
197
|
+
runtime for faster script execution. The compiled extension is used automatically when available;
|
|
198
|
+
set the environment variable `BARESCRIPT_RUNTIME_PY=1` to force the pure-Python runtime.
|
|
199
|
+
|
|
200
|
+
The extension supports CPython 3.10 and later on both the default (GIL) and free-threaded Python
|
|
201
|
+
builds.
|
|
202
|
+
|
|
203
|
+
The C runtime runs the BareScript include library test suite (`make test-include`) about 3.6x
|
|
204
|
+
faster than the pure-Python runtime (CPython 3.14, Apple M-series):
|
|
205
|
+
|
|
206
|
+
| Runtime | Test Suite Time (ms) | Multiple |
|
|
207
|
+
| ------------------- | -------------------: | -------: |
|
|
208
|
+
| BareScript (C) | 586 | 1.0x |
|
|
209
|
+
| BareScript (Python) | 2115 | 3.6x |
|
|
210
|
+
|
|
211
|
+
Compute-intensive scripts run up to roughly 30x faster - for example, the
|
|
212
|
+
[Mandelbrot benchmark](https://github.com/craigahobbs/bare-script-py/blob/main/perf/test.bare)
|
|
213
|
+
(`make perf`), shown here against the equivalent native Python program:
|
|
214
|
+
|
|
215
|
+
| Language | Best Time (ms) | Multiple |
|
|
216
|
+
| ------------------- | -------------: | -------: |
|
|
217
|
+
| Python | 152 | 1.0x |
|
|
218
|
+
| BareScript (C) | 322 | 2.1x |
|
|
219
|
+
| BareScript (Python) | 10389 | 68.5x |
|
|
200
220
|
|
|
201
221
|
|
|
202
222
|
## Using BareScript with an AI Assistant
|
|
@@ -168,10 +168,30 @@ markdownPrint('Hello, Markdown!')
|
|
|
168
168
|
|
|
169
169
|
## C Runtime
|
|
170
170
|
|
|
171
|
-
The package ships with an optional CPython C extension
|
|
172
|
-
runtime for faster script execution.
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
The package ships with an optional CPython C extension, `runtime_c`, that mirrors the pure-Python
|
|
172
|
+
runtime for faster script execution. The compiled extension is used automatically when available;
|
|
173
|
+
set the environment variable `BARESCRIPT_RUNTIME_PY=1` to force the pure-Python runtime.
|
|
174
|
+
|
|
175
|
+
The extension supports CPython 3.10 and later on both the default (GIL) and free-threaded Python
|
|
176
|
+
builds.
|
|
177
|
+
|
|
178
|
+
The C runtime runs the BareScript include library test suite (`make test-include`) about 3.6x
|
|
179
|
+
faster than the pure-Python runtime (CPython 3.14, Apple M-series):
|
|
180
|
+
|
|
181
|
+
| Runtime | Test Suite Time (ms) | Multiple |
|
|
182
|
+
| ------------------- | -------------------: | -------: |
|
|
183
|
+
| BareScript (C) | 586 | 1.0x |
|
|
184
|
+
| BareScript (Python) | 2115 | 3.6x |
|
|
185
|
+
|
|
186
|
+
Compute-intensive scripts run up to roughly 30x faster - for example, the
|
|
187
|
+
[Mandelbrot benchmark](https://github.com/craigahobbs/bare-script-py/blob/main/perf/test.bare)
|
|
188
|
+
(`make perf`), shown here against the equivalent native Python program:
|
|
189
|
+
|
|
190
|
+
| Language | Best Time (ms) | Multiple |
|
|
191
|
+
| ------------------- | -------------: | -------: |
|
|
192
|
+
| Python | 152 | 1.0x |
|
|
193
|
+
| BareScript (C) | 322 | 2.1x |
|
|
194
|
+
| BareScript (Python) | 10389 | 68.5x |
|
|
175
195
|
|
|
176
196
|
|
|
177
197
|
## Using BareScript with an AI Assistant
|
|
@@ -1044,6 +1044,8 @@ _NUMBER_TO_FIXED_ARGS = value_args_model([
|
|
|
1044
1044
|
# $return: The integer as a string of the given base
|
|
1045
1045
|
def _number_to_string(args, unused_options):
|
|
1046
1046
|
x, radix = value_args_validate(_NUMBER_TO_STRING_ARGS, args)
|
|
1047
|
+
if not x:
|
|
1048
|
+
return '0'
|
|
1047
1049
|
digits = []
|
|
1048
1050
|
while x:
|
|
1049
1051
|
digits.append(_NUMBER_TO_STRING_DIGITS[x % radix])
|