3 ms·
You are correct about a lot of meta programming in Phoenix. As there is no inheritance in Elixir, macros are used a lot to inject code from another module. So a
by sidkshatriya 5y ago
You are correct about a lot of meta programming in Phoenix. As there is no inheritance in Elixir, macros are used a lot to inject code from another module. So as an example if Phoenix has an Endpoint module and your module is an endpoint the macros (especially “use”) injects endpoint related code. It’s impressive but ultimately all this magic gets too much. It gets very confusing when all these macros run because you have complications like bind_quoted, accumulating in module @ tags etc. And because there are no true static types you need to be very careful. Phoenix is slick and I think it’s doing its best given the underlying platform.