[–] 309238482732 0 points 4 points (+4|-0) ago 

We tried to rewrite the code in Java and Java couldn’t do the calculations right.

Do these people know, that they could just create a CobolNumber class that does all the math exactly like cobol does it?

[–] Anam [S] 0 points 3 points (+3|-0) ago 

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

 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.

[–] Osmanthus 0 points 0 points (+0|-0) ago 

yeah, this article is garbage

[–] x0a1b 0 points 1 points (+1|-0) ago 

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.

[–] ilikeskittles 0 points 1 points (+1|-0) ago 

Interesting article.

[–] Forevermary 0 points 0 points (+0|-0) ago  (edited ago)

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.

[–] Anam [S] 0 points 1 points (+1|-0) ago  (edited ago)

The article is comparing 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.