2020-10-25 20:27:54 +03:00
|
|
|
#### Benchmark suite for pretty printing
|
2020-10-03 11:38:29 +03:00
|
|
|
|
|
|
|
|
Files:
|
|
|
|
|
|
2020-10-25 20:27:54 +03:00
|
|
|
- `p.ml` -- an implementation of pretty-printer in meta-language
|
2020-10-03 11:38:29 +03:00
|
|
|
- `pp_default.m4` -- macro that converts `p.ml` into strightforward pretty printer
|
|
|
|
|
- `pp_gt.m4` -- a macro that converts `p.ml` into GT-based pretty printer
|
2020-10-25 20:27:54 +03:00
|
|
|
- `bench_main.ml` -- runner of benhcmark1
|
|
|
|
|
- `demo_infix.ml` -- demo about infix operator pretty printing
|
|
|
|
|
|
|
|
|
|
Compilation: hit `make`.
|
|
|
|
|
|
|
|
|
|
###### Benchmark `bench.exe`
|
|
|
|
|
|
|
|
|
|
Searches for input files in `../stdlib` or `./stdlib` and measures two pretty-printers:
|
|
|
|
|
|
|
|
|
|
- straightforward one from `Pprint_default.ml` (generated by `pp_default.m4` from `p.ml`)
|
|
|
|
|
- the one using our approach: `Pprint_gt.ml` (generated by `pp_gt.m4` from `p.ml`)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
###### demo `demo_infix.exe`
|
|
|
|
|
|
|
|
|
|
Pretty prints a small piece of code by two approaches:
|
|
|
|
|
|
|
|
|
|
- generated using our approach: `Pprint_gt.ml`
|
|
|
|
|
- modified `Pprint_gt.ml`: we are printing infix names in a prettier way. It is not possible to modify straightforward approach without pain
|