3 ms·
> If you don't have years to spare, an incremental rewrite would be a viable option. But do Objective-C or C++ really look like a good choice nowadays? Anythin
by derefr 13y ago
> If you don't have years to spare, an incremental rewrite would be a viable option. But do Objective-C or C++ really look like a good choice nowadays?
Anything that compiles to native modules and has a clean C FFI would work. You could encapsulate the current code into a black-box set of APIs, and then transition those APIs module-by-module from being calls into the old crufty code, to being calls into shiny new rewritten code. (This is the strategy recommended at http://laputan.org/mud/ http://laputan.org/mud/).
Go is pretty perfect for your use-case, though; it produces portable, low-ish level application code, and while it's a bit less performant than C, you don't really need every scrap of C's performance in the way an OS or a 3D game does. Besides all that, it's very easy for grumpy, staid old C developers to learn, in the same way that Plan9 is easy for grumpy, staid old Unix administrators to learn: it's all the same ideas, just streamlined for newer use-cases.
- heinrich5991 13y agoI don't think Go is the right option here, while you can call C code from Go, last time I checked it wasn't possible to call Go from C without having it called the other way around before. I'd rather suggest going for C++ (or maaybe Rust... well, not really).
- kibwen 13y agoThe language may not be mature yet, but C code can very easily call into Rust code (and, by proxy, any language that can call into C can call Rust code).