With the start of interoperability, we are now able to import MusicXML into Alda IR (ScoreUpdate). Although we can do lots of stuff from this representation like output to JSON or play, we can't actually obtain Alda code itself from it. The decompiler will serve to decompile ScoreUpdate structs to Alda code so users can start writing Alda from imported music.
Many great languages come with great formatters (ex gofmt). Alda may eventually aim to support built-in formatting. This is most easily done by scanning to parser.Token then formatting back to code. This PR will set up this formatter in the most basic form.
This PR sets up both the generator and formatter with simple / partial implementations.
The need for an Alda decompiler is twofold:
ScoreUpdate
). Although we can do lots of stuff from this representation like output to JSON or play, we can't actually obtain Alda code itself from it. The decompiler will serve to decompileScoreUpdate
structs to Alda code so users can start writing Alda from imported music.gofmt
). Alda may eventually aim to support built-in formatting. This is most easily done by scanning toparser.Token
then formatting back to code. This PR will set up this formatter in the most basic form.This PR sets up both the generator and formatter with simple / partial implementations.