4 ms·
I agree, but I think there is a middle ground, which is to use the strengths of multiple languages in the same app. And interestingly, one of the examples you
by makecheck 16y ago
I agree, but I think there is a middle ground, which is to use the strengths of multiple languages in the same app. And interestingly, one of the examples you gave is an app that I wrote (MacTelnet), which doesn't just use Python; it also calls C++ and Objective-C. :)
While C was the first language used, I added the others to gain their strengths, which include maintainability and access to powerful libraries.
- gte910h 16y agoAlmost all languages use C libraries at some point (as that's what the OSes are written in), but yes, several of the apps are multilanguage. I find python + weave.inline (insert C++ which is dynamically compiled the first time called) pretty awesome at getting performant apps which are fast to build and simple to debug.
- corysama 16y agoI expect that the middle ground of C+HLL is more common than the purist approach simply because it makes sense to use the right tools for very different jobs. I know that Eve is Python on top of a large, custom C++ code base. Civ and Blender as well. Adobe's Lightroom is a nice case study of 50% C++ and 50% Lua. I've never used Python+Weave, but it makes total sense. I do think Python's built-in CTypes library is unfortunately underused. (highlights: You can create C-callable function pointers and you can call C DLL functions from default Python. No add-on libs required.)
- gte910h 16y agoAlmost all the alternatives are quite a bit easier to use than ctypes, with the exception of SWIG
- gte910h 16y ago>interestingly, one of the examples you gave is an app that I wrote (MacTelnet), which doesn't just use Python; it also calls C++ and Objective-C. :) What a small world. Did you write the C and ObjC code it's calling, or are they independent libraries?