Hi! I'm the author of the blog post and maintainer of the discussed package.
As CurtHagenlocher notes, in R functions can access passed expressions without evaluating them. So, even though the name `sepal_length` may not be bound to any object in the scope in which `select(sepal_length)` is called, one can use R's non-standard evaluation to process the expression `sepal_length` without trying to resolve the name.
Julia does not have non-standard evaluation, so `select(sepal_length)` necessarily attempts to resolve `sepal_length`, which is a problem if `sepal_length` is not a valid name. Using a macro to an extent emulates the effect of R's non-standard evaluation, at least when it comes to being able to name columns as arguments to manipulation verbs without having to symbolicate them or wrap them in quotes.
The advantages go beyond name resolution. One could resign oneself to symbolicating everywhere, i.e. writing `:sepal_length` to refer to the appropriate column. But then one starts to run into issues when one tries to handle expressions involving function calls. For instance, suppose you want to implement `filter` as an actual function. Well, you could ask users to invoke `filter(iris, :sepal_length > .5)`. This is fine so far as name resolution goes. But the argument `:sepal_length > .5` will throw a `MethodError` when evaluated, because there's no method for comparing a `Symbol` object to a `Float64` object. Using a macro-based regime allows us to access directly the AST representing `sepal_length > .5` and generate a lambda that mirrors the predicate's structure.
One of the main points of the post, which perhaps gets lost in the verbiage, is that, while we're using macros to allow for unqualified (i.e., un-symbolicated, un-stringed) mention of column names in the context of manipulation verb arguments, we can perform a number of other services (such as "automatic" lifting over `Nullable` arguments) and optimizations (such as having the resultant lambda take a tuple argument to avoid splatting, which is costly).
Was this helpful?