英文:
QuickJS Translate a Module Created with JS to C and Use it as a Builtin Module
问题
我阅读了这篇文章:在QuickJS引擎中使用C编写本地模块。
但我可以使用JS更快更容易地编写模块。创建模块后,我可以使用import:
import myModule from "./myModule.js";
但我不想将模块移到各处。相反,我想使用qjsc首先将代码转换为myModule.c或myModule.o,然后编译qjs并将其用作内置模块。
我的期望是使用qjsc将js代码转换为c,然后使用make qjs将其包含在qjs中,就像QuickJS中的std和os模块一样。
英文:
I read this article: Writing native modules in C for QuickJS engine
.
But I can write the module faster and easier with JS. After creating the module, I can use import:
import myModule from "./myModule.js";
But I don't want to move the module everywhere. Instead I want to use qjsc to convert the code to myModule.c or myModule.o first and then compile qjs and use it as a builtin module.
My expectation is to convert the js code to c with qjsc and then make qjs to include it in qjs, just like the std and os modules in QuickJS.
答案1
得分: 0
我们在这里讨论了这个问题:saghul/txiki.js#386。
英文:
We discussed the issue here: saghul/txiki.js#386
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论