工作C code直接在浏览器? [英] Running C code directly in the browser?

查看:124
本文介绍了工作C code直接在浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

性能考虑之外,没有任何已知的方式把现有的C,C ++或客观C code和直接在浏览器中运行的呢?例如,所有的code转换成可在浏览器上运行的一些间preTED语言的编译器。如JavaScript或ActionScript和Flash Player,或者我认为Java和JVM的。

Performance considerations aside, is there any known way to take existing C, C++, or Objective C code and run it directly in the browser? For example, a compiler that converts all the code into some interpreted language that can be run in the browser. Like Javascript, or Actionscript and the Flash player, or I suppose Java and the JVM.

我承认有更高层次的语言,如HAXE可以被编译到不同的目标。而在另一边有像卡布奇诺和GWT项目试图让JavaScript开发更像传统的桌面开发。

I recognize there are higher level languages like HaXe that can be compiled to different targets. And on the other side there are projects like Cappuccino and GWT that attempt to make Javascript development more like traditional desktop development.

但我在想,如果你有一个桌面或现有code基用C做的,C ++或Objective C对工作也很容易被转换成一个基于Web的应用程序的应用程序?

But I was wondering if you had an application that worked on a desktop or an existing code base done in C, C++, or Objective C could it easily be converted to a web based application?

时那里工作正在这方面做了什么?是否有任何实际的理由这样做呢?基本上把浏览器到操作系统?

Is there work being done on this front? Is there any practical reason to do this? Basically turn the browser into the OS?

除了性能问题,以及操作系统厂商的壕沟,还有这不可能完成任何技术原因?难道这有点像code C来硬塞进在浏览器中托管的虚拟机?

Beside the performance issues, and the entrenchment of OS vendors, are there any technical reasons this couldn't be accomplished? Could this kind of C like code be shoehorned into a virtual machine hosted in a browser?

推荐答案

谷歌的 Native Client的(氯化钠)使用一个扭捏编译器创建对象的x86 code,它可以通过浏览器进行验证,并在沙箱中运行,没有出现大的性能损失 - pretty很酷的东西。他们已经在它之下编译地震。

Google's Native Client (NaCl) uses a tweaked compiler to create x86 object code that can be verified by the browser and run in a sandbox, without a major performance hit - pretty cool stuff. They've compiled Quake under it.

这<一个href=\"http://web.archive.org/web/20120904090404/http://chargen.matasano.com/chargen/2009/8/27/the-security-implications-of-google-native-client.html\"相对=nofollow> Matasano文章,有它是如何工作的良好运行下来。

This Matasano article has a good run-down on how it works.

这篇关于工作C code直接在浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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