forked from personal/squiggle.c
clean up README a bit more
This commit is contained in:
parent
2740413bb4
commit
ab97e6ce3e
14
README.md
14
README.md
|
@ -37,8 +37,6 @@ Caveats: Parallelism might hide monsters. The histogram function is pretty but w
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
### Example upfront
|
|
||||||
|
|
||||||
Download squiggle.c, for instance:
|
Download squiggle.c, for instance:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
@ -52,7 +50,7 @@ $ mv squiggle* temp
|
||||||
$ mv temp squiggle_c
|
$ mv temp squiggle_c
|
||||||
```
|
```
|
||||||
|
|
||||||
Write your model. The below is an overcomplicated example, because it has a long digression in the middle, which I think is funny. May change:
|
Write your model. For instance, your could replicate [this paper](https://arxiv.org/abs/1806.02404) as follows:
|
||||||
|
|
||||||
```C
|
```C
|
||||||
#include "squiggle_c/squiggle.h"
|
#include "squiggle_c/squiggle.h"
|
||||||
|
@ -135,7 +133,6 @@ double sample_are_we_alone_logspace(uint64_t * seed)
|
||||||
// log_n > 0 => n > 1
|
// log_n > 0 => n > 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -155,7 +152,6 @@ int main()
|
||||||
|
|
||||||
free(seed);
|
free(seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Compile and run:
|
Compile and run:
|
||||||
|
@ -174,13 +170,13 @@ The recommended strategy is to:
|
||||||
3. Produce an array of samples from a sampler function
|
3. Produce an array of samples from a sampler function
|
||||||
4. Get summary statistics for that array of samples.
|
4. Get summary statistics for that array of samples.
|
||||||
|
|
||||||
### Examples
|
### More examples
|
||||||
|
|
||||||
You can follow some example usage in the [examples/](examples]) folder. In [examples/core](examples/core/), we build up some functionality, starting from drawing one sample and finishing with a replication of [Dissolving the Fermi paradox](https://arxiv.org/abs/1806.02404). In [examples/more](examples/more), we present a few more complicated examples, like finding confidence intervals, a model of nuclear war, an estimate of how much exercise to do to lose 10kg, or an example using parallelism.
|
You can follow some example usage in the [examples/](examples]) folder. In [examples/core](examples/core/), we build up some functionality, starting from drawing one sample and finishing with the replication of [Dissolving the Fermi paradox](https://arxiv.org/abs/1806.02404) above. In [examples/more](examples/more), we present a few more complicated examples, like finding confidence intervals, a model of nuclear war, an estimate of how much exercise to do to lose 10kg, or an example using parallelism.
|
||||||
|
|
||||||
## Guarantees
|
## Guarantees
|
||||||
|
|
||||||
The motte:
|
The bad:
|
||||||
|
|
||||||
- I offer no guarantees about stability, correctness, performance, etc. I might, for instance, abandon the version in C and rewrite it in Zig, Nim, Rust, Go.
|
- I offer no guarantees about stability, correctness, performance, etc. I might, for instance, abandon the version in C and rewrite it in Zig, Nim, Rust, Go.
|
||||||
- This project mostly exists for my own usage & for my own amusement.
|
- This project mostly exists for my own usage & for my own amusement.
|
||||||
|
@ -188,7 +184,7 @@ The motte:
|
||||||
- If you wanted to pay me to provide some stability or correctness, guarantees, or to tweak this library for your own usage, or to teach you how to use it, you could do so [here](https://nunosempere.com/consulting).
|
- If you wanted to pay me to provide some stability or correctness, guarantees, or to tweak this library for your own usage, or to teach you how to use it, you could do so [here](https://nunosempere.com/consulting).
|
||||||
- I am conflicted about parallelism. It *does* add more complexity, complexity that you can be bitten by if you are not careful and don't understand it. And this conflicts with the initial grug-brain motivation. At the same time, it is clever, and it is nice, and I like it a lot.
|
- I am conflicted about parallelism. It *does* add more complexity, complexity that you can be bitten by if you are not careful and don't understand it. And this conflicts with the initial grug-brain motivation. At the same time, it is clever, and it is nice, and I like it a lot.
|
||||||
|
|
||||||
The bailey:
|
The good:
|
||||||
|
|
||||||
- You can vendor the code, i.e., save it as a dependency together with your other files. This way, this renders you immune to any changes I may make.
|
- You can vendor the code, i.e., save it as a dependency together with your other files. This way, this renders you immune to any changes I may make.
|
||||||
- I've been hacking at this project for a while now, and I think I have a good grasp of its correctness and limitations. I've tried Nim and Zig, and I prefer C so far.
|
- I've been hacking at this project for a while now, and I think I have a good grasp of its correctness and limitations. I've tried Nim and Zig, and I prefer C so far.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user