A TASTY Alternative

This document proposes a new serialization format for typed syntax trees of Scala programs. It aims to be ● compact: All numbers and references are length encoded, trees are inlined by default but may be shared. ● lazy: Trees can be explored from the top, and one can suspend reading subtrees at any time. The only section that needs to be scanned in full is the name table. Laziness is important for the compiler frontend as most of the information in a TASTY file is not needed then. ● extensible: New sections can be defined at will. Additional elements always carry their length, so can be safely skipped in older readers. ● precise: The format given here is in essence a serialized abstract syntax tree for typed Scala. Some of the main classifications,e.g. between types, terms and paths are reflected in the grammar. Picklers and unpicklers for the format have been implemented in https://github.com/lampepfl/dotty/pull/394. The present document gives a syntax summary of the format. More explanations are found in the TASTY reference manual.