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

From my past C experience I had developed a distaste for clever pre-processors tricks that a lot of people love showing around.

However while easing myself into typed languages after multiple years of using ruby and erlang exclusively, I have found myself needing a pre-processor to eliminate the boilerplate often required to satisfy type systems. In addition I wanted to create a project to generate type definitions (and associated tests) for multiple languages (esp. Typescript, bucklescript and Nim) having js targets for library authors.

The approach I settled in was a very simple template driven pre-processor that would inject the generated code right into the source files between annotated comment directives. I expect this, along with an explicit focus on non-composability, to discourage people from using templates where normal language features would do just as well.

This project (written in typescript) is available at https://github.com/lorefnon/InGenR and any feedback and contributions are welcome.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: