According to the erl_id_trans documentation:
Programmers are strongly advised not to engage in parse transformations and no support is offered for problems encountered.
Why are programmers strongly advised not to use parse_transform/2? Will this not be supported in the future? Other than parse_transform/2, is there a mechanism to inject code (runtime bytecode modification) or modify the source code before it gets compiled?
One reason I can imagine is that they don't want to fix the syntax tree format.
So if you use Parse teansforms and they break because of a new version of Erlang you can't complain.
Addendum: in the comments arose the question about other ways to manipulate Erlang source- or byte-code
For semiautomatic code refactoring there is Wrangler
You have acces to the Erlang preprocessor, tokenizer and parser, giving e.g syntax trees of your program
For easy and portable manipulation of abstract forms (what you get out of the parser or even beam-files) there are syntax_tools
For manipulating beam-files ther is beam_lib
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With