将C翻译为JavaScript [英] Translating C to JavaScript

查看:116
本文介绍了将C翻译为JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C中有一堆math / dsp算法。单个函数,每个文件一个函数,没有花哨的链接或包含或预处理器指令,只有c99和标准库调用(主要是用于处理数组复制的memset和memmoves等) )。
翻译它们不是一个大问题,但需要时间。我想知道是否有一些C - > Javascript翻译工具,以加快工作。

I've got a bunch of math/dsp algorithms in C. Single functions, one function per file, no fancy linking or includes or preprocessor directives, only c99 and standard library calls (mainly memset and memmoves to handle array copying etc). Translating them is not a big problem, but it takes time. I was wondering if there was some C -> Javascript translation tool, in order to speed up the work.

请介意我不需要一个完美的翻译,我会无论如何,把我的手放在最后的结果上。我需要的是一个简单的工具,可以帮助解决基本的无聊事情。

Please mind I don't need a perfect translation, I will put my hand on the final result anyway. What I need is a simple tool that helps with the basic, "boring" things.

有人听说过这样的事情吗?

Anyone heard of such a thing?

编辑:似乎emscripten会做的伎俩。

seems that emscripten will do the trick.

推荐答案

更新:看起来他们是时代了Changin':)

Update: it seems The Times They Are a-Changin' :)

参见这篇文章: DOOM移植到JavaScript和HTML5


Zakai编译了DOOM源代码使用 Emscripten Clang 并使用Closure Compiler对其进行优化。

Zakai compiled the DOOM source code from C to JavaScript using Emscripten and Clang and optimized it with Closure Compiler.

这是 项目页 即可。玩得开心! :)

And here is the Project page. Have fun! :)

这篇关于将C翻译为JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆