@glyphlang/glyph 0.1.8 → 0.1.9

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.
Files changed (2) hide show
  1. package/README.md +108 -0
  2. package/package.json +7 -7
package/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # Glyph
2
+
3
+ **TypeScript your AI agents can't quietly break.**
4
+
5
+ [![npm](https://img.shields.io/npm/v/@glyphlang/glyph.svg)](https://www.npmjs.com/package/@glyphlang/glyph)
6
+ [![downloads](https://img.shields.io/npm/dm/@glyphlang/glyph.svg)](https://www.npmjs.com/package/@glyphlang/glyph)
7
+ [![license](https://img.shields.io/npm/l/@glyphlang/glyph.svg)](https://github.com/chadetov/glyph)
8
+
9
+ Glyph is a statically typed language that **transpiles to TypeScript**, designed from the ground up so AI agents can read, write, and modify code safely. It looks almost like TypeScript — you read it on day one, no tutorial — but the differences are deliberate: each one closes a hole an agent falls through and `tsc --strict` waves past.
10
+
11
+ ```sh
12
+ npm install -g @glyphlang/glyph
13
+ ```
14
+
15
+ > **Website:** [glyphlang.io](https://glyphlang.io)  ·  **Try it in the browser:** [playground](https://glyphlang.io/playground/)  ·  **Pointing an agent at it?** [glyphlang.io/llms.txt](https://glyphlang.io/llms.txt)
16
+
17
+ ---
18
+
19
+ ## The problem it solves
20
+
21
+ An AI agent will happily write TypeScript that compiles clean and breaks at runtime. It reaches for `any` at a boundary, casts an `unknown`, forgets a `switch` case, and drops a `Promise` on the floor — and `tsc --strict` stays green the whole time. On a large codebase it can't even reliably *find* where something is defined, because overloads, decorators, namespace merging, and barrel re-exports scatter one symbol across many places.
22
+
23
+ Glyph removes those hazards at the language level. The bugs an agent ships don't compile here.
24
+
25
+ ## See it
26
+
27
+ Glyph reads like TypeScript, but there's no `any`, `match` must cover every case, and a type you declare is *actually checked at runtime*:
28
+
29
+ ```glyph
30
+ type User = {
31
+ id: number,
32
+ name: string,
33
+ }
34
+
35
+ // A boundary value is `unknown` until you prove its shape.
36
+ // `User.parse` exists because every type carries a runtime descriptor.
37
+ fn handle(body: unknown) -> string {
38
+ return match User.parse(body) {
39
+ Ok(user) => string.upper(user.name),
40
+ Err(_) => "invalid",
41
+ }
42
+ }
43
+ ```
44
+
45
+ That compiles to clean, readable TypeScript you can commit, run anywhere TS runs, and mix with any npm package.
46
+
47
+ ## Why teams pick it
48
+
49
+ - **No `any`, no erasure.** What the types say is true when the code runs. Every record type generates a runtime validator (`User.parse(x)`), so untrusted input is typed only after it's checked.
50
+ - **Exhaustive by default.** `match` over a union — or over `number`/`string` — must handle every case, or it doesn't compile. Add a variant and every unhandled site lights up.
51
+ - **Errors are values.** `Result` and the `?` operator instead of thrown exceptions; drop a `Result` and you get a warning, because a discarded error is a swallowed failure.
52
+ - **Greppable.** One name, one declaration form. `grep "fn parseUser"` finds the definition — always. No overloads, decorators, or barrel files.
53
+ - **Stable diffs.** One canonical format, one element per line, trailing commas, no reflow. A one-line change is a one-line diff — so agent edits stay reviewable.
54
+ - **Generate, don't hand-write.** `glyph gen openapi spec.yaml --client` emits a typed HTTP client and server stubs; `glyph gen zod` / `gen dts` turn existing schemas into checked Glyph types.
55
+
56
+ ## Quickstart
57
+
58
+ ```sh
59
+ glyph init my-app # scaffold a project
60
+ cd my-app
61
+ glyph run src/main.glyph # build + type-check + execute
62
+ glyph build --check # emit TypeScript, verified with tsc --strict
63
+ glyph fmt # one canonical layout
64
+ glyph --explain E0200 # long-form help for any diagnostic
65
+ ```
66
+
67
+ Glyph ships as a single prebuilt binary per platform (macOS, Linux, Windows — Intel and ARM). No postinstall download, no toolchain to set up. Running or type-checking uses your local `tsx`/`tsc`.
68
+
69
+ ## Built for agents
70
+
71
+ Point your coding agent at **[glyphlang.io/llms.txt](https://glyphlang.io/llms.txt)** — a single file that takes it from zero to correct, runnable Glyph: the canonical program shape, the full stdlib surface, the common gotchas, and the complete diagnostic catalogue with one-line fixes. Agents that write Glyph get compile-time feedback precise enough to self-correct.
72
+
73
+ ## Where to go next
74
+
75
+ | | |
76
+ |---|---|
77
+ | Your first program in 10 minutes | [Start Here](https://glyphlang.io/start/) |
78
+ | The whole language in five minutes | [the tour](https://github.com/chadetov/glyph/blob/main/docs/guide/tour.md) |
79
+ | Try it without installing | [playground](https://glyphlang.io/playground/) |
80
+ | Straight-talking answers to engineer questions | [glyphlang.io/answers](https://glyphlang.io/answers/) |
81
+ | The four pillars, in depth | [glyphlang.io/pillars/verifiability](https://glyphlang.io/pillars/verifiability/) |
82
+ | Source, issues, roadmap | [github.com/chadetov/glyph](https://github.com/chadetov/glyph) |
83
+
84
+ ## Status
85
+
86
+ Glyph is an **early preview** and moves fast. The compiler toolchain — `build`, `run`, `fmt`, `gen`, `regen`, `--explain` — works end to end, and every release is type-checked against `tsc --strict`. It is not yet recommended for production; it's ready for you to try, break, and tell us about. Every version's changes are at [glyphlang.io/versions](https://glyphlang.io/versions/).
87
+
88
+ **Stability while pre-1.0:** the language can still change between 0.1.x releases. We hold two lines: your code stays runnable (it always compiles to plain TypeScript you own, so there's a permanent escape hatch), and when syntax does change we aim to make `glyph fmt` migrate it for you. Full policy: [docs/stability.md](https://github.com/chadetov/glyph/blob/main/docs/stability.md).
89
+
90
+ ## Verifying your download
91
+
92
+ Releases are built in GitHub Actions and published with provenance, so you can
93
+ confirm an artifact came from this repo's workflow rather than a tampered copy:
94
+
95
+ ```sh
96
+ # npm packages: published with npm provenance (OIDC-signed)
97
+ npm audit signatures
98
+
99
+ # GitHub Release archives: SLSA build-provenance attestation
100
+ gh attestation verify glyph-<version>-<platform>.tar.gz --repo chadetov/glyph
101
+
102
+ # ...and a SHA-256 for each archive
103
+ sha256sum -c SHA256SUMS
104
+ ```
105
+
106
+ ## License
107
+
108
+ Dual-licensed under [Apache-2.0](https://github.com/chadetov/glyph/blob/main/LICENSE-APACHE) or [MIT](https://github.com/chadetov/glyph/blob/main/LICENSE-MIT), at your option.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@glyphlang/glyph",
3
- "version": "0.1.8",
4
- "description": "The Glyph compiler: a statically typed language that transpiles to TypeScript, designed so AI agents can read, write, and modify code safely.",
3
+ "version": "0.1.9",
4
+ "description": "TypeScript your AI agents can't quietly break: a statically typed language that transpiles to TypeScript, with no any, exhaustive matching, and runtime-checked types.",
5
5
  "bin": {
6
6
  "glyph": "bin/glyph.js"
7
7
  },
@@ -13,11 +13,11 @@
13
13
  "node": ">=18"
14
14
  },
15
15
  "optionalDependencies": {
16
- "@glyphlang/darwin-x64": "0.1.8",
17
- "@glyphlang/darwin-arm64": "0.1.8",
18
- "@glyphlang/linux-x64": "0.1.8",
19
- "@glyphlang/linux-arm64": "0.1.8",
20
- "@glyphlang/win32-x64": "0.1.8"
16
+ "@glyphlang/darwin-x64": "0.1.9",
17
+ "@glyphlang/darwin-arm64": "0.1.9",
18
+ "@glyphlang/linux-x64": "0.1.9",
19
+ "@glyphlang/linux-arm64": "0.1.9",
20
+ "@glyphlang/win32-x64": "0.1.9"
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",