symforce-org / symforce

Fast symbolic computation, code generation, and nonlinear optimization for robotics
https://symforce.org
Apache License 2.0
1.41k stars 145 forks source link

Add Typescript code generation #221

Open vincent-lecrubier-skydio opened 2 years ago

vincent-lecrubier-skydio commented 2 years ago

This PR adds the typescript code generation backend.

aaron-skydio commented 2 years ago

Cool, yeah I think the next steps here would be to add the FUNCTION.ts.jinja and probably util.jinja, and plug into symforce_codegen_test to have it generate most functions we currently generate for C++ and Python for typescript as well. We might want a general utility to test that we can call the generated functions and get the results we expect based on the symbolic code, or maybe just some non-general tests of that for typescript in particular. We could also try generating the geo and cam packages for TypeScript, but that's probably optional / something that could be done later