与 gcc 相比,comeau 编译器值得吗?

发布于 2024-07-27 17:06:32 字数 1433 浏览 8 评论 0原文

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

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

发布评论

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

评论(6

白鸥掠海 2024-08-03 17:06:32

我编写 C++ 的经验是,使用多个编译器编译代码是在代码中查找奇怪情况的好方法。 在我们的例子中,我们使用了 gcc、Apple gcc 和 Visual Studio 编译器 cl(免费)。 在 Windows 上,我更喜欢 cl 编译器,因为它编译速度更快(对我们来说大约快五倍)并且生成更好的代码(我上次检查时大约快 30%)。 不过,哪个编译器生成最快的代码始终取决于应用程序。 在我们的特殊情况下,与流行观点相反,英特尔编译器并不擅长生成快速代码,因此没有真正的动机使用它。

如果我们有足够的钱,使用 Comeau 进行编译将有助于额外检查标准一致性。 除此之外,我对我们使用的编译器很满意。

My experience with writing C++ is that compiling your code with more than one compiler is a great way to find odd corner-cases in your code. In our case, we've used gcc, Apple gcc, and the Visual Studio compiler cl (which is free). When on Windows, I prefer the cl compiler since it compiles faster (around five times faster for us) and it produces better code (around 30% faster last time I checked). Which compiler produces the fastest code is always dependent on the application though. In our particular case the Intel compiler is not so good at producing fast code contrary to popular opinion, so there is no real incentive to use it.

If we had the money to spend, compiling with Comeau would be nice to help with additional checking for standards conformance. Apart from that, I'm happy with the compilers we use.

你的背包 2024-08-03 17:06:32

Comeau 编译器的杀手级功能是其一致性(包括 C++03!)和出色的错误报告。

还有一种在线方法可以尝试:http://www.comeaucomputing.com/tryitout/

如果这些功能对您来说值得的话,Comeau 编译器绝对值得。

向 Comeau 编译器致敬!

The killer feature of the Comeau compiler is its conformance (including C++03!) and excellent error reporting.

There's an online way to try it out too: http://www.comeaucomputing.com/tryitout/

The Comeau compiler is definitely worth it if these features are worth it to you.

Hats off to the Comeau compiler!

兔姬 2024-08-03 17:06:32

Comeau 编译器有三种主要用途:

  • 仅具有 C 编译器的目标平台

  • 良好一致性声誉和良好错误消息的附加编译器

  • 试验仅可用的功能(例如,试验导出的模板是我几年前购买它的原因)

请注意,调试不是用途之一。 它生成 C 代码,然后由 C 编译器编译。 它使用 #line 指令,以便您能够在代码中逐步执行,但是如果要执行更多操作,您将遇到与使用 C 作为中间语言调试任何语言时相同的问题:调试器不知道约定的起始语言。

There are three main use of Comeau's compiler:

  • targeting platforms having only a C compiler

  • having an additional compiler with good conformance reputation and good error message

  • experimenting with features which are available only with it (experimenting with exported templates was my reason to buy it years ago for instance)

Note that debugging is not one of the use. It generates C code which is then compiled by your C compiler. It use #line directives so that you are able to go step by step in your code, but to do more, you'll have the same problem as when debugging any language using C as intermediate language: the debugger is not aware of the convention of the starting language.

优雅的叶子 2024-08-03 17:06:32

如果您对 gcc 工具感到满意,请坚持使用它们。 不要修复没有损坏的东西。 很多人每天都在使用它们,而且它们确实非常好。

也就是说,gcc 一直被批评,因为“每次发布都变得更慢,并且创建了蹩脚的版本”。代码”。 不知道“蹩脚”是什么,但我们一直在使用特定于硬件供应商(例如英特尔)的编译器来编译时间关键的部分。 与 gcc 相比,它们在某些情况下确实创建了更快的代码。 但通常情况下差异并不重要。

If you're happy with gcc tools, stick with them. Don't fix what's not broken. They're being used daily by lots of people, and they're certainly pretty good.

That said, gcc has been criticized for "getting slower with each release and creating crappy code". Don't know about the "crappiness", but we've been compiling time-critical sections with hardware vendor specific (e.g. Intel) compilers. They indeed create way faster code in some cases, compared to what gcc achieves. But usually the difference doesn't matter, though.

韵柒 2024-08-03 17:06:32

我倾向于说不,g++ 是一个很棒的编译器,有一个庞大的社区支持它,实际上没有必要切换到商业编译器,除非你想要它提供的支持,除非你是一个大型开发人员可能不会。 有了 Windows 上的 g++ 和 VS Express,确实没有必要为编译器花钱。 更好的地方来花你的钱/时间!

I would tend to say no, g++ is a great compiler with a huge community supporting it, there really isn't any need to switch over to a commercial compiler unless you want the support it offers, which unless you're a large developer you probably don't. With g++ and VS Express on windows, there really isn't any need to dish out money for a compiler. Better places to spend your money/time!

ぺ禁宫浮华殁 2024-08-03 17:06:32

我相信 Comeau Release 版本相当稳定。 当您购买商业 C/C++ 编译器时,您将主要为特定的功能付费。 您应该决定是否需要这些功能。

如果您没有特殊要求,GNU C/C++ 编译器是一个不错的选择。

I believe that Comeau Release version is pretty stable. When you buy commercial C/C++ compiler you'll pay mostly for specific features. You should decide whether you need those features.

If you don't have special requirements GNU C/C++ compiler is a great choice.

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