2 ms·
> we had for instance a library for interacting with a particular service that was generated from an XML schema, making the code perfectly type-safe, with diffe
by p0nce 12y ago
> we had for instance a library for interacting with a particular service that was generated from an XML schema, making the code perfectly type-safe, with different functions for each datatype. In many languages that allow compile-time metaprogramming, like C++ and D, IO cannot be performed at compile time, so such schema-driven code generation would not be possible.
Actually this would be possible in D since you can read files at compile-time with the "import(filename)" syntax. Then you can use compile-time parser generators to parse it.
- logicchains 12y agoI didn't realise that was possible; I've updated the post to reflect that.
- p0nce 12y agoAvoiding code generation is a stated goal of the language. Too bad the hype train swings in random directions.
- logicchains 12y agoFor what it's worth I'd personally have preferred to use D, but politically it wasn't an option.