Hacker News new | past | comments | ask | show | jobs | submit login

I think you would ask yourself : can I compute this at compile time? (And is it useful to do so?) I don't really see how you could use that for a database driver, but for example you could create a library that uses macros to generate custom serialization/deserialization code to/from json (or whatever format) for your data structures.

(Edit: after a quick check this use case seems to be already covered by #[deriving(Encodable, Decodable)] in rust.)




You could use macros to perform compile-time checking of SQL query strings (and checking of any arguments bound to the query, as long as they're bound immediately instead of being bound later).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: