TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How to made a Windows-tied library cross-platform?

4 点作者 mTh超过 15 年前
Our main language (Delphi) will be, most probably, cross-platform in its next version.<p>While writing a cross-compiler isn't a thing which interests us very much now, porting a library which was/is Windows-tied to multiple platforms, /certainly/ does.<p>You can think, for example at VCL (Delphi's standard library). While it was designed for Windows only, it has value in it, and, of course, there are huge codebases which depend on it.<p>The question is: Which would be the best approach to made an application / library cross-platform aware ensuring a smooth conversion / upgrade path (as much as possible of course)?<p>I stress it again, we are not interested which is the best way to do cross-platform development <i></i>only<i></i> (there were questions on this theme). We are interested <i>also</i> in yet another requirement: The old code base / installations management.<p>PS: Experiences and/or methodologies from similar situations with other languages (eg. C/C++) which are regarded as standard practices are welcomed.<p>Thanks in advance.

4 条评论

mahmud超过 15 年前
In the words of the great Walter Sobchak: "you're entering a world of pain".<p>The best advice I can offer you is to wrap up your application's functionality into a clean library that could be made into remote services (RPC, SOAP, CORBA, COM, etc. or preferably JSON-RPC or XML-RPC) then make a a VMWare image (or similar) virtualization tool of the app and its environment. You could still use the code that way from any platform, but it's pretty much stagnant and all new improvements and extensions will either have to be made on Win32, or as external interface wrappers to augment a limited shell.<p>Code reuse was already hard enough, but the RAD tools and IDEs made it considerably so. You can't believe how many shops keep Visual Studio 6.0 installation just to build their projects, because later version of VS frobbed the building process and screwed up old resource files.<p>I dread to think of the future that awaits stuff running on the Java stack that can't be built without tools from now defunct vendors.
评论 #822237 未加载
utku_karatas2超过 15 年前
Depends highly on the project type but if we're talking about a typical Delphi GUI app you don't need to be worry much if you depend on the RTL/VCL more than WINAPI itself.<p>I don't know about Emba.'s actual plans but what they refer to as cross-platform should be a proper port of runtime and VCL. They tried this before with Kylix but killed the project for reasons yet unknown to me (probably didn't raise much cash). So at least to have a taste of how things will work out in the future, I suggest you check out Kylix.
评论 #822177 未加载
dchest超过 15 年前
What will be cross-platform in Delphi? VCL? Then rewrite everything that uses WinAPI with VCL.<p>Without specifics, there's no answer.
评论 #822153 未加载
mTh超过 15 年前
Hmmm... what about tooling in the IDE which will push for MVC-type of development?