vyper icon indicating copy to clipboard operation
vyper copied to clipboard

remove `-f ast` from compiler outputs

Open cyberthirst opened this issue 6 months ago • 3 comments

Version Information

  • vyper Version (output of vyper --version): 533682df9895dabab3033df776953c595ea0107c

What's your issue about?

  • remove -f ast option and decrease the compiler's surface
  • in most cases the annotated ast is the preferred option

  • leaving this open for discussion in case someone might have a usecase for ast without annotations (e.g. error recovery)
  • as per the referenced version, the output doesn't even contain imports making it even less useful

cyberthirst avatar May 26 '25 10:05 cyberthirst

further, the following deepcopy: https://github.com/vyperlang/vyper/blob/533682df9895dabab3033df776953c595ea0107c/vyper/compiler/phases.py#L166

should be most likely run after the imports are resolved.

if the imports were added to the ast output, the output might be incorrect as the imports would not get deepcopied and thus could be annotated if we requested (in this specific order) -f annotated_ast, ast

cyberthirst avatar May 26 '25 10:05 cyberthirst

we could raise a DeprecationWarning for a few releases and see if anybody complains

charles-cooper avatar May 26 '25 12:05 charles-cooper

It's really useful for tooling that want to parse Vyper code that might not be compiling (e.g. Language servers) https://github.com/trocher/couleuvre

trocher avatar Sep 24 '25 12:09 trocher