Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Seems like you want a code generator. For some problems I admit I have missed a proper, integrated code generator. C macros is, like you say, hacky.

However, personally I strongly dislike dynamic languages for anything beyond simple programs, ie <100 LOC. Gets way to hard to reason about the code, since you never know what a function returns. In Python for example I invariably end up sprinkling dir(...) all over when modifying code.

So it would have to be used sparingly I think.



You could add type hints.

I poke around in the pybindgen code base semi-often and it’s fairly large. No problems that would call for sparing use.




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

Search: