Self-Hosted Code outside SpiderMonkey Tree?
Kent Williams <[email protected]> Fri, 3 Aug 2018 13:14:38 -0500
| Newsgroups | gmane.comp.mozilla.devel.jseng |
|---|---|
| Message-ID | <[email protected]> |
I have embedded the TypeScript compiler in SpiderMonkey. The way I did it was to add the minimal JSNative functions needed to support what the compiler needs. If you're curious, grab the TypeScript source look at Typescript/src/compiler/sys.ts. The way I package this is to suck the whole compiler (tsc.js) file into a C++ string, and evaluate it after injecting the things I care about -- the files to compile, the language flags, etc. When poking around in the SpiderMonkey shell, I notice that it uses self-hosted code to implement the ModuleLoader. This does exactly what I do, but it looks like it requires being inside the SpiderMonkey build tree, including tools in js/src/builtin. Is there any advantage to trying to use self-hosting? Signs point to 'no' -- looking here: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/self-hosting _______________________________________________ dev-tech-js-engine mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine