[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-110872":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":27,"discoverSource":28},110872,"gojo","egoist\u002Fgojo","egoist","[experiment] The Gojo programming language","gojo.egoist.dev",null,"Rust",83,5,57,2,0,18,41.13,false,"main",true,[],"2026-11-10 11:01:56","2026-11-14 06:19:53","# Gojo\n\n**Documentation:** [Why Gojo](docs\u002Fwhy-gojo.md) · [A tour of Gojo](docs\u002Ftour.md) · [Standard library reference](docs\u002Fstd\u002FREADME.md) · [Language reference](docs\u002Fspec.md) · [Design notes](docs\u002Fdesign.md) · [Packages](docs\u002Fpackages.md)\n\nGojo is a small, fast-compiling systems programming language with no garbage collector and no nil. Ownership (without lifetime annotations) frees memory and rules out data races; errors are values (`T ! E`, `try`, `errdefer`); concurrency is structured (`scope`, `go`, channels, cancellation). It takes ideas from Rust, Zig, Swift, Kotlin and Go without following any of them.\n\nThis repository is a prototype compiler built from the [design notes](docs\u002Fdesign.md). The compiler is written in Rust (about 19,000 lines, no third-party dependencies). The C runtime is about 4,000 lines, and the Gojo standard library about 3,400 lines.\n\n```gojo\nuse std\u002Fos\n\nstruct Config {\n    name: String \u002F\u002F required\n    port: int = 8080 \u002F\u002F default value\n    proxy: ?String \u002F\u002F optional, defaults to none\n}\n\nfn load(path: str) -> Config ! os.Error {\n    let text = try os.readText(path)\n    Config{name: text.trim().toString()}\n}\n\nfn main() {\n    let cfg = load(\"app.toml\") catch e {\n        eprintln(\"using defaults:\", e)\n        .{name: \"app\"}\n    }\n    let backups = [8081, 80, 9000]\n        .filter(p => p > 1024)\n        .map(p => \":${p}\")\n    println(\"${cfg.name} on :${cfg.port}, backups ${backups.join(\", \")}, proxy: ${cfg.proxy ?? \"none\"}\")\n}\n```\n\n## Packages and imports\n\nThere is no `package` declaration. A directory is a package, and the package name is the directory name. The entry package of `gojo run` holds the `main` function. Imports use `use`, and paths are not quoted:\n\n```gojo\nuse std\u002F{fmt, os, time}        \u002F\u002F standard library: all under std, several per line\nuse .\u002Fgeom                     \u002F\u002F a package in this project: path relative to the current package directory\nuse ..\u002Fshared\u002Futil as u        \u002F\u002F nested path, renamed with as\nuse .\u002Fgeom.{Vec2, Shape}       \u002F\u002F bring names directly into scope; geom itself is not bound\n```\n\nThe start of the path tells you whether it is the standard library (`std\u002F`) or a package in the project (`.\u002F`), so the two never clash. `use std\u002Fos` binds the name `os`. `print`\u002F`println`\u002F`eprint`\u002F`eprintln` are in the prelude, so hello world needs no imports; `fmt` only holds formatting functions such as `fmt.sprint` and `fmt.format`. An unused import (including a name inside `.{...}`) is a compile error.\n\n## Methods\n\nMethods are written together with their type. The receiver is an explicit `self`:\n\n```gojo\nstruct Counter {\n    n: int = 0\n\n    fn new(start: int) -> Counter {        \u002F\u002F no self: associated function, Counter.new(10)\n        return Counter{n: start}\n    }\n\n    fn value(self) -> int {               \u002F\u002F borrow\n        return self.n\n    }\n\n    fn bump(inout self) {              \u002F\u002F mutable borrow\n        self.n += 1\n    }\n}\n\nextend Counter {                         \u002F\u002F add methods, e.g. in another file of the same package\n    fn reset(inout self) { self.n = 0 }\n}\n\ninterface Bumper {\n    fn bump(inout self)                \u002F\u002F interface methods use the same syntax\n}\n```\n\n## Installation\n\nGojo supports macOS and Linux (x86-64, arm64). It **does not support Windows** (the runtime depends on POSIX). Gojo compiles to C, so you need a C compiler: `cc`, `clang`, `gcc` or `zig` on `PATH` (searched in that order; on macOS run `xcode-select --install`; cross-compilation uses `zig`).\n\nA release archive contains a statically linked `gojo` executable (with the standard library and runtime compiled in), plus the docs and examples:\n\n```sh\ncurl -fsSL https:\u002F\u002Fgithub.com\u002Fegoist\u002Fgojo\u002Freleases\u002Flatest\u002Fdownload\u002Finstall.sh | sh\nsh scripts\u002Finstall.sh --archive dist\u002Fgojo-0.1.0-macos-arm64.tar.gz    # or install a local archive\ncurl -fsSL https:\u002F\u002Fgithub.com\u002Fegoist\u002Fgojo\u002Freleases\u002Fdownload\u002Fnightly\u002Finstall.sh | sh -s -- --nightly   # the latest nightly build\n```\n\nIt installs to `~\u002F.gojo` (change it with `GOJO_HOME`). `gojo version` shows the version. Building from source only needs the Rust toolchain: `cargo build --release`.\n\n## Quick start\n\n```sh\ncargo build --release\n.\u002Ftarget\u002Frelease\u002Fgojo run examples\u002Fhello.gojo\n.\u002Ftarget\u002Frelease\u002Fgojo run examples\u002Fjson.gojo\n.\u002Ftarget\u002Frelease\u002Fgojo run examples\u002Fshapes        # one directory = one package, with the subpackage geom\n.\u002Ftarget\u002Frelease\u002Fgojo test examples\u002Fshapes       # run test \"...\" { } blocks\n```\n\n| Command | What it does |\n| --- | --- |\n| `gojo run \u003Cfile-or-dir> [args...]` | Compile and run |\n| `gojo build \u003Cfile-or-dir> [-o output]` | Build a native binary |\n| `gojo check \u003Cfile-or-dir> [--json]` | Type check and borrow check only; `--json` prints each diagnostic as a line of JSON, with the edits that fix it where there is one obvious fix (`&` for an `inout` argument, `_` for an unused variable, the move for a needless clone) |\n| `gojo test \u003Cfile-or-dir>` | Run `test` blocks; each test runs in its own process, so a panic does not affect other tests |\n| `gojo fmt [--check] [file-or-dir...]` | Format in place (current directory by default); `--check` only lists unformatted files and exits with code 1 if there are any |\n| `gojo doc [module-or-path] [--out dir]` | API docs in Markdown: the standard library index, one standard library module, or one package; `--out` writes the whole standard library to a directory (that is, [`docs\u002Fstd`](docs\u002Fstd\u002FREADME.md)) |\n| `gojo emit-c \u003Cfile-or-dir>` | Print the generated C code |\n| `gojo init [name]` | Write a `gojo.toml` (package manifest, see [`docs\u002Fpackages.md`](docs\u002Fpackages.md)) in the current directory |\n| `gojo claims \u003Cfile-or-dir> [--json]` | What the compiler proved, function by function: the bounds checks it removed and the ones that stay (`checkfree fn` makes any that stay an error; `requires` adds facts) |\n| `gojo spec` | The whole language on one page ([`docs\u002Fbrief.md`](docs\u002Fbrief.md)), sized for a coding agent's context |\n| `gojo version` | Version, commit and target platform |\n\nOptions: `--release` (`-O2`; overflow checks stay on), `--cc \"\u003Ccompiler flags>\"`, `--target \u003Ctriple>` (cross-compile with `zig cc`; for example `--target x86_64-linux-musl` gives a static Linux binary directly), `-v` (print the time of each phase).\n\n## Safety guarantees, and how they are enforced\n\nEvery check looks only at function signatures and a single function body. There is no cross-function inference and there are no lifetime annotations. Each guarantee has compile-error tests (`tests\u002Ferrors\u002F`, 153 in total).\n\n| Guarantee | Mechanism | Typical error |\n| --- | --- | --- |\n| No nil | Only `?T` can be empty, and it must be unwrapped before use | `` undefined: `nil` `` \u002F `` `none` is not a value of type `int` `` |\n| No use after free | Move semantics + a \"maybe moved\" data-flow analysis; loops run twice to find moves from the previous iteration | `` use of `s` after it was moved `` \u002F `moved here in a previous iteration of the loop` |\n| References do not dangle | References can only be parameters, projections (`yield`) or block-scoped bindings. Views (`str`, `[]T`) live only in variables, as do `view struct`s and `Vec`\u002F`Map`s of views that hold them; they cannot go into ordinary fields, boxes, interface values or escaping closures (inferred types included). A struct can keep views of its own frozen field (`words: Vec[str] of text`), and is then an ordinary value that can be stored and returned. When a view is assigned to an outer variable, the borrowed value must live at least as long. A view of data inside a lock cannot leave the `with` block | `this temporary value is dropped at the end of the statement` \u002F `` returns a view of `s` `` \u002F `` `s` does not live long enough `` |\n| Iterators are not invalidated | `for`\u002F`with`\u002F`if let` bindings hold a borrow inside the block | `` cannot modify `v` while it is borrowed by `x` `` |\n| Exclusive mutable borrows | Arguments of the same call are checked for overlap; `inout` must be written with `&` at the call site | `` `a` is used by two arguments of the same call `` |\n| No data races at compile time | `send` is derived from the structure of the type; `Rc`\u002F`Cell`\u002Fraw pointers cannot cross tasks; a variable a task changes is borrowed by that task alone until its scope ends (or the range of it the task uses); shared mutable state goes through a `Mutex`, `RwLock` or `Atomic` | `` a task captures `r` of type `Rc[int]`, which is not safe to share between threads `` \u002F `` cannot use `total`: a task modifies it until its scope ends `` |\n| Linear values are consumed | A `linear struct` is never dropped implicitly: every path must hand it to a `sink` parameter (its `commit`\u002F`rollback`), return it, or store it in something consumed in turn; a `defer` that consumes it runs only while it is still there | `` `tx` is not consumed: the linear `Tx` would be dropped by this `return` `` |\n| Errors must be handled | An unhandled `T ! E` is a compile error; to discard it, write `_ = f()` | `` result of type `! String` is not handled `` |\n| Exhaustive matching | Based on the usefulness algorithm; reports the exact missing pattern | `` `match` is not exhaustive: `Rect(_, _)` is not covered `` |\n| Runtime checks | Integer overflow, out-of-bounds index, division by zero, out-of-range shift, out-of-range numeric conversion and a failed `unwrap` all panic and report the call site | `panic: integer overflow in addition` |\n\nAlso: `let` is immutable; shadowing within one function is not allowed; unused variables and imports are errors; a `copy` type cannot contain fields that need to be freed; recursive types of infinite size are errors; calling an `extern` function or an `unsafe fn` and dereferencing a raw pointer must happen inside an `unsafe` block, and an `unsafe` block that needs none of these is an error.\n\nThe memory safety of the generated code is verified separately. All test programs run clean under AddressSanitizer + UndefinedBehaviorSanitizer (`cargo test -- --ignored`), and macOS `leaks` finds no leaks. The checks themselves have also been attacked systematically: `gojo-fuzz` runs mutation fuzzing and differential testing against the compiler (see \"Testing\" below), and a separate set of hand-built programs tries to get around the borrow checker. Every hole found has been fixed and added to `tests\u002Ferrors\u002F`.\n\n## Implemented language features\n\n- **Basics**: `let`\u002F`var`, package-level `let` values (computed once, on first use), `for x in xs`, `for i in 0..n`, `while cond {}`, `loop {}`, loop labels (`outer: for ...`, `break outer`), `if`\u002F`match`\u002Fblocks as expressions (a function body's last expression is its result), `defer` (block-scoped), `errdefer`, `const`, type aliases and newtypes (`type Celsius f64`; operators are kept when the underlying type is a number), closures `x => x * 2` and `(a, b) => a + b`, string interpolation checked at compile time (`\"${name}: ${total:.2}\"`), method chains written one step per line (a line starting with `.name` continues the one before).\n- **Types**: all scalars, tuples (`(int, String)`, `let (q, r) = divmod(a, b)`, `t.0`, tuple patterns), `String`\u002F`str`, `Vec[T]`\u002F`[]T` (a slice is read-only unless it is an `inout []T`), `[N]T`, `Map[K, V]`, `?T`, `T ! E`, `Box`, `Rc`\u002F`Weak`, `Arc`, `Cell`, `Mutex`, `RwLock`, `Atomic`, channels (`Chan[T]`, `Sender[T]`, `Receiver[T]`), `Task[T]`, `Iso[T]`, function types (`fn`, `send fn`), `*T`.\n- **Methods**: written inside the braces of a `struct`\u002F`enum`; the first parameter, `self`, carries the receiver mode. Associated functions: `Stack[String].new()` (generic arguments can be inferred from the expected type); a type with a `new` function is called like one, `Stack[String]()`, `RwLock(x)`, `Atomic(0)`. `extend T { ... }` adds methods; the standard library also uses it to add methods to built-in types and to specific instances of them (such as `extend []String`).\n- **Collections**: `[a, b]` lists (a `Set` where one is expected), `[\"k\": v]` \u002F `[:]` maps, and `if` \u002F `for` \u002F `..` elements inside list literals, so built data keeps its shape: `[header, if let e = err { Text{text: e.clone()} }, for t in todos { row(t) }, ..footer()]` (see [`examples\u002Fui`](examples\u002Fui)).\n- **Structs and enums**: field defaults (a missing required field is a compile error), `copy struct`, automatic copy derivation for package-private types, sum-type enums, `.Variant` shorthand and `.{field: v}` literals typed by the context, `P{x, y}` field shorthand, struct embedding (fields and methods are promoted).\n- **Ownership**: three parameter modes (borrow \u002F `inout` \u002F `sink`), deterministic destruction (reverse scope order, `drop` method, `drop(x)`), partial moves, conditional moves (flags are inserted only when needed), `.clone()`. Linear types (`linear struct Tx`) that must be consumed, never dropped, with guarded `defer tx.rollback()`.\n- **Projections**: `yield &T` \u002F `yield inout T` \u002F `yield ?&T` functions. `v[i]`, `m.get(k)`, `m.entry(k)` and `mu.lock()` are all projections, and the reference they lend cannot leave the block. References and views bound with `let` stop holding the borrowed value after their last use. Views can be returned (`-> str of src`, or inferred), collected (`Vec[str]`, `Map[str, int]`), and grouped in `view struct`s, all living in variables; a struct keeps views of its own frozen field (`words: Vec[str] of text`) to store them long-term. Data borrowed from another long-lived value is kept as `Span` ranges.\n- **Generators**: `gen fn lines(src: str) -> str { ... yield src[a..b] ... }` consumed by `for l in lines(text)`; recursive and nested generators, `break`\u002F`return` from the loop stop them; compiled to the push protocol (a call per value, no coroutine).\n- **Custom iteration**: a cursor protocol (`cursor` + `next`\u002F`nextMut`; `zip` and merging just advance several cursors together) and a push protocol (`each`\u002F`eachMut`, suited to recursive structures such as trees). In both protocols `break`, `continue`, `return`, `try` and labeled jumps work as usual.\n- **Error handling**: `try`, `try x else Wrap`, `catch e { ... }`, `match` destructuring of `ok`\u002F`err`, `try` on `?T`, `??`, `?.` for fields and method calls, `if let x { }` to unwrap a variable in place.\n- **Interfaces**: structural, implicit satisfaction; interface values (heap box + vtable); borrowed interface parameters (fat pointer, no allocation); mutable-receiver methods such as `fn bump(inout self) -> int`; `match` branching on the concrete type; embedded interfaces; constraint interfaces with type sets (`~int | ~f64`).\n- **Static reflection**: `static for f in fields(T)` with `x.[f]` and `f.name`, `static if T: Integer`, `static if let v: Vec[_] = x`, `static if T is String`, and `static T{f => ...}`: serializers and decoders written once for every type, checked once like other generic code (no macros, no compile-time evaluation).\n- **Generics**: generic functions\u002Fstructs\u002Fenums, methods with their own type parameters, `where`-conditional methods, built-in capability constraints (`copy`, `clone`, `default`, `send`, `comparable`, `ordered`, `hash`), local bidirectional inference (including closure return types), integer const generics (`Mat[R, C]`; mismatched dimensions are a compile error). A type with custom `equal`\u002F`hash`\u002F`compare` methods can be a Map key or be sorted.\n- **Concurrency**: tasks are stackful coroutines with M:N scheduling, started with `go` inside a `scope`, which waits for them; they borrow what outlives the scope (down to disjoint ranges of one slice: `go psort(&v[..p])` and `go psort(&v[p + 1..])`), `let t = go f()` gives a handle whose `t.join()` returns the result, and a failing task cancels the others (`try scope { }`). `par for`, `task.map`\u002F`each`\u002F`race`, `send fn`. Channels with two ends that close when the last sender is dropped; `select` over channels, tasks, timers (`time.after`) and cancellation, with guards. `Mutex`, `Mutex(&x)`, `RwLock`, `with a, b = lock(m1, m2)`, `Atomic`, `send interface`, `isolate { }` and inferred isolation (an `Rc` graph nothing else reaches may be moved into a task), task-local values (`task.local`, `task.with`); waiting inside a lock block is an error. Preemption after 10 ms of running while others wait; C calls hand the CPU to other threads. A file read that has to wait parks its task: pipes and terminals on the poller, disk reads through io_uring on Linux. Parked tasks' stacks are hibernated (100,000 idle tasks: 0.2 GB on macOS).\n- **Cancellation**: propagates along the task tree (a failing task, `s.cancel()`, a deadline from `task.timeout`, Ctrl-C for the whole program); blocking operations in a cancelled task return immediately; `task.reason()`, `task.deadline()`, `task.shield`, `try task.check()`; `drop` methods run shielded so cleanup that blocks still happens.\n- **Diagnosing and testing**: deadlocks are reported with every task, what it waits for and which task holds the lock; `task.dump()` and SIGQUIT print the same; debug builds warn about locks taken in opposite orders. `gojo test` runs on a seeded simulated scheduler with virtual time; `--explore n` finds an interleaving that fails and prints the seed that replays it. The network is simulated in tests, in memory with seeded delays and short reads, and `--faults` adds connection resets, refused dials, lost datagrams and disk errors (TigerBeetle's VOPR idea, for every program).\n- **Networking**: `net.listen`\u002F`accept`\u002F`dial`. Reads and writes on a `Conn` do not block the thread and can be cancelled. [`examples\u002Fhttp`](examples\u002Fhttp) is an HTTP\u002F1.1 server with request timeouts, cancellation when the client disconnects, and cancellation of in-flight requests on shutdown.\n- **unsafe and FFI**: `extern \"C\" lib \"libz\" { ... }` uses `dlopen` at run time, so the build needs no C headers. Without `lib`, calls go directly to libc. `extern \"C\" static` links statically (this also works in static musl binaries). `extern \"C\" fn` exports a Gojo function. With `unsafe send struct` the author vouches for thread safety. Types with no C representation (`String`, function values, etc.) cannot appear in `extern` signatures. `unsafe fn` marks a function whose callers uphold what the compiler can't check (its body is checked as usual). The reference lists what unsafe code must never do. `gojo unsafe` lists the unsafe code of every package, and a dependency with any builds only when `gojo.toml` allows it (`[unsafe] allow`; `forbid = true` for the package's own code). C may keep pointers into task stacks: `.ptr()` pins the stack it points into, so hibernation leaves it alone.\n- **What dependencies may do**: `[authority]` in `gojo.toml` limits which dependencies may use files, environment variables, other programs or the network (`leftpad = []`, `s3 = [\"net\"]`). It is checked at compile time against the calls in each package and everything it depends on; values handed in (an open `os.File`) still work. `gojo authority` shows what each dependency uses and the table that allows exactly that.\n- **Standard library**: prelude (Option\u002FResult\u002Fstring\u002Fslice\u002FVec\u002FMap\u002F`Set` methods, `Arena[T]` + `Id[T]` with generations, `Hasher`), `fmt` (including `fmt.format` with compile-time-checked templates), `io` (a common error type and `Reader`\u002F`Writer`), `bufio`, `os` (files, directories, environment variables, child processes), `time` (monotonic clock, dates, formatting and parsing), `json`, `yaml` and `toml` (to and from your own types), `net` (TCP, UDP, DNS), `http` (server and client, keep-alive, TLS), `tls`, `task`, `math`, `strings`, `rand`, `path`, `hex`, `base64`, `url`, `csv`, `binary`, `collections`, `crypto`, `crc32`, `regex`, `flag`, `log`. The method signatures of built-in types are written in Gojo in `std\u002Fprelude.gojo`; `map`\u002F`filter`\u002F`fold`\u002F`join`\u002F`Arena`\u002F`Set` there, and modules such as `bufio`, `json` and `http`, are themselves Gojo code. The module APIs are in section 12 of [`docs\u002Fspec.md`](docs\u002Fspec.md). [`examples\u002Ftodo`](examples\u002Ftodo) (a JSON API service) and [`examples\u002Fgrep`](examples\u002Fgrep) (a command-line tool) are written using only the standard library.\n\nThe programs under `tests\u002Frun\u002F` cover all of the features above and can be read as language examples. The exact language rules are in [`docs\u002Fspec.md`](docs\u002Fspec.md); each section lists the tests that cover it.\n\n## Implementation layout\n\n```\nsrc\u002Flexer.rs      lexing (newlines end statements; string interpolation)\nsrc\u002Fparser.rs     recursive-descent parsing\nsrc\u002Fcheck\u002F        declaration collection, type resolution and capability rules (mod.rs)\n                  function body type checking → typed IR (body.rs)\n                  patterns, match, exhaustiveness (pattern.rs)\nsrc\u002Fborrowck.rs   ownership and borrow checking (per function, single pass + two passes over loops; plus two whole-program checks:\n                  values that cannot store views, generic functions that keep type parameters)\nsrc\u002Fcodegen.rs    IR → C: monomorphization, destructor insertion, vtables, closures, built-in functions\nsrc\u002Flib.rs        library interface of the front end (shared by the driver and the fuzzer); src\u002Fmain.rs is the `gojo` command\nsrc\u002Fbin\u002Fgojo-fuzz mutation fuzzing, differential testing (progen.rs generates random programs), borrow checker attacks (borrowgen.rs), reduction\nruntime\u002F          C runtime: strings, Vec, insertion-ordered hash map, small-object allocator, panic, FFI (gojo_rt.c);\n                  M:N scheduler, context switching, channels, select, mutex, scopes, task handles and\n                  cancellation, timers, kqueue\u002Fepoll network polling, stack hibernation, task dumps and\n                  deadlock reports, the simulated scheduler for tests (gojo_sched.c)\nstd\u002F              standard library written in Gojo (compiled into the binary)\n```\n\nThe back end generates C and then calls the system C compiler. The runtime library is compiled once per (compiler, flags) pair and cached in `~\u002F.cache\u002Fgojo`. Generated binaries are cached by the hash of the C source; when the source is unchanged, a repeated `run` takes about 10 ms.\n\n## Performance\n\n[`bench\u002F`](bench\u002FREADME.md) has equivalent Gojo \u002F Go \u002F Zig implementations of 8 common benchmarks (fib, binary-trees, nbody, spectral-norm, fannkuch-redux, mandelbrot, hashmap, sort). `bench\u002Frun.sh` first checks that the outputs of all three agree, then measures. Results on an Apple M5:\n\n- Run time (geometric mean): Gojo takes 0.78× the time of Go, 0.80× of Zig ReleaseSafe and 0.87× of Zig ReleaseFast, with overflow and index checks on. binary-trees benefits from Gojo's small-object allocator; without it the figures are 0.87×, 0.94× and 1.03×.\n- Of the 8 benchmarks, Gojo is fastest on binary-trees, mandelbrot, hashmap and sort. The gap on fib is the cost of the overflow checks themselves (on par with Zig ReleaseSafe). nbody is on par with Go and slower than Zig.\n- Compile time: `gojo build` of nbody takes about 50 ms (about 3 ms of it in the front end), `go build` 97 ms, `zig build-exe` Debug 924 ms.\n\nOn a 40,000-line synthetic program, the Gojo front end takes about 66 ms (parsing 23 ms, type checking 34 ms, borrow checking 3 ms, C generation 6 ms).\n\nConcurrency (see [bench\u002FREADME.md](bench\u002FREADME.md#goroutine)): 100,000 simultaneously suspended tasks passing a value along a chain take 0.38 s \u002F 441 MB with Gojo and 0.11 s \u002F 284 MB with Go on Linux. 100,000 tasks parked for seconds take 0.2 GB on macOS (1.7 GB without hibernation). 1,000,000 short-lived tasks (in batches of 1,000) take 0.43 s with Gojo and 0.26 s with Go.\n\n## Not yet implemented\n\n- Windows; a language server (LSP); a package registry and version resolution (for now `gojo.toml` dependencies are local paths, and workspaces share one manifest). The debugger can set breakpoints on Gojo lines and show the call stack, but variable names are the names in the generated C (`p_x`, `l0_total`).\n- Networking has TCP, UDP and DNS; HTTP\u002F1.1 over TCP or TLS, with keep-alive on both sides. No HTTP\u002F2 or HTTP\u002F3, and no Unix-socket listeners.\n- On Linux kernels before 6.13, each task uses two memory mappings. The default `vm.max_map_count` (262144) supports about 130,000 live tasks; beyond that you get an error suggesting you raise it.\n- `#specialize`, PGO.\n- `saturatingAdd`, pointer arithmetic, `unsafe.cast` and `unsafe.forget` from the design notes, and passing Gojo functions to C as callbacks (`extern \"C\" fn` can currently only be exported and called directly).\n- Separate compilation per package and caching of export data (for now everything is compiled as a whole each time; the front-end speed and the binary cache make up for it).\n- Interface values and function values do not satisfy `send` (conservative); a closure passed to `go` is checked separately based on what it captures.\n\n## Testing\n\n```sh\ncargo test                  # run programs and compare output, compile-error cases, runtime panic cases\ncargo test -- --ignored     # run all programs under ASan + UBSan, and concurrent programs under TSan\n```\n\n- `tests\u002Frun\u002F*.gojo`: programs and their expected output `.out`\n- `tests\u002Ferrors\u002F*.gojo`: must fail to compile; `\u002F\u002F error: ...` comments list the expected errors\n- `tests\u002Fpanic\u002F*.gojo`: must panic with exit code 2 and report the call site\n- `tests\u002Fprojects\u002F*\u002F`, `examples\u002F*\u002F`: multi-package projects, compared against `expected.out` or `expected.err`\n- `tests\u002Ffuzz\u002F*.gojo`: compiler crashes found by fuzzing (reduced); each must produce a diagnostic or compile successfully\n- `tests\u002Funsafe\u002F*.gojo`: 151 hand-built programs that try to get around the safety checks; all must be rejected\n\n### Fuzzing\n\n```sh\ncargo build --profile fuzz              # optimized build that keeps debug assertions and overflow checks\ntarget\u002Ffuzz\u002Fgojo-fuzz --jobs 4          # mutation fuzzing: compiler crashes, timeouts, generated C that fails to compile, ASan errors\ntarget\u002Ffuzz\u002Fgojo-fuzz diff --jobs 2     # differential testing: random programs must give the same result in debug \u002F release \u002F sanitizer builds\ntarget\u002Ffuzz\u002Fgojo-fuzz borrow --jobs 2   # borrow checker: random programs that juggle views; accepted ones must be clean under ASan\ntarget\u002Ffuzz\u002Fgojo-fuzz fmt 6000         # formatter: tokens unchanged, output stable, independent of the original indentation\ntarget\u002Ffuzz\u002Fgojo-fuzz toml 200000      # gojo.toml reader: mutated manifests must not make it panic\ntarget\u002Ffuzz\u002Fgojo-fuzz reduce fuzz-out\u002Ffindings\u002Fxxx.gojo   # reduce a reproducer\n```\n\nResults go to `fuzz-out\u002Ffindings\u002F`. Rules and limits are in section 15 of [`docs\u002Fspec.md`](docs\u002Fspec.md).\n\n## Releases\n\n`scripts\u002Frelease.sh` builds four release archives on a Mac (`macos-arm64`, `macos-x86_64`, `linux-x86_64`, `linux-arm64`; the Linux ones are statically linked against musl with `cargo zigbuild`), plus `SHA256SUMS`, `VERSION` and `install.sh`, in `dist\u002F`. When a `vX.Y.Z` tag is pushed, `.github\u002Fworkflows\u002Frelease.yml` does the same and creates a GitHub release (versions containing `-` are marked as prerelease). `ci.yml` runs the tests on Linux (x86-64, arm64) and macOS, and also runs the sanitizers on Linux.\n\nEvery night (03:00 UTC), `.github\u002Fworkflows\u002Fnightly.yml` takes the newest commit on `main` that passed `ci.yml` and, if the code (`src`, `runtime`, `std`, `examples`, the build files, `release.sh`, `install.sh`) changed since the previous nightly, builds it and replaces the `nightly` prerelease and its tag. A nightly's version is Cargo.toml's with `-nightly.YYYYMMDD` appended (`GOJO_VERSION` overrides the version for `release.sh` and `gojo version`). Running the workflow by hand publishes now; its `force` option publishes even without code changes.\n","Gojo 是一门实验性的系统编程语言，旨在兼顾安全性、性能与开发体验。它采用无垃圾回收、无 nil 值的设计，通过基于所有权的内存管理（无需显式生命周期标注）避免内存泄漏和数据竞争；错误处理以值语义表达（T ! E 类型、try\u002Ferrdefer）；并发模型支持结构化作用域（scope）、轻量协程（go）和通道。编译器用 Rust 实现，零第三方依赖，C 运行时精简。适用于需要强内存安全、低延迟和可控资源开销的嵌入式、工具链或基础设施组件开发场景。","2026-11-25 04:44:41","CREATED_QUERY"]