I'm prototyping a web app whose function will be to manually build a JS AST for JavaScript code gen (for which I'll use esprima and escodegen), and a C AST for C code generation.
Clang would seem to be the logical place for me to begin, for the latter. What are my options for accessing Clang from JS? So far my only sane thought is using Node to access Clang locally.
Statement of intent
The visual development environment (VDE) I'm working on needs to be able to turn "outer" structures i.e. modules, functions that are represented graphically, into source code. Function bodies could(?) then be filled in by the user, avoiding overt complexity in the VDE, which needn't care about such things (functions as in-outs are all that matters from its perspective), at least not presently. Furthermore, if I modify a structure in the VDE - e.g. changing arg types, or creating a new global in a module - then any existing body copy must not be erased during that process.
I'd like to do this the "right" way, to keep VDE code as maintainable as possible and avoid corner cases it can't handle. Ideally this editor will grow in code-processing functionality as time passes.