是否有适用于 C++ 等编译语言的 Web 框架?

发布于 2024-07-12 08:11:38 字数 1542 浏览 5 评论 0原文

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

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

发布评论

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

评论(12

攒眉千度 2024-07-19 08:11:38

您的 PHP 网站速度缓慢的原因是什么? 您是否分析过代码以找出瓶颈? 用另一种语言替换整个代码库对于这项工作来说可能太大了。

也许如果某些部分是计算密集型的,那么也许您可以用 C++ 实现 PHP 模块来完成这项工作。

What is the reason your site is slow in PHP? Have you profiled the code to figure out the bottle necks? Replacing the entire codebase with another language is likely to be too large a tool for the job.

Perhaps if some portion is computationally intensive, then maybe you can implement a PHP module in C++ to do the job.

我三岁 2024-07-19 08:11:38

如果我是你,我会尝试Wt。 我认为您不会找到像 Wt 那样完整且易于使用且具有类似性能的解决方案。 该邮件列表很活跃,并且定期发布在嵌入式设备上使用它的用户的帖子。 该项目的 Wiki(此处)提到了一些嵌入式部署的数字和ARM 上的性能。

If I were you, I would give Wt a try. I don't think you will find another solution as complete and easy to use as Wt with similar performance. The mailinglist are active, and has regular posts of people who use it on embedded devices. The Wiki (here) of the project mentions some numbers for embedded deployment and performance on ARM.

如梦亦如幻 2024-07-19 08:11:38

您可以查看CppCMS。 我不知道它有多成熟或多好,但听起来像是你正在寻找的。

另一种选择是用 Python/PHP 编写主应用程序,然后用 C 重写关键部分,这对我来说似乎更理智。

You can take a look at CppCMS. I don't know how mature or good it is, but it sounds like what you are looking for.

Another option is to write the main application in Python/PHP and then rewrite the critical parts in C, which seems more sane to me.

还不是爱你 2024-07-19 08:11:38

我刚刚将此链接视为 CppCMS 的引荐来源网址。 关于它的几个问题/答案。

问:如何成熟?
答:有一个 100% 基于它的 Wiki。 开发者博客也在 CppCMS 上运行。 所以你可以看到它非常有效。
出色地。 至少对于作者来说是这样。
问:“像 C++ Django 这样的东西会让我非常高兴”
答:实际上它是“C++ Django”。 许多想法直接取自 Django,例如
表单、模板继承等等。 所以您可能会有宾至如归的感觉
问:纳米齿轮
答:我看过了...它有很多计划,但代码不多。
问:有多少项目使用它。
答:不多。 这是一个相当新的项目。
问:我是谁?
A. 老实说我是CppCMS 的开发者。

I had just seen this link as a referrer to CppCMS. Several questions/answers about it.

Q. How is it mature?
A. There is a Wiki 100% based on it. Developers blog runs on CppCMS as well. So you can see it quite works.
well. At least for author.
Q. "What would make me totally happy would be something like C++ Django"
A. Actually it is "C++ Django". Many Ideas had been taken directly from Django, like
forms, template inheritance and some more. So you would probably feel at home
Q. Nanogear
A. I had taken a look on it... It has many plans but not-too-much code.
Q. How many projects using it.
A. Not many. It is quite new project.
Q. Who am I?
A. To be honest I'm the developer of CppCMS.

肤浅与狂妄 2024-07-19 08:11:38

您真的需要一个 Web 框架还是只是一个 html 模板库?
请参阅此处了解模板选项:C++ HTML 模板框架、模板化库、 HTML 生成器库

Do you really need a web framework or just an html templating library?
See here for template options: C++ HTML template framework, templatizing library, HTML generator library

寄人书 2024-07-19 08:11:38

这里需要注意的一件事是使用 C++ 来实现某种 Web 服务,而不是实际的 Web 应用程序开发环境。 在我当前的一个项目中,我们生成 JSON(并解析请求),然后让客户端(Web 浏览器)处理其余的事情。 您在客户端计算机上拥有大量可用的计算能力,混合一些 JavaScript 魔法和繁荣,现在您的嵌入式设备可以回去执行其应该执行的操作。 我个人有点喜欢 Wt,并且认为如果您想用 C++ 开发整个“网络应用程序”,那么它是您最好的选择。

至于如何让 C++ 代码开始提供 Web 服务的具体细节,您可以使用令人惊叹的 boost.asio 库(他们有一个 http 服务器示例)和 json_spirit(我认为它在 codeproject 上)

One thing to look at here is using C++ for some sort of web service instead of an actual web app development environment. On one of my current projects we generate JSON(and parse for requests) then let the client(web browser) deal with the rest. You have a great deal of computing power available to you on the client machine, mix in some javascripty magic and boom, now your embedded device can go back to doing what its supposed to do. I personally kind of like Wt and think it is your best bet if you want to dev the whole "web app" thing in C++.

As to the specifics of how you get your C++ code to start serving up web services, you can use the amazing boost.asio library(they have an http server example) and json_spirit(I think its on codeproject)

静水深流 2024-07-19 08:11:38

Nanogear怎么样。 我没有使用过它,所以我不确定它是否合适。 这是网站上的引用。

C++ 是一个伟大的通用用途
编程语言但不是现代的,
易于使用且功能强大的 C++ Web
在这些期间制定了框架
年。 我们试图填补空白
纳米齿轮。 灵感来自 Zend
我们想要带来的框架和Rails
C++ 到网络,轻松实现。

这是旧版 googlecode 网站的链接 Google Code Nanogear 看起来那里有更多信息。

How about Nanogear. I haven't used it, so I'm not sure if it is a good fit. Here is a quote from the website.

C++ is a great, general purpose
programming language but no modern,
easy-to-use and powerful C++ web
frameworks were made during these
years. We try to fill the gap with
Nanogear. Inspired by the Zend
Framework and Rails we want to bring
C++ to the web, easily.

Here is a link to the older googlecode site Google Code Nanogear Looks like there is more info there.

善良天后 2024-07-19 08:11:38

尝试 LuaLuaForge 上有 Xavante 嵌入式 Web 服务器。

它非常快、非常小并且非常可扩展——就像 lua 的一切一样。

您可以在更适合脚本编写的地方使用 Lua,并在需要更快速度和与现有本机代码连接的地方使用 C++ 函数。

Try Lua. There is Xavante embeded web server somewhere on LuaForge.

It's very fast, very small and very extensible - as all about lua is.

You have power to use Lua where scripting fits betteer, and use C++ functions where in need of more speed and conection to existing native code.

灰色世界里的红玫瑰 2024-07-19 08:11:38

既然没有人说过,那我就说吧。 尝试Java。 Java是一种编译语言,具有良好的Web框架。 它也非常具有可扩展性。 我工作过的每家公司都使用java作为其主要的网络技术,这主要是由于这种可扩展性因素。 不确定它是否适用于您的架构,但它回答了这个问题:

是否有用于编译语言 C++ 的 Web 框架?

Since no one else has said it, I will. Try Java. Java is a compiled language with a good web framework. It is also very scalable. Every coperation I have worked for uses java as its main web-technology, and this is mainly due to this scalability factor. Not sure if it will work with your architecture, but it answers the question:

Are there any web frameworks for compiled languages like C++?

心凉怎暖 2024-07-19 08:11:38

您可以尝试嵌入版本CppCMS

这是相当新的实验性开发,但看起来确实如此
比 Wt 更合适,因为它是面向 Web 的(更接近 Django)
而不是 GUI 那样的。

You may give a try to embedded version of CppCMS.

It's quite new and exprerimental development but It looks like it is
much more suitable then Wt because it is ore web oriented (more closer to Django)
and not GUI like.

花海 2024-07-19 08:11:38

查看 ffead C++ 应用程序框架 (http://code. google.com/p/ffead-cpp/),它是根据 Spring for JAVA 开发的。

Check out the ffead c++ application framework (http://code.google.com/p/ffead-cpp/), its developed on the lines of Spring for JAVA.

野侃 2024-07-19 08:11:38

您可以查看Tntnet。 它使用自己的模板语言,看起来有点像 PHP,只是有更多的附加标签。

You can have a look at Tntnet. It uses its own template language which looks a bit like PHP, only with much more additional tags.

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