fmease / lushui

The reference compiler of the Lushui programming language
Apache License 2.0
5 stars 0 forks source link

Issuable statistics for declarations #57

Open fmease opened 3 years ago

fmease commented 3 years ago

Add a perma-unstable (for now: internal) attribute @statistics (done via 1278a29d1649403f7865dbbd37f1a515b665cf19) (or whatever) for declarations which outputs a report during compile time containing several possibly useful pieces of information about the declaration. It is unstable in the sense that is an error to use it without enabling it with @feature(…) declaration or an unstable command-line flag (for now: -Zinternals).

It's probably a good idea to make the level of verbosity adjustable and make certain information which require expensive computation opt-out by default. Also, the information are gathered through several passes. Should we output a report for each or gather it into one big one? The latter is better I guess but needs additional infrastructure.

Any Declaration

Value Declarations

Data Declarations

Constructor Declarations