microsoft / Trieste

A term rewriting system for experimental programming language development.
MIT License
37 stars 20 forks source link

Adding Reader, Writer, and Rewriter to Trieste. #98

Closed matajoh closed 5 months ago

matajoh commented 5 months ago

In the context of adding a means to convert YAML to JSON, this PR adds some new constructs to Trieste.

In all three cases the implementer controls the activity of the construct via a series of rewrite passes. As part of this work, Driver was rewritten to optionally use a Reader, and the Process classes was refactored to make it a bit more flexible and easy to use.

Additionally, the YAML language implementation exposes a to_json converter, as well as a event_writer (for the existing event stream output) and a writer which emits YAML. All three are validated against the test suite. Both YAML and JSON expose Reader objects, and JSON exposes a Writer as well (a refactoring of its emitter).