<i id='pEIPk'><tr id='pEIPk'><dt id='pEIPk'><q id='pEIPk'><span id='pEIPk'><b id='pEIPk'><form id='pEIPk'><ins id='pEIPk'></ins><ul id='pEIPk'></ul><sub id='pEIPk'></sub></form><legend id='pEIPk'></legend><bdo id='pEIPk'><pre id='pEIPk'><center id='pEIPk'></center></pre></bdo></b><th id='pEIPk'></th></span></q></dt></tr></i><div id='pEIPk'><tfoot id='pEIPk'></tfoot><dl id='pEIPk'><fieldset id='pEIPk'></fieldset></dl></div>

    <legend id='pEIPk'><style id='pEIPk'><dir id='pEIPk'><q id='pEIPk'></q></dir></style></legend>
        <bdo id='pEIPk'></bdo><ul id='pEIPk'></ul>
    1. <tfoot id='pEIPk'></tfoot>

    2. <small id='pEIPk'></small><noframes id='pEIPk'>

      将javascript代码转换为c代码

      时间:2023-10-12
        <tfoot id='JR9Hd'></tfoot>
          <bdo id='JR9Hd'></bdo><ul id='JR9Hd'></ul>

            <tbody id='JR9Hd'></tbody>

            <small id='JR9Hd'></small><noframes id='JR9Hd'>

            1. <i id='JR9Hd'><tr id='JR9Hd'><dt id='JR9Hd'><q id='JR9Hd'><span id='JR9Hd'><b id='JR9Hd'><form id='JR9Hd'><ins id='JR9Hd'></ins><ul id='JR9Hd'></ul><sub id='JR9Hd'></sub></form><legend id='JR9Hd'></legend><bdo id='JR9Hd'><pre id='JR9Hd'><center id='JR9Hd'></center></pre></bdo></b><th id='JR9Hd'></th></span></q></dt></tr></i><div id='JR9Hd'><tfoot id='JR9Hd'></tfoot><dl id='JR9Hd'><fieldset id='JR9Hd'></fieldset></dl></div>

                <legend id='JR9Hd'><style id='JR9Hd'><dir id='JR9Hd'><q id='JR9Hd'></q></dir></style></legend>
                本文介绍了将javascript代码转换为c代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                有什么方法可以将 C 代码转换为 JavaScript 并从 JavaScript 转换为 C?我发现 V8 juice 可以从 C++ 生成 JavaScript-side 类,但这只是一种方式(C++ 到 JavaScript).

                Is there any way to convert C code to JavaScript and from JavaScript to C? I found V8 juice which can generate JavaScript-side classes from C++, but it's only one way (C++ to JavaScript).

                我不是在寻找软件.

                推荐答案

                非常非常棘手 --- Javascript 是一种高度动态的语言,几乎所有东西都可以在运行时更改:变量名、函数名、类型等. 因此,它非常糟糕地映射到 C 上.这甚至没有考虑 eval(),它可以让您在字符串中构造任意 Javascript 块并运行它们.

                Very, very tricky --- Javascript is a heavily dynamic language where pretty much everything can be changed at run time: names of variables, functions, types, etc. As such it maps very badly onto C. And that's not even considering eval(), which will let you construct arbitrary chunks of Javascript in strings and run them.

                任何 Javascript 翻译器都必须能够处理这些事情,这意味着它必须在运行时将 Javascript 翻译成 C --- 这使它成为 JIT,您已经在使用它.

                Any Javascript translator would have to be able to cope with such things, which means it would have to translate the Javascript into C at run-time --- which makes it a JIT, which you're already using.

                您可能希望改为考虑为 Javascript 编写 C 绑定.这些将允许您的 Javascript 代码调用 C 代码,反之亦然.这将允许人们用 C 编写插件,将它们编译成 .so 共享库,您现在可以从 Javascript 代码加载和运行这些共享库.这意味着您不需要翻译任何内容.

                You may want to look at writing C bindings for Javascript instead. These will allow your Javascript code to call out to C code and vice versa. This would allow people to write plugins in C, compile them into .so shared libraries, which you can now load and run from your Javascript code. This means you don't need to translate anything.

                Javascript 不是我的领域,所以我不能推荐任何特定的机制,恐怕 --- 但如果你已经找到的 V8Juice 不允许你这样做,我会感到非常惊讶.

                Javascript's not my area so I can't recommend any particular mechanism, I'm afraid --- but I'd be very surprised if V8Juice, which you've already found, didn't let you do this.

                这篇关于将javascript代码转换为c代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:ECMAScript:Harmony/ES6 到 JavaScript 编译器 下一篇:是否可以将 Closure Compiler ADVANCED_OPTIMIZATIONS 与 j

                相关文章

                最新文章

                • <bdo id='gbqo5'></bdo><ul id='gbqo5'></ul>

                    <legend id='gbqo5'><style id='gbqo5'><dir id='gbqo5'><q id='gbqo5'></q></dir></style></legend>

                  1. <i id='gbqo5'><tr id='gbqo5'><dt id='gbqo5'><q id='gbqo5'><span id='gbqo5'><b id='gbqo5'><form id='gbqo5'><ins id='gbqo5'></ins><ul id='gbqo5'></ul><sub id='gbqo5'></sub></form><legend id='gbqo5'></legend><bdo id='gbqo5'><pre id='gbqo5'><center id='gbqo5'></center></pre></bdo></b><th id='gbqo5'></th></span></q></dt></tr></i><div id='gbqo5'><tfoot id='gbqo5'></tfoot><dl id='gbqo5'><fieldset id='gbqo5'></fieldset></dl></div>

                  2. <small id='gbqo5'></small><noframes id='gbqo5'>

                  3. <tfoot id='gbqo5'></tfoot>