Silverlight和C ++或C ++到C#正在进行代码转换?

时间:2022-12-29 03:14:49

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.

我正在开发基于绘图的产品,我希望按照优先顺序为iPhone,桌面OS / X,Windows平板电脑,基于Silveright的浏览器,Windows Mobile和Windows生成版本。

For GUI portability, the classic answer is to keep the core in C++ and use Cocoa/Objective-C or WPF/C# thin layers.

对于GUI可移植性,经典的答案是将核心保留在C ++中并使用Cocoa / Objective-C或WPF / C#薄层。

However, Silverlight complicates the choices.

但是,Silverlight使选择变得复杂。

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 %).

我将我的代码迁移到C ++ / CLI并维护双代码库(使用一些宏来伪造C ++ / CLI上下文关键字以及一些司法搜索并替换^和%)也没有任何问题。

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:

从我迄今为止所能找到的内容来看,似乎不太可能在Silverlight中支持C ++ / CLI。这让我有了选择:

  1. Once-off migration of a v1.0 C++ source base into C# and ongoing parallel maintenance
  2. 将v1.0 C ++源代码库一次性迁移到C#并进行持续的并行维护

  3. 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.
  4. 使用从C ++到C#的工具(建议请!)进行实时移植,反之亦然,这足以成为构建过程的一部分。

  5. Architectural separation of the Silverlight version so the C++ logic remains on a server. I'm a bit uncomfortable about the performance implications.
  6. Silverlight版本的架构分离,因此C ++逻辑仍保留在服务器上。我对性能影响有点不舒服。

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.

任何人都可以提出替代方案,在Silverlight中提供有关C ++ / CLI的好消息或推荐移植工具吗?我非常擅长使用C ++或C#作为后端的主要语言,只要端口可靠。

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.

编辑:看看有形软件解决方案提供的产品范围,他们对转换器的说明清楚地表明,将C#转换为C ++比其他方式更容易。这就像我预期的那样 - 它提出了一些有趣的想法,即将我的C ++风格限制为最不常见的OO分母。

1 个解决方案

#1


Architectural separation of the Silverlight version so the C++ logic remains on a server. I'm a bit uncomfortable about the performance implications.

Silverlight版本的架构分离,因此C ++逻辑仍保留在服务器上。我对性能影响有点不舒服。

I'd do this. The performance is probably not as bad as you imagine.

我会这样做的。表现可能没有你想象的那么糟糕。

#1


Architectural separation of the Silverlight version so the C++ logic remains on a server. I'm a bit uncomfortable about the performance implications.

Silverlight版本的架构分离,因此C ++逻辑仍保留在服务器上。我对性能影响有点不舒服。

I'd do this. The performance is probably not as bad as you imagine.

我会这样做的。表现可能没有你想象的那么糟糕。