links-lang / links

Links: Linking Theory to Practice for the Web
http://www.links-lang.org
Other
329 stars 42 forks source link

use OPAM pprint package #939

Open jamescheney opened 3 years ago

jamescheney commented 3 years ago

PP.ml is an implementation of Wadler-style pretty printing adapted to a call by value language. The OPAM package pprint appears to be similar enough that we could use it instead with few changes.

We are currently using PP.ml only in irtojs where it is used to pretty print JavaScript code. It might make sense to use the pprint library in other places, such as for SQL printing, instead of the current rather low level Format. (It looks like pprint can be used with Format as a backend to print large things efficiently.)

dhil commented 3 years ago

We should definitely use it in value.ml too! The current implementation of value printing is rather obscure.