3 ms·
Is there a solution to get ts compiler embeddable into c++ project that uses v8, so it could compile the code on the fly? Seems tsc itself requires node, but s
by ohnoesjmr 1y ago
Is there a solution to get ts compiler embeddable into c++ project that uses v8, so it could compile the code on the fly?
Seems tsc itself requires node, but surely an api that takes a ts file as a string and returns a ts file as a string should be possible?
- teaearlgraycold 1y agoPerhaps you could use or build a C interface for swc, a TS compiler written in rust.
- Imustaskforhelp 1y agothey could use swc-wasm-web as tsbro also uses swc-wasm-web
- teaearlgraycold 1y agoHot damn
- orta 1y agotsc's code is mostly the type-checker, you want to look for a "transpiler" here, so embedding either swc, esbuild, sucrase or the like to handle the process of converting for you. I've never heard of one written in C++ but that may exist.
- silverwind 1y agoswc exists as wasm which any browser should be able to execute.