4 ms·
>Are there any languages where the different implementations "play well with each other"? Yes: Common Lisp, Java, C and C++, to give four examples. Javascript
by flavio81 9y ago
>Are there any languages where the different implementations "play well with each other"?
Yes: Common Lisp, Java, C and C++, to give four examples. Javascript as well. All these languages have formal standards, which helps a lot.
>Which major incompatibilities are you thinking of between CPython and PyPy, which are the two I use most often? Are they more severe than the incompatibilities between the different Common Lisp, which the author describes?
PyPy attempts to implement the full Python 2.7 language but there are things missing. You argue that Python's CFFI features are "implementation-specific", let's just agree with this; but the Python 2.7 language also defines -as part of the spec- many modules, and PyPy does not implement all of those modules, so it's not implementing the full set of features defined by that spec.
Code written in Common Lisp should run (and often runs) correctly with no change in all mature Common Lisp implementations (and there are many of them), unless the code uses implementation-dependent features. Those implementations implement the full set of features defined by the ANSI Common Lisp standard.
- eesmith 9y agoAhh, I see you have a different definition of "play well with each other" than I do. I was thinking of things like having two different C++ compilers generate .o files which can then be linked together. Since the ABI isn't part of the C++ specification, there have been many problems (see https://stackoverflow.com/questions/7492180/c-abi-issues-list https://stackoverflow.com/questions/7492180/c-abi-issues-lis... ) in getting two different C++ compilers to work together. The platform-specific ABIs help, a lot, but don't solve all the problems. Regarding missing modules, which ones? And don't C compilers have similar issues? https://en.wikipedia.org/wiki/C99#Implementations https://en.wikipedia.org/wiki/C99#Implementations helpfully points out Clang "Supports all features except C99 floating-point pragmas", and Microsoft's compiler doesn't implement tgmath.h. I thought also that most Python code runs correctly with no change in CPython and PyPy, where "correctly" includes not using implementation-dependent features like third-party C extensions or garbage collection behavior.