3 ms·
I don't think these can open and read .proto files during compilation.
by mseepgood 12y ago
I don't think these can open and read .proto files during compilation.
- pcwalton 12y agoRust can.
- tuxychandru 12y agoAre you referring to compiler plugins like the one providing regex! macro or is it something else?
- wycats 12y agoYes, compiler plugins. For a relevant example, check out the Rust docopt crate[1]. An identical technique could be used for yacc or protobufs. [1]: https://github.com/docopt/docopt.rs https://github.com/docopt/docopt.rs
- pjmlp 12y agoD has meta-programming and compile-time evaluation, including reading files. I bet C++ can do it with some clear use of template metatprogramming, compile time evaluation and processor macros. Nim has meta-programming capabilities, including reading files. Not sure about Template Haskell, though.
- thesz 12y agoTemplate Haskell code can runIO I/O actions, including reading files.
- jeremyjh 12y agoHaskell can, but there is not an implementation that does this.
- hawkice 12y agoTo be clear for the Haskell newbies, he's talking about an implementation of the protobuf library, not Haskell. You can fairly easily lift from Template Haskell types into IO in GHC (not sure about TH in other compilers).