On Tue Oct 31 16:32:10 2023 +0000, Rémi Bernon wrote:
Fwiw I would also be fine with modelling expression kind into the type system, as that could be more readable than an abstract "args", but I think that the in between solution that is currently used, with type arguments stored separately feels awkward.
[Expressions](https://en.wikipedia.org/wiki/Expression_(computer_science)) have their meaning and are a different things than types, it's more generic distinction than just a specific gramma rule. Sure, it's possible to pretend that types are expressions in data structures, but I think it adds more confusion and complexity. I don't see how accessing the type by something like `expr->u.args[0]->u.type` is cleaner than `expr->u.type`. You assume that `args[0]` is an expression carrying a type anyway, and take an extra step to construct an extra expr_t. Isn't it better to adjust `expr_t` to be explicit about that?
And I'm not sure what you mean by type arguments being stored separately. Is it about the fact that it's not part of the union? That's only because you change it in an earlier patch in this series.