add spec for more expressive DSL

This commit is contained in:
NunoSempere 2024-06-03 09:28:16 +02:00
parent 2262d5b617
commit 09583a312c

View File

@ -105,3 +105,22 @@ Conceptually clearer to have all the multiplications first and then all the divi
- [ ] Think of some way of calling bc
- [ ] Think how to integrate with squiggle.c to draw samples
- [ ] Think about how to draw a histogram from samples
- [x] Display output more nicely, with K/M/B/T
- [ ] Consider the following: make this into a stack-based DSL, with:
- Variables that can be saved to and then displayed
- Other types of distributions, particularly beta distributions? => But then this requires moving to bags of samples. It could still be ~instantaneous though.
Some possible syntax for a more expressive stack-based DSL
```
1B to 20B
* 1 to 100
/ beta(1, 2)
=: x # content of the stack at this point saved into x
1 to 10
10 to 100
=: y # content of the stack at this point saved into y
x - 10B * y # if interpreting x and y as list of samples, you could do - and + operations as well
```