This product was not featured by Product Hunt yet.
It will not be visible on their landing page and won't be ranked (cannot win product of the day regardless of upvotes).

Product upvotes vs the next 3

Waiting for data. Loading

Product comments vs the next 3

Waiting for data. Loading

Product upvote speed vs the next 3

Waiting for data. Loading

Product upvotes and comments

Waiting for data. Loading

Product vs the next 3

Loading

ts-polyglot

C, C++ and Rust functions in TypeScript

Import functions from C, C++ and Rust source files straight into TypeScript, with real types.

Top comment

Hi all,

I've been following the development of TypeScript Content Mappers for quite a while, especially because it overlaps with another TypeScript extension project I'm working on, where I rely pretty heavily on Volar.js and God, it's a lot of code to keep all the language features working and in sync with TypeScript.

But now we finally have an official extension mechanism built directly into TypeScript, and now we can literally import anything.

I immediately started thinking about what else we could do with it. One thing that's been a particular pain for me is C++ lib interaction.

I'm building a small inference engine, and one of the biggest headaches has been N-API. Every time I need to call a C++ function from Node.js, I have to wrap it in special N-API bindings. It works, but it's a pain. There's also Koffi, which is pretty interesting, but it still doesn't give me the seamless type inference, IntelliSense, and development experience I'm looking for.

So I thought, why not take this a step further? What if we could just import C, C++, or Rust functions directly into TypeScript, as naturally as importing another TS file?

Well, here we are:

https://github.com/mykhailen/ts-polyglot

Using Content Mappers you can import functions from C, C++, and Rust source files directly into TypeScript, with inferred types and IntelliSense support, while generating and compiling the native bindings behind the scenes.

It's still early, and there's plenty of work ahead, but I think this opens up some really interesting possibilities.

Would love to hear your thoughts, especially from anyone who's worked with TypeScript language tooling, N-API, or native interoperability.

About ts-polyglot on Product Hunt

“C, C++ and Rust functions in TypeScript”

ts-polyglot was submitted on Product Hunt and earned 6 upvotes and 1 comments, placing #45 on the daily leaderboard. Import functions from C, C++ and Rust source files straight into TypeScript, with real types.

On the analytics side, ts-polyglot competes within Open Source, Software Engineering and GitHub — topics that collectively have 153.7k followers on Product Hunt. The dashboard above tracks how ts-polyglot performed against the three products that launched closest to it on the same day.

Who hunted ts-polyglot?

ts-polyglot was hunted by Evgen Mykhailenko. A “hunter” on Product Hunt is the community member who submits a product to the platform — uploading the images, the link, and tagging the makers behind it. Hunters typically write the first comment explaining why a product is worth attention, and their followers are notified the moment they post. Around 79% of featured launches on Product Hunt are self-hunted by their makers, but a well-known hunter still acts as a signal of quality to the rest of the community. See the full all-time top hunters leaderboard to discover who is shaping the Product Hunt ecosystem.

For a complete overview of ts-polyglot including community comment highlights and product details, visit the product overview.