summaryrefslogtreecommitdiff
path: root/libguile/whippet/README.md
blob: 9ef9e3cc95ea85f3215e5ebea77e45db30b87087 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Whippet Garbage Collector

This repository is for development of Whippet, a new garbage collector
implementation, eventually for use in [Guile
Scheme](https://gnu.org/s/guile).

Whippet is an embed-only C library, designed to be copied into a
program's source tree.  It exposes an abstract C API for managed memory
allocation, and provides a number of implementations of that API.

## Documentation

See the [documentation](./doc/README.md).

## Features

 - Per-object pinning (with `mmc` collectors)
 - Finalization (supporting resuscitation)
 - Ephemerons (except on `bdw`, which has a polyfill)
 - Conservative roots (optionally with `mmc` or always with `bdw`)
 - Precise roots (optionally with `mmc` or always with `semi` / `pcc`)
 - Precise embedder-parameterized heap tracing (except with `bdw`)
 - Conservative heap tracing (optionally with `mmc`, always with `bdw`)
 - Parallel tracing (except `semi`)
 - Parallel mutators (except `semi`)
 - Inline allocation / write barrier fast paths (supporting JIT)
 - One unified API with no-overhead abstraction: switch collectors when
   you like
 - Three policies for sizing heaps: fixed, proportional to live size, and
   [MemBalancer](http://marisa.moe/balancer.html)

## Source repository structure

 * [api/](./api/): The user-facing API.  Also, the "embedder API"; see
   the [manual](./doc/manual.md) for more.
 * [doc/](./doc/): Documentation, such as it is.
 * [src/](./src/): The actual GC implementation, containing a number of
   collector implementations.  The embedder chooses which collector to
   use at compile-time.  See the [documentation](./doc/collectors.md)
   for more on the different collectors (`semi`, `bdw`, `pcc`, and the
   different flavors of `mmc`).
 * [benchmarks/](./benchmarks/): Benchmarks.  A work in progress.
 * [test/](./test/): A dusty attic of minimal testing.

## Status and roadmap

As of January 2025, Whippet is good to go!  Of course there will surely
be new features to build as Whippet gets integrated it into language
run-times, but the basics are there.

The next phase on the roadmap is support for tracing, and
some performance noodling.

Once that is done, the big task is integrating Whippet into the [Guile
Scheme](https://gnu.org/s/guile) language run-time, replacing BDW-GC.
Fingers crossed!

## About the name

It sounds better than WIP (work-in-progress) garbage collector, doesn't
it?  Also apparently a whippet is a kind of dog that is fast for its
size.  It would be nice if the Whippet collectors turn out to have this
property.

## License

```
Copyright (c) 2022-2024 Andy Wingo

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```

Note that some benchmarks have other licenses; see
[`benchmarks/README.md`](./benchmarks/README.md) for more.