Silverlight 和 C++ 或 C++ 到 C# 的持续代码转换?
我正在开发一个基于绘图的产品,我希望按照优先级顺序为 iPhone、桌面 OS/X、Windows 平板电脑、基于 Silveright 的浏览器、Windows Mobile 和 Windows 生成版本。
对于 GUI 可移植性,经典的答案是保留 C++ 核心并使用 Cocoa/Objective-C 或 WPF/C# 薄层。
然而,Silverlight 使选择变得复杂。
将我的代码迁移到 C++/CLI 并维护双代码库(使用一些宏来伪造 C++/CLI 上下文关键字以及一些司法搜索和替换 ^ 和 %)不会有任何问题。
从我到目前为止找到的来看,似乎不太可能Silverlight 将支持 C++/CLI。 这给我留下了选择:
- 将 v1.0 C++ 源代码库一次性迁移到 C# 并持续并行维护
- 使用工具(请推荐!)从 C++ 实时移植到 C#,反之亦然,这足够顺利构建过程的一部分。
- Silverlight 版本的体系结构分离,因此 C++ 逻辑保留在服务器上。 我对性能影响有点不舒服。
任何人都可以提出替代方案、提供有关 Silverlight 中 C++/CLI 的好消息或推荐移植工具吗? 如果端口可靠,我对这两种语言都足够熟悉,可以将 C++ 或 C# 作为我的后端主要语言。
编辑: 看看有形软件解决方案提供的产品范围,他们对转换器的注释清楚地表明,将 C# 转换为C++ 比其他方式更容易。 正如我所期望的那样——它引发了一些有趣的想法,将我的 C++ 风格限制为最不常见的 OO 分母。
I am working on a drawing-based product where I want to produce versions for iPhone, desktop OS/X, Windows Tablets, Silveright-based browser, Windows Mobile, and Windows in that order of priority.
For GUI portability, the classic answer is to keep the core in C++ and use Cocoa/Objective-C or WPF/C# thin layers.
However, Silverlight complicates the choices.
I wouldn't have any problem migrating my code into C++/CLI and maintaining a dual code base (with some macros to fake the C++/CLI contextual keywords and some judicial search and replace for ^ and %).
From what I've been able to find so far, it seems unlikely that C++/CLI will be supported in Silverlight. That leaves me with the options:
- Once-off migration of a v1.0 C++ source base into C# and ongoing parallel maintenance
- Live porting with a tool (recommendations please!) from C++ to C# or vice-versa, which is sufficiently smooth to be part of a build process.
- Architectural separation of the Silverlight version so the C++ logic remains on a server. I'm a bit uncomfortable about the performance implications.
Can anyone suggest alternatives, provide good news on C++/CLI in Silverlight or recommend porting tools? I'm sufficiently comfortable in either language to make C++ or C# my main language for the backend provided a port is reliable.
Edit:
Looking at the range of products offered by Tangible Software Solutions, their notes on the converters make it clear that converting C# to C++ is easier than the other way. That is as I expected - it raises interesting thoughts as to constraining my C++ style to be least-common-OO-denominator.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会这样做。 表现可能并没有你想象的那么糟糕。
I'd do this. The performance is probably not as bad as you imagine.