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

> 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.




I didn't realise that was possible; I've updated the post to reflect that.


Avoiding code generation is a stated goal of the language. Too bad the hype train swings in random directions.


For what it's worth I'd personally have preferred to use D, but politically it wasn't an option.




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

Search: