Live data from Hacker News

Tools to generate constants and enums in multiple languages

news.ycombinator.com

1–4 of 4 posts

Tools to generate constants and enums in multiple languages

#1
I would like to generate constants (and ideally enums) from a single source into multiple languages so that I don't need to maintain multiple definitions.

I'd like to support at least: C, C++, C#, Rust, Javascript

So far the closest thing I've found is reconstant[0], which looks simple enough to add C# to but curious what other options are available.

Re: Tools to generate constants and enums in multiple languages

#3
post #2

Have you looked into protobufs: https://developers.google.com/protocol-buffers/docs/proto3#e...

I glossed over it early on as it didn't support mention Rust support, it also seemed to be for a different use case than I was targeting but I'll give it another look. Thanks for the suggestion.