A friend built a system where the ad campaigns with all their targeting rules were Lua scripts and it was also fast and simple in a glorious way!
But golang is probably the better choice.
In a way, its a search problem where bid≈relevance and targeting_match≈recall, so I've seen Solr used here too.