@beetlebug/ztcl 0.0.0-stage → 1.0.0-beta.1
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.
- package/LICENSE +24 -0
- package/NOTICE +18 -0
- package/README.md +132 -2
- package/licenses/arm-optimized-routines.txt +249 -0
- package/licenses/ghostty-MIT.txt +21 -0
- package/licenses/go-BSD-3-Clause.txt +27 -0
- package/licenses/musl-MIT.txt +193 -0
- package/licenses/simdjson-NOTICE.txt +20 -0
- package/licenses/tcl-license.txt +40 -0
- package/licenses/unicode-license.txt +39 -0
- package/licenses/uucode-MIT.txt +30 -0
- package/licenses/wasi-W3C-CLA.md +8 -0
- package/licenses/zig-std-MIT.txt +21 -0
- package/package.json +61 -4
- package/ztcl-async.wasm +0 -0
- package/ztcl-thread-worker.mjs +204 -0
- package/ztcl-threads.d.ts +55 -0
- package/ztcl-threads.mjs +224 -0
- package/ztcl-threads.wasm +0 -0
- package/ztcl-worker.d.ts +33 -0
- package/ztcl-worker.mjs +48 -0
- package/ztcl.d.ts +220 -0
- package/ztcl.mjs +1213 -0
- package/ztcl.wasm +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
BSD 2-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The ztcl authors
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
16
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
17
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
18
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
19
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
20
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
21
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
22
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
23
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
24
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
ztcl
|
|
2
|
+
Copyright (c) 2026 The ztcl authors
|
|
3
|
+
Licensed under the BSD 2-Clause License. See LICENSE.
|
|
4
|
+
|
|
5
|
+
ztcl.wasm contains the Zig standard library. The Zig standard library
|
|
6
|
+
has ports of code from other projects. The license texts are in the
|
|
7
|
+
licenses/ folder.
|
|
8
|
+
|
|
9
|
+
Source Use License text
|
|
10
|
+
Zig standard library All of ztcl licenses/zig-std-MIT.txt
|
|
11
|
+
musl libc Math functions of std.math licenses/musl-MIT.txt
|
|
12
|
+
Go std.fmt.parseFloat, std.math.pow licenses/go-BSD-3-Clause.txt
|
|
13
|
+
ARM optimized-routines std.math.acos, std.math.atan licenses/arm-optimized-routines.txt
|
|
14
|
+
libghostty-vt (Ghostty) The terminal state of ztcl::vt licenses/ghostty-MIT.txt
|
|
15
|
+
uucode The Unicode tables of libghostty licenses/uucode-MIT.txt
|
|
16
|
+
|
|
17
|
+
ztcl follows the language rules and the command behavior of Tcl. It has
|
|
18
|
+
no code of Tcl. The Tcl/Tk License is in licenses/tcl-license.txt.
|
package/README.md
CHANGED
|
@@ -1,3 +1,133 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @beetlebug/ztcl
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
ztcl is a Tcl interpreter in Zig. This package has the WebAssembly build and a small ES module over it. A page or a Node.js program runs Tcl scripts with an exact compute limit and a memory limit, so it can run scripts that its users write.
|
|
4
|
+
|
|
5
|
+
- The module is 871 KB, or about 300 KB with gzip. It has no imports.
|
|
6
|
+
- It runs in a browser, in a Web Worker, and in Node.js 22.3 or later.
|
|
7
|
+
- It has types for TypeScript.
|
|
8
|
+
|
|
9
|
+
The docs are at [beetlebug.org/ztcl](https://beetlebug.org/ztcl/webassembly/). The source is at [github.com/beetlebugorg/ztcl](https://github.com/beetlebugorg/ztcl).
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install @beetlebug/ztcl
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## In a page with no build step
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<script type="module">
|
|
21
|
+
import { Interp } from "https://cdn.jsdelivr.net/npm/@beetlebug/ztcl@1.0.0-beta.1/ztcl.mjs";
|
|
22
|
+
|
|
23
|
+
const tcl = await Interp.create({ computeLimit: 1_000_000, memLimit: 64 << 20 });
|
|
24
|
+
console.log(tcl.eval("expr {6 * 7}").result); // 42
|
|
25
|
+
</script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The module loads `ztcl.wasm` from its own folder on the CDN. `WorkerInterp` also works from the CDN: it starts its worker from a small blob script that imports `ztcl-worker.mjs`. The jsDelivr form `https://cdn.jsdelivr.net/npm/@beetlebug/ztcl/+esm` resolves `ztcl.wasm` in the same folder, but no test runs it.
|
|
29
|
+
|
|
30
|
+
## With a bundler
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { Interp, WorkerInterp } from "@beetlebug/ztcl";
|
|
34
|
+
|
|
35
|
+
const tcl = await Interp.create({
|
|
36
|
+
computeLimit: 1_000_000,
|
|
37
|
+
memLimit: 64 << 20,
|
|
38
|
+
onOutput: (text) => console.log(text),
|
|
39
|
+
});
|
|
40
|
+
const r = tcl.eval("puts hello; expr {6 * 7}");
|
|
41
|
+
// r is { ok: true, result: "42", output: "hello\n" }
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The module finds `ztcl.wasm` with `new URL("./ztcl.wasm", import.meta.url)`, and `WorkerInterp` starts its worker with `new Worker(new URL("./ztcl-worker.mjs", import.meta.url))`. `vite build` copies both files. For the Vite dev server, keep the package out of the dependency step, so the two files stay together:
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
// vite.config.js
|
|
48
|
+
export default { optimizeDeps: { exclude: ["@beetlebug/ztcl"] } };
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The tests of the package run Vite 7. Webpack 5 and Rollup also have support for the `new URL` form, but no test runs them. With another tool, copy `ztcl.wasm` to your site and give its URL to `Interp.create(url, options)`.
|
|
52
|
+
|
|
53
|
+
## In Node.js
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
import { Interp } from "@beetlebug/ztcl";
|
|
57
|
+
|
|
58
|
+
const tcl = await Interp.create({ computeLimit: 1_000_000, memLimit: 64 << 20 });
|
|
59
|
+
const r = tcl.eval("proc sq {x} {expr {$x * $x}}; sq 12");
|
|
60
|
+
console.log(r.result); // 144
|
|
61
|
+
tcl.close();
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## A worker that a person can stop
|
|
65
|
+
|
|
66
|
+
A script on the main thread blocks the page until it ends or hits a limit. `WorkerInterp` runs scripts in a Web Worker, and `stop()` ends the script at once.
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
import { WorkerInterp } from "@beetlebug/ztcl";
|
|
70
|
+
|
|
71
|
+
const tcl = new WorkerInterp({ memLimit: 64 << 20 });
|
|
72
|
+
const r = await tcl.eval(code); // the page stays live
|
|
73
|
+
cancel.onclick = () => tcl.stop(); // r is { ok: false, result: "stopped" }
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The next `eval` after `stop` starts a new worker with a new interpreter. `@beetlebug/ztcl/worker` is the worker script, for a page that makes the worker itself.
|
|
77
|
+
|
|
78
|
+
## API
|
|
79
|
+
|
|
80
|
+
| Export | Use |
|
|
81
|
+
|---|---|
|
|
82
|
+
| `Interp.create(source?, options?)` | Makes an interpreter in a new WebAssembly instance. |
|
|
83
|
+
| `interp.eval(script)` | Runs a script. Returns `{ ok, result, output }`. `result` is the value, or the error message when `ok` is false. |
|
|
84
|
+
| `interp.computeLimit`, `interp.memLimit` | The limits of the next `eval`. |
|
|
85
|
+
| `interp.memorySize` | The size of the linear memory in bytes. The memory never shrinks, so this is the peak. |
|
|
86
|
+
| `interp.close()` | Frees the interpreter. |
|
|
87
|
+
| `new WorkerInterp(wasmUrl?, options?)` | An interpreter in a Web Worker. `eval` returns a promise. `reset()` makes a new interpreter. `stop()` ends the worker. |
|
|
88
|
+
| `compile(source?)` | Compiles the module one time, for many interpreters. |
|
|
89
|
+
| `wasmURL()` | The URL of the `ztcl.wasm` file of the package. |
|
|
90
|
+
| `run(source, options?)` | Runs the scripts of a bundle from `ztcl build --wasm` in a new interpreter. |
|
|
91
|
+
| `interp.run()` | Runs the scripts of a bundle. Returns `{ ok, result, output }`. |
|
|
92
|
+
|
|
93
|
+
The options are `computeLimit`, `memLimit`, `onOutput`, and `allow`. `allow: ["file"]` turns on `source` and `open` for reading on the files of a bundle. `computeLimit` is the compute units of each `eval`, and `null` (the default) is no limit. `memLimit` is in bytes, and the default is 2 GiB. `onOutput(text)` gets the text of `puts` when each `eval` ends.
|
|
94
|
+
|
|
95
|
+
A source is a URL, a file path in Node.js, a `Response`, bytes, or a `WebAssembly.Module`. With no source, the module is the `ztcl.wasm` file of the package.
|
|
96
|
+
|
|
97
|
+
One interpreter keeps its procs and variables from one `eval` to the next. Each `Interp` has its own instance and its own memory, so `close` and a new `Interp` give the memory back.
|
|
98
|
+
|
|
99
|
+
## A bundle
|
|
100
|
+
|
|
101
|
+
`ztcl build --wasm -o app.wasm app.tcl` writes a copy of the `ztcl.wasm` of the package with the script in it. `--embed PATH` adds read-only files under `//zipfs:/app/`. The limits apply as for `eval`. See [Bundle a script](https://beetlebug.org/ztcl/webassembly/#bundle-a-script).
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
import { run } from "@beetlebug/ztcl";
|
|
105
|
+
|
|
106
|
+
const r = await run(new URL("./app.wasm", import.meta.url), { computeLimit: 1_000_000, allow: ["file"] });
|
|
107
|
+
console.log(r.output);
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Threads
|
|
111
|
+
|
|
112
|
+
The entry `@beetlebug/ztcl/threads` runs the capability `thread` with one worker for each ztcl thread. In Node.js and on a cross-origin isolated page, each command of the Thread package works. On a page without cross-origin isolation, only the commands that do not wait work. The option `allow` turns on capabilities: `thread` is the default, and `clock`, `package`, `interp`, and in the shared mode `event` can also be on. `clock` and the event loop read the clock of the host. See [WebAssembly](https://beetlebug.org/ztcl/webassembly/#threads).
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
import { ThreadInterp } from "@beetlebug/ztcl/threads";
|
|
116
|
+
|
|
117
|
+
const t = await ThreadInterp.create({ allow: ["thread"] });
|
|
118
|
+
const r = await t.eval("thread::send [thread::create] {expr {6 * 7}}");
|
|
119
|
+
t.close();
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Limits and capabilities
|
|
123
|
+
|
|
124
|
+
- **Compute units.** Each command and each loop pass uses one compute unit. At the limit, the script stops with the error `compute limit reached`. `catch` and `try` cannot catch it. The same script stops at the same point in each browser and in Node.js.
|
|
125
|
+
- **Memory.** At the limit, the script stops with the error `the script used too much memory`. `catch` cannot catch it. The linear memory can grow to about twice the limit.
|
|
126
|
+
- **No host access.** The module has the interpreter only, with no JIT. It has no command that reaches the host: no files, sockets, `exec`, `clock`, `interp`, or event loop. `coroutine` returns an error.
|
|
127
|
+
- **Output.** `puts` goes into a buffer. `eval` returns the text, and `onOutput` gets it when the script ends.
|
|
128
|
+
|
|
129
|
+
Put only numbers or quoted lists into the text of a command. A value from a user can contain `[`, `$`, or `;`.
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
BSD-2-Clause. `ztcl.wasm` contains the Zig standard library, with ports of code from musl, Go, and ARM optimized-routines. See `NOTICE` and the `licenses` folder.
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
MIT OR Apache-2.0 WITH LLVM-exception
|
|
2
|
+
=====================================
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
MIT License
|
|
6
|
+
-----------
|
|
7
|
+
|
|
8
|
+
Copyright (c) 1999-2022, Arm Limited.
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
Apache-2.0 WITH LLVM-exception
|
|
30
|
+
------------------------------
|
|
31
|
+
|
|
32
|
+
Apache License
|
|
33
|
+
Version 2.0, January 2004
|
|
34
|
+
http://www.apache.org/licenses/
|
|
35
|
+
|
|
36
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
37
|
+
|
|
38
|
+
1. Definitions.
|
|
39
|
+
|
|
40
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
41
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
42
|
+
|
|
43
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
44
|
+
the copyright owner that is granting the License.
|
|
45
|
+
|
|
46
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
47
|
+
other entities that control, are controlled by, or are under common
|
|
48
|
+
control with that entity. For the purposes of this definition,
|
|
49
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
50
|
+
direction or management of such entity, whether by contract or
|
|
51
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
52
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
53
|
+
|
|
54
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
55
|
+
exercising permissions granted by this License.
|
|
56
|
+
|
|
57
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
58
|
+
including but not limited to software source code, documentation
|
|
59
|
+
source, and configuration files.
|
|
60
|
+
|
|
61
|
+
"Object" form shall mean any form resulting from mechanical
|
|
62
|
+
transformation or translation of a Source form, including but
|
|
63
|
+
not limited to compiled object code, generated documentation,
|
|
64
|
+
and conversions to other media types.
|
|
65
|
+
|
|
66
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
67
|
+
Object form, made available under the License, as indicated by a
|
|
68
|
+
copyright notice that is included in or attached to the work
|
|
69
|
+
(an example is provided in the Appendix below).
|
|
70
|
+
|
|
71
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
72
|
+
form, that is based on (or derived from) the Work and for which the
|
|
73
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
74
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
75
|
+
of this License, Derivative Works shall not include works that remain
|
|
76
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
77
|
+
the Work and Derivative Works thereof.
|
|
78
|
+
|
|
79
|
+
"Contribution" shall mean any work of authorship, including
|
|
80
|
+
the original version of the Work and any modifications or additions
|
|
81
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
82
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
83
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
84
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
85
|
+
means any form of electronic, verbal, or written communication sent
|
|
86
|
+
to the Licensor or its representatives, including but not limited to
|
|
87
|
+
communication on electronic mailing lists, source code control systems,
|
|
88
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
89
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
90
|
+
excluding communication that is conspicuously marked or otherwise
|
|
91
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
92
|
+
|
|
93
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
94
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
95
|
+
subsequently incorporated within the Work.
|
|
96
|
+
|
|
97
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
98
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
99
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
100
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
101
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
102
|
+
Work and such Derivative Works in Source or Object form.
|
|
103
|
+
|
|
104
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
105
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
106
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
107
|
+
(except as stated in this section) patent license to make, have made,
|
|
108
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
109
|
+
where such license applies only to those patent claims licensable
|
|
110
|
+
by such Contributor that are necessarily infringed by their
|
|
111
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
112
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
113
|
+
institute patent litigation against any entity (including a
|
|
114
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
115
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
116
|
+
or contributory patent infringement, then any patent licenses
|
|
117
|
+
granted to You under this License for that Work shall terminate
|
|
118
|
+
as of the date such litigation is filed.
|
|
119
|
+
|
|
120
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
121
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
122
|
+
modifications, and in Source or Object form, provided that You
|
|
123
|
+
meet the following conditions:
|
|
124
|
+
|
|
125
|
+
(a) You must give any other recipients of the Work or
|
|
126
|
+
Derivative Works a copy of this License; and
|
|
127
|
+
|
|
128
|
+
(b) You must cause any modified files to carry prominent notices
|
|
129
|
+
stating that You changed the files; and
|
|
130
|
+
|
|
131
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
132
|
+
that You distribute, all copyright, patent, trademark, and
|
|
133
|
+
attribution notices from the Source form of the Work,
|
|
134
|
+
excluding those notices that do not pertain to any part of
|
|
135
|
+
the Derivative Works; and
|
|
136
|
+
|
|
137
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
138
|
+
distribution, then any Derivative Works that You distribute must
|
|
139
|
+
include a readable copy of the attribution notices contained
|
|
140
|
+
within such NOTICE file, excluding those notices that do not
|
|
141
|
+
pertain to any part of the Derivative Works, in at least one
|
|
142
|
+
of the following places: within a NOTICE text file distributed
|
|
143
|
+
as part of the Derivative Works; within the Source form or
|
|
144
|
+
documentation, if provided along with the Derivative Works; or,
|
|
145
|
+
within a display generated by the Derivative Works, if and
|
|
146
|
+
wherever such third-party notices normally appear. The contents
|
|
147
|
+
of the NOTICE file are for informational purposes only and
|
|
148
|
+
do not modify the License. You may add Your own attribution
|
|
149
|
+
notices within Derivative Works that You distribute, alongside
|
|
150
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
151
|
+
that such additional attribution notices cannot be construed
|
|
152
|
+
as modifying the License.
|
|
153
|
+
|
|
154
|
+
You may add Your own copyright statement to Your modifications and
|
|
155
|
+
may provide additional or different license terms and conditions
|
|
156
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
157
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
158
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
159
|
+
the conditions stated in this License.
|
|
160
|
+
|
|
161
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
162
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
163
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
164
|
+
this License, without any additional terms or conditions.
|
|
165
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
166
|
+
the terms of any separate license agreement you may have executed
|
|
167
|
+
with Licensor regarding such Contributions.
|
|
168
|
+
|
|
169
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
170
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
171
|
+
except as required for reasonable and customary use in describing the
|
|
172
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
173
|
+
|
|
174
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
175
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
176
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
177
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
178
|
+
implied, including, without limitation, any warranties or conditions
|
|
179
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
180
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
181
|
+
appropriateness of using or redistributing the Work and assume any
|
|
182
|
+
risks associated with Your exercise of permissions under this License.
|
|
183
|
+
|
|
184
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
185
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
186
|
+
unless required by applicable law (such as deliberate and grossly
|
|
187
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
188
|
+
liable to You for damages, including any direct, indirect, special,
|
|
189
|
+
incidental, or consequential damages of any character arising as a
|
|
190
|
+
result of this License or out of the use or inability to use the
|
|
191
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
192
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
193
|
+
other commercial damages or losses), even if such Contributor
|
|
194
|
+
has been advised of the possibility of such damages.
|
|
195
|
+
|
|
196
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
197
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
198
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
199
|
+
or other liability obligations and/or rights consistent with this
|
|
200
|
+
License. However, in accepting such obligations, You may act only
|
|
201
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
202
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
203
|
+
defend, and hold each Contributor harmless for any liability
|
|
204
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
205
|
+
of your accepting any such warranty or additional liability.
|
|
206
|
+
|
|
207
|
+
END OF TERMS AND CONDITIONS
|
|
208
|
+
|
|
209
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
210
|
+
|
|
211
|
+
To apply the Apache License to your work, attach the following
|
|
212
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
213
|
+
replaced with your own identifying information. (Don't include
|
|
214
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
215
|
+
comment syntax for the file format. We also recommend that a
|
|
216
|
+
file or class name and description of purpose be included on the
|
|
217
|
+
same "printed page" as the copyright notice for easier
|
|
218
|
+
identification within third-party archives.
|
|
219
|
+
|
|
220
|
+
Copyright [yyyy] [name of copyright owner]
|
|
221
|
+
|
|
222
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
223
|
+
you may not use this file except in compliance with the License.
|
|
224
|
+
You may obtain a copy of the License at
|
|
225
|
+
|
|
226
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
227
|
+
|
|
228
|
+
Unless required by applicable law or agreed to in writing, software
|
|
229
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
230
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
231
|
+
See the License for the specific language governing permissions and
|
|
232
|
+
limitations under the License.
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
--- LLVM Exceptions to the Apache 2.0 License ----
|
|
236
|
+
|
|
237
|
+
As an exception, if, as a result of your compiling your source code, portions
|
|
238
|
+
of this Software are embedded into an Object form of such source code, you
|
|
239
|
+
may redistribute such embedded portions in such Object form without complying
|
|
240
|
+
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
|
|
241
|
+
|
|
242
|
+
In addition, if you combine or link compiled forms of this Software with
|
|
243
|
+
software that is licensed under the GPLv2 ("Combined Software") and if a
|
|
244
|
+
court of competent jurisdiction determines that the patent provision (Section
|
|
245
|
+
3), the indemnity provision (Section 9) or other Section of the License
|
|
246
|
+
conflicts with the conditions of the GPLv2, you may retroactively and
|
|
247
|
+
prospectively choose to deem waived or otherwise exclude such Section(s) of
|
|
248
|
+
the License, but only in their entirety and only with respect to the Combined
|
|
249
|
+
Software.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Mitchell Hashimoto, Ghostty contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Copyright 2009 The Go Authors.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions are
|
|
5
|
+
met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright
|
|
8
|
+
notice, this list of conditions and the following disclaimer.
|
|
9
|
+
* Redistributions in binary form must reproduce the above
|
|
10
|
+
copyright notice, this list of conditions and the following disclaimer
|
|
11
|
+
in the documentation and/or other materials provided with the
|
|
12
|
+
distribution.
|
|
13
|
+
* Neither the name of Google LLC nor the names of its
|
|
14
|
+
contributors may be used to endorse or promote products derived from
|
|
15
|
+
this software without specific prior written permission.
|
|
16
|
+
|
|
17
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
18
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
19
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
20
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
21
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
22
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
23
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
24
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
25
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
musl as a whole is licensed under the following standard MIT license:
|
|
2
|
+
|
|
3
|
+
----------------------------------------------------------------------
|
|
4
|
+
Copyright © 2005-2020 Rich Felker, et al.
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
7
|
+
a copy of this software and associated documentation files (the
|
|
8
|
+
"Software"), to deal in the Software without restriction, including
|
|
9
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
10
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
11
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
12
|
+
the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be
|
|
15
|
+
included in all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
19
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
20
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
21
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
22
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
23
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
|
+
----------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
Authors/contributors include:
|
|
27
|
+
|
|
28
|
+
A. Wilcox
|
|
29
|
+
Ada Worcester
|
|
30
|
+
Alex Dowad
|
|
31
|
+
Alex Suykov
|
|
32
|
+
Alexander Monakov
|
|
33
|
+
Andre McCurdy
|
|
34
|
+
Andrew Kelley
|
|
35
|
+
Anthony G. Basile
|
|
36
|
+
Aric Belsito
|
|
37
|
+
Arvid Picciani
|
|
38
|
+
Bartosz Brachaczek
|
|
39
|
+
Benjamin Peterson
|
|
40
|
+
Bobby Bingham
|
|
41
|
+
Boris Brezillon
|
|
42
|
+
Brent Cook
|
|
43
|
+
Chris Spiegel
|
|
44
|
+
Clément Vasseur
|
|
45
|
+
Daniel Micay
|
|
46
|
+
Daniel Sabogal
|
|
47
|
+
Daurnimator
|
|
48
|
+
David Carlier
|
|
49
|
+
David Edelsohn
|
|
50
|
+
Denys Vlasenko
|
|
51
|
+
Dmitry Ivanov
|
|
52
|
+
Dmitry V. Levin
|
|
53
|
+
Drew DeVault
|
|
54
|
+
Emil Renner Berthing
|
|
55
|
+
Fangrui Song
|
|
56
|
+
Felix Fietkau
|
|
57
|
+
Felix Janda
|
|
58
|
+
Gianluca Anzolin
|
|
59
|
+
Hauke Mehrtens
|
|
60
|
+
He X
|
|
61
|
+
Hiltjo Posthuma
|
|
62
|
+
Isaac Dunham
|
|
63
|
+
Jaydeep Patil
|
|
64
|
+
Jens Gustedt
|
|
65
|
+
Jeremy Huntwork
|
|
66
|
+
Jo-Philipp Wich
|
|
67
|
+
Joakim Sindholt
|
|
68
|
+
John Spencer
|
|
69
|
+
Julien Ramseier
|
|
70
|
+
Justin Cormack
|
|
71
|
+
Kaarle Ritvanen
|
|
72
|
+
Khem Raj
|
|
73
|
+
Kylie McClain
|
|
74
|
+
Leah Neukirchen
|
|
75
|
+
Luca Barbato
|
|
76
|
+
Luka Perkov
|
|
77
|
+
M Farkas-Dyck (Strake)
|
|
78
|
+
Mahesh Bodapati
|
|
79
|
+
Markus Wichmann
|
|
80
|
+
Masanori Ogino
|
|
81
|
+
Michael Clark
|
|
82
|
+
Michael Forney
|
|
83
|
+
Mikhail Kremnyov
|
|
84
|
+
Natanael Copa
|
|
85
|
+
Nicholas J. Kain
|
|
86
|
+
orc
|
|
87
|
+
Pascal Cuoq
|
|
88
|
+
Patrick Oppenlander
|
|
89
|
+
Petr Hosek
|
|
90
|
+
Petr Skocik
|
|
91
|
+
Pierre Carrier
|
|
92
|
+
Reini Urban
|
|
93
|
+
Rich Felker
|
|
94
|
+
Richard Pennington
|
|
95
|
+
Ryan Fairfax
|
|
96
|
+
Samuel Holland
|
|
97
|
+
Segev Finer
|
|
98
|
+
Shiz
|
|
99
|
+
sin
|
|
100
|
+
Solar Designer
|
|
101
|
+
Stefan Kristiansson
|
|
102
|
+
Stefan O'Rear
|
|
103
|
+
Szabolcs Nagy
|
|
104
|
+
Timo Teräs
|
|
105
|
+
Trutz Behn
|
|
106
|
+
Valentin Ochs
|
|
107
|
+
Will Dietz
|
|
108
|
+
William Haddon
|
|
109
|
+
William Pitcock
|
|
110
|
+
|
|
111
|
+
Portions of this software are derived from third-party works licensed
|
|
112
|
+
under terms compatible with the above MIT license:
|
|
113
|
+
|
|
114
|
+
The TRE regular expression implementation (src/regex/reg* and
|
|
115
|
+
src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
|
|
116
|
+
under a 2-clause BSD license (license text in the source files). The
|
|
117
|
+
included version has been heavily modified by Rich Felker in 2012, in
|
|
118
|
+
the interests of size, simplicity, and namespace cleanliness.
|
|
119
|
+
|
|
120
|
+
Much of the math library code (src/math/* and src/complex/*) is
|
|
121
|
+
Copyright © 1993,2004 Sun Microsystems or
|
|
122
|
+
Copyright © 2003-2011 David Schultz or
|
|
123
|
+
Copyright © 2003-2009 Steven G. Kargl or
|
|
124
|
+
Copyright © 2003-2009 Bruce D. Evans or
|
|
125
|
+
Copyright © 2008 Stephen L. Moshier or
|
|
126
|
+
Copyright © 2017-2018 Arm Limited
|
|
127
|
+
and labelled as such in comments in the individual source files. All
|
|
128
|
+
have been licensed under extremely permissive terms.
|
|
129
|
+
|
|
130
|
+
The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008
|
|
131
|
+
The Android Open Source Project and is licensed under a two-clause BSD
|
|
132
|
+
license. It was taken from Bionic libc, used on Android.
|
|
133
|
+
|
|
134
|
+
The AArch64 memcpy and memset code (src/string/aarch64/*) are
|
|
135
|
+
Copyright © 1999-2019, Arm Limited.
|
|
136
|
+
|
|
137
|
+
The implementation of DES for crypt (src/crypt/crypt_des.c) is
|
|
138
|
+
Copyright © 1994 David Burren. It is licensed under a BSD license.
|
|
139
|
+
|
|
140
|
+
The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
|
|
141
|
+
originally written by Solar Designer and placed into the public
|
|
142
|
+
domain. The code also comes with a fallback permissive license for use
|
|
143
|
+
in jurisdictions that may not recognize the public domain.
|
|
144
|
+
|
|
145
|
+
The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
|
|
146
|
+
Valentin Ochs and is licensed under an MIT-style license.
|
|
147
|
+
|
|
148
|
+
The x86_64 port was written by Nicholas J. Kain and is licensed under
|
|
149
|
+
the standard MIT terms.
|
|
150
|
+
|
|
151
|
+
The mips and microblaze ports were originally written by Richard
|
|
152
|
+
Pennington for use in the ellcc project. The original code was adapted
|
|
153
|
+
by Rich Felker for build system and code conventions during upstream
|
|
154
|
+
integration. It is licensed under the standard MIT terms.
|
|
155
|
+
|
|
156
|
+
The mips64 port was contributed by Imagination Technologies and is
|
|
157
|
+
licensed under the standard MIT terms.
|
|
158
|
+
|
|
159
|
+
The powerpc port was also originally written by Richard Pennington,
|
|
160
|
+
and later supplemented and integrated by John Spencer. It is licensed
|
|
161
|
+
under the standard MIT terms.
|
|
162
|
+
|
|
163
|
+
All other files which have no copyright comments are original works
|
|
164
|
+
produced specifically for use as part of this library, written either
|
|
165
|
+
by Rich Felker, the main author of the library, or by one or more
|
|
166
|
+
contibutors listed above. Details on authorship of individual files
|
|
167
|
+
can be found in the git version control history of the project. The
|
|
168
|
+
omission of copyright and license comments in each file is in the
|
|
169
|
+
interest of source tree size.
|
|
170
|
+
|
|
171
|
+
In addition, permission is hereby granted for all public header files
|
|
172
|
+
(include/* and arch/*/bits/*) and crt files intended to be linked into
|
|
173
|
+
applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
|
|
174
|
+
the copyright notice and permission notice otherwise required by the
|
|
175
|
+
license, and to use these files without any requirement of
|
|
176
|
+
attribution. These files include substantial contributions from:
|
|
177
|
+
|
|
178
|
+
Bobby Bingham
|
|
179
|
+
John Spencer
|
|
180
|
+
Nicholas J. Kain
|
|
181
|
+
Rich Felker
|
|
182
|
+
Richard Pennington
|
|
183
|
+
Stefan Kristiansson
|
|
184
|
+
Szabolcs Nagy
|
|
185
|
+
|
|
186
|
+
all of whom have explicitly granted such permission.
|
|
187
|
+
|
|
188
|
+
This file previously contained text expressing a belief that most of
|
|
189
|
+
the files covered by the above exception were sufficiently trivial not
|
|
190
|
+
to be subject to copyright, resulting in confusion over whether it
|
|
191
|
+
negated the permissions granted in the license. In the spirit of
|
|
192
|
+
permissive licensing, and of not having licensing issues being an
|
|
193
|
+
obstacle to adoption, that text has been removed.
|