如何运行 C++浏览器中的网络程序?

发布于 2024-12-29 08:59:16 字数 78 浏览 3 评论 0原文

是否可以用 C++ 编写一个程序,并以某种方式让其他人通过浏览器直接在网络上运行该程序,而无需其他人下载 .exe?

Can one write a program in C++ and somehow make it run by someone else directly on the web, from a browser, without the other person having to download the .exe?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

堇年纸鸢 2025-01-05 08:59:16

几天前,我可能会否决这件事,并留下一条毫无帮助的评论,说这毫无意义。然而,昨天,我读了一篇关于 /r/programming 的文章,这篇文章让我到现在认为你的问题完全有效:)。该技术称为 Native Client (NaCl):

Native Client(简称 NaCl)是一项 Chrome 特定技术,允许开发人员使用 C/C++ 进行编码并生成 .nexe 文件(已编译的本机模块)。它们在 Chrome 的 NaCl 沙箱内运行。

有问题的文章位于此处 是关于浏览器游戏开发的,主要使用HTML5。

A few days ago I would've downvoted this to oblivion and left an unhelpful comment about how little sense that made. Yesterday, however, I read an article on /r/programming which has led me to now consider your question perfectly valid :). The technology is called Native Client (NaCl):

Native Client (NaCl for short) is a Chrome specific technology that allows developers to code in C/C++ and produce a .nexe file, a compiled native module. These run inside the NaCl sandbox in Chrome.

The article in question is here and is about browser game development, mainly using HTML5.

梦魇绽荼蘼 2025-01-05 08:59:16

我想这取决于你所谈论的程序有多复杂。

如果您指的是运行时间不会太长的控制台应用程序,您始终可以使用 http://ideone.com/ 。例如:http://ideone.com/sGw5F

I suppose it depends on how complex a program you're talking about.

If you're referring to console applications which don't take too long to run, you can always use http://ideone.com/. For example: http://ideone.com/sGw5F

凉城已无爱 2025-01-05 08:59:16

您应该研究一下 Native Client。
来自 http://code.google.com/p/nativeclient/

Native Client 是一种开源技术,可让您构建
可在内部无缝执行本机编译代码的 Web 应用程序
浏览器。这个Google Code项目是为了维护Native
客户端实现,包括编译器和浏览器支持。如果
您正在编写一个编译器,有兴趣将 Native Client 移植到
新的浏览器,或者正在研究底层的安全机制
Native Client,您可以在这个项目中找到有用的资源。

You should look into Native Client.
From http://code.google.com/p/nativeclient/:

Native Client is an open-source technology that allows you to build
web applications that seamlessly execute native compiled code inside
the browser. This Google Code project is for maintaining the Native
Client implementation, including compiler and browser support. If
you're writing a compiler, are interested in porting Native Client to
a new browser, or are researching the security mechanisms underlying
Native Client, you can find useful resources in this project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文