Time taken for double calculation: 1.716163ms
Time taken for Kahan double calculation: 3.549576ms
Time taken for BigDecimal calculation: 97.298124ms
Value diff for simple sum: 8.68145523891E-10
Value diff for Kahan sum: 1.854476109E-12
Performance of Java Code Translated from COBOL, UniqueSoft
COBOL is a compiled language with stack allocation, pointers, unions with no run-time cost of conversion between types, and no run-time dispatching or type inference. Java, on the other hand, runs on a virtual machine, has heap allocation, does not have unions, incurs overhead when converting between types, and uses dynamic dispatching and run-time type inferencing. While it is possible to minimize the amount that these features are used, that usually comes at the cost of having code that is not very “Java like”. A common complaint with translators is that the resulting Java code is unreadable and unmaintainable, which defeats much of the purpose of the migration.
Wait, so this article is saying out of the thousands of languages that exist today, none can do what COBOL can do without a performance hit?? What a ridiculous claim.
The article compares COBOL specifically to its main rival in enterprise, Java, not making a more general claim. Obviously, other languages with optimizing compilers and fast math libraries would perform comparably or better.
I've always wondered where did COBOL disappear? While there are adaptations of languages like Smalltalk, or LISP everywhere I don't see COBOL getting a modern version. I believe we need a language that marries modern bytecode/compiled languages with syntax of COBOL. It doesn't need to be 100% COBOL just good parts (like Ruby took from Smalltalk) and build a high performance business language that can replace modern web development systems.
7 comments
0 u/ilikeskittles 29 Jul 2018 21:55
Interesting article.
0 u/309238482732 30 Jul 2018 09:05
Do these people know, that they could just create a CobolNumber class that does all the math exactly like cobol does it?
0 u/Osmanthus 30 Jul 2018 09:51
yeah, this article is garbage
0 u/Anam [OP] 30 Jul 2018 10:15
No, but they mention the BigDecimal class (on which CobolNumber is presumably based) and there is some discussion of performance cost:
BigDecimal vs double: illustration of accuracy and performance impact
Performance of Java Code Translated from COBOL, UniqueSoft
https://www.uniquesoft.com/pdfs/UniqueSoft-Performance-Considerations-COBOL-to-Java.pdf
0 u/Forevermary 31 Jul 2018 14:04
Wait, so this article is saying out of the thousands of languages that exist today, none can do what COBOL can do without a performance hit?? What a ridiculous claim.
0 u/Anam [OP] 31 Jul 2018 15:07
The article compares COBOL specifically to its main rival in enterprise, Java, not making a more general claim. Obviously, other languages with optimizing compilers and fast math libraries would perform comparably or better.
0 u/x0a1b 07 Aug 2018 00:33
I've always wondered where did COBOL disappear? While there are adaptations of languages like Smalltalk, or LISP everywhere I don't see COBOL getting a modern version. I believe we need a language that marries modern bytecode/compiled languages with syntax of COBOL. It doesn't need to be 100% COBOL just good parts (like Ruby took from Smalltalk) and build a high performance business language that can replace modern web development systems.