TypeScript to Candid compiler

Just checking before I embark on this journey for Azle (TypeScript CDK). Is there an existing TypeScript → Candid compiler?

If not then I (Demergent Labs) will be creating one. Demergent Labs will most likely create a Python → Candid compiler as well, I really doubt that has been touched.

3 Likes

Probably not in the way you mean. The candid package has provided something like this for a long time:

We provide a library for serialization of native JavaScript values, and a visitor class for extending Candid for building generic tools such as UI and random testing.

I imagine what you’re trying to do would involve something similar to the developer experience of generating Candid from Rust; by providing TypeScript types and functions that you want to be part of the generated Candid interface.

I think that probably means going from the TypeScript AST to the IDL types in the following file, and then leveraging the encoding it already provides.

1 Like