more README tweaks

This commit is contained in:
NunoSempere 2024-12-30 23:25:03 +01:00
parent 58f6e73d3f
commit d3ed2ca8f3

View File

@ -1,24 +1,6 @@
# A terminal calculator for distributions, for Fermi estimation
# A DSL for Fermi estimation
This project is a minimalist, calculator-style DSL for fermi estimation. It can multiply, divide, add and subtract scalars, lognormals and beta distributions, and supports variables.
## Motivation
Sometimes, [Squiggle](https://github.com/quantified-uncertainty/squiggle), [simple squiggle](https://git.nunosempere.com/quantified.uncertainty/simple-squiggle) or [squiggle.c](https://git.nunosempere.com/personal/squiggle.c) are still too complicated and un-unix-like. In particular, their startup cost is not instant.
## Build instructions
Install the [go toolchain](https://go.dev/dl/), then:
```
git clone https://git.nunosempere.com/NunoSempere/fermi
cd fermi
make build
./fermi
# sudo make install
# fermi
```
This project is a minimalist, calculator-style DSL for fermi estimation. It can multiply, divide, add and subtract scalars, lognormals and beta distributions, and supports variables and mixtures.
## Usage
@ -36,6 +18,26 @@ beta 1 200 # fraction of people that have a piano
Here are some real-life examples: [Chance for a Russian male of fighting age of being drafted](https://x.com/NunoSempere/status/1829525844169248912), [did the startup Friend burn too much cash](https://x.com/NunoSempere/status/1818810770932568308), [how much did Nikita Bier make mentoring?](https://x.com/NunoSempere/status/1815169781907042504), [what fraction of North Korea's caloric intake is Russia supporting?](https://x.com/NunoSempere/status/1855666428835140078). In general, as a terminal guy, I've found that having zero startup cost makes creating small fermi models much cheaper, and thus happen more often.
## Build instructions
Install the [go toolchain](https://go.dev/dl/), then:
```
git clone https://git.nunosempere.com/NunoSempere/fermi
cd fermi
make build
./fermi
# sudo make install
# fermi
```
## Tips & tricks
- It's conceptually clearer to have all the multiplications first and then all the divisions
- For distributions between 0 and 1, consider using a beta distribution
- The default operation is multiplication
If you type "help" (or run fermi -h), you can see a small grammar and some optional command flags:
```
@ -93,27 +95,6 @@ $ fermi -h
```
## Tips & tricks
- It's conceptually clearer to have all the multiplications first and then all the divisions
- For distributions between 0 and 1, consider using a beta distribution
- The default operation is multiplication
### Command line options
You can specify the number of samples to draw when algebraic manipulations are not sufficient:
```
$ fermi -n 1000000
$ fermi -n 1_000_000
```
You also run a file with the -f option
```
$ fermi -f more/piano-tuners.fermi
```
### Integrations with Linux utilities
Because the model reads from standard input, you can pipe a model to it:
@ -128,7 +109,7 @@ In that case, you will probably want to use the echo flag as well
$ cat more/piano-tuners-commented.fermi | fermi -echo
```
You can make a model an executable file by running `$ chmod -x model.fermi` and then adding the following at the top!
You can make a model an executable file by running `$ chmod -x model.fermi` and then adding the following at the top, XD.
```
#!/bin/usr/fermi -f