Why are programmers "strongly advised not to participate in syntactic conversions"?

According to the erl_id_trans documentation:

Programmers are strongly advised not to participate in syntactic conversions, and there is no problem support.

Why are programmers strongly advised not to use parse_transform / 2? Will it be supported in the future? Besides parse_transform / 2, is there a mechanism for injecting code (modifying byte code at runtime) or changing the source code before compiling it?

+6
source share
1 answer

One of the reasons I can imagine is that they do not want to correct the format of the syntax tree.

So, if you use Parse teansforms and they break due to the new Erlang version, you cannot complain.

Addendum: in the comments there was a question about other ways to use Erlang source or byte code

  • For refactoring semi-automatic code, there is Wrangler

  • You have access to the Erlang preprocessor tokenizer and parser , giving, for example, the syntax trees of your program

  • For simple and portable manipulation of abstract forms (what you get from the parser or even ray files) there are syntax_tools

  • To manage ther beam_lib beam files

+9
source

Source: https://habr.com/ru/post/899863/


All Articles