TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Tools to generate constants and enums in multiple languages

4 pointsby tossaway9000over 3 years ago
I would like to generate constants (and ideally enums) from a single source into multiple languages so that I don&#x27;t need to maintain multiple definitions.<p>I&#x27;d like to support at least: C, C++, C#, Rust, Javascript<p>So far the closest thing I&#x27;ve found is reconstant[0], which looks simple enough to add C# to but curious what other options are available.

1 comment

avinasshover 3 years ago
Have you looked into protobufs: <a href="https:&#x2F;&#x2F;developers.google.com&#x2F;protocol-buffers&#x2F;docs&#x2F;proto3#enum" rel="nofollow">https:&#x2F;&#x2F;developers.google.com&#x2F;protocol-buffers&#x2F;docs&#x2F;proto3#e...</a>
评论 #29188538 未加载
评论 #29188692 未加载