热重新编译C ++ [英] Hot recompilation for C++

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

问题描述

我最近惊讶地发现,Java代码被自动重新编译并注入到正在运行的程序中。由于现代C ++编译器(例如,基于LLVM的)开始调查JIT编译,我想知道是否有任何关于这个主题的工作。

I was recently amazed to see Java code being automatically recompiled and injected into a running program. Since modern C++ compilers (eg. LLVM-based) start investigating JIT compilation, I am wondering if there is any work made on this topic.

更新: / em>通过热重新编译,我的意思是编辑代码,重新编译可执行文件的特定部分并运行它而不重新启动程序。常见的用例是具有无限循环的游戏引擎,您可以在渲染步骤中编辑一些代码,并在下一个框架中查看更改。

Update: By "hot recompilation", I mean editing the code, recompiling a specific part of the executable and running it without restarting the program. The common use case would be a game engine with an infinite loop where you would edit some code in the rendering step, and see the changes on the next frame.

什么是C ++的热重编译研究状态?

What is the research state of hot recompilation for C++? Is there any working implementation?

推荐答案

这是可能的,通过热重新编译,你的意思是在Visual C ++中编辑并继续

也许这个链接构成了你的问题的答案。

Maybe that link constitutes an answer to your question.

但是,如果你定义你要问的术语,热重新编译 ,更清楚(因为我写的这个没有很好定义)。

But it would be easier if you would define the term you're asking about, "hot recompilation", more clearly (as I'm writing this it's not well defined).

添加
编辑并继续for C ++显然是在90年代的 Visual C ++ 6.0介绍 。所以它只是令人惊讶的是,一些Java实现可以做到现在。 < g>但是,我记得,启用编辑和继续的 / Zi 开关也改变了 __ LINE __ 以便例如原始的 ScopeGuard 实施无法正常工作(然后必须使用Microsoft专用的 __ COUNTER __ )。

added: "Edit and continue" for C++ was apparently introduced with Visual C++ 6.0, in the 1990's. So it's only slightly amazing that some Java implementation can do it now. <g> However, the /Zi switch that enables edit-and-continue does also, as I recall, change the behavior of __LINE__ so that e.g. the original ScopeGuard implementation doesn't work (one then has to use Microsoft-specific __COUNTER__).

hth。,

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

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