The Forum for Discussion about The Third Manifesto and Related Matters

Please or Register to create posts and topics.

Types and all that @*#$.

12
Quote from Dave Voorhis on November 8, 2019, 8:46 am
Quote from AntC on November 8, 2019, 6:37 am

That's because Java is verbose compared to COBOL and especially compared to Fortran, and needing more nursing and feeding than a COBOL application.

Poor Java, always suffering under decade-old misconceptions.

For years, it was "Java is too slow", when it was only too slow for a year after its release due to lack of JIT compilation.

Java is still too slow for many applications. The compiled code is just about fast enough, but the garbage collection and memory size limits are bottlenecks.

Fortran is usually faster and sometimes much faster because it's easier to avoid memory allocation. It's been a while, but I think you just dimension an array or two using many GB of memory and leave the rest to the underlying virtual memory. Also, many computational algorithms benefit from easy/auto parallellisation.

C# too can beat Java if the code can be written with value objects, avoiding garbage collection.

C/C++ is a winner too, if you need to do a lot of memory allocation and don't mind the extra work keeping track.

We finally dispensed with that one only to get "Java is too verbose", when modern Java is blessed with:

  • Type inference, so no more awkwardly repetitious "Type variable = new Type()" or "Type1<Type2> variable = new Type1<Type2>()";
  • Lambdas, so no more clunky inner classes; and
  • Streams, so expressions instead of stateful loops and record-by-agonising-record processing.

At long last Java is catching up with C#. If only generics...

The JVM is no longer distributed separately from applications -- applications now bundle a JVM -- so nursing and feeding requirements are no different from any other application.

 

Andl - A New Database Language - andl.org
Quote from dandl on November 8, 2019, 10:19 am
Quote from Dave Voorhis on November 8, 2019, 8:46 am
Quote from AntC on November 8, 2019, 6:37 am

That's because Java is verbose compared to COBOL and especially compared to Fortran, and needing more nursing and feeding than a COBOL application.

Poor Java, always suffering under decade-old misconceptions.

For years, it was "Java is too slow", when it was only too slow for a year after its release due to lack of JIT compilation.

Java is still too slow for many applications. The compiled code is just about fast enough, but the garbage collection and memory size limits are bottlenecks.

Fortran is usually faster and sometimes much faster because it's easier to avoid memory allocation. It's been a while, but I think you just dimension an array or two using many GB of memory and leave the rest to the underlying virtual memory. Also, many computational algorithms benefit from easy/auto parallellisation.

C# too can beat Java if the code can be written with value objects, avoiding garbage collection.

C/C++ is a winner too, if you need to do a lot of memory allocation and don't mind the extra work keeping track.

For every language <x>, there are applications where <x> is too slow, and there is always something faster.

I had a good friend -- alas, now deceased -- who made a living (among the many colourful things he did to make a living) hand-writing optimised assembly code for specialised applications where no compiler was good enough. I know people who program FPGAs and design ASICs for when hand-written assembly is too slow because CPUs are too slow.

But that's not what Java's "too slow" was about. In the early days, Java was too slow for mundane business applications, i.e., performing standard financial and business calculations and shuttling bytes to and from databases to screens, files and network sockets. It hasn't been too slow for that after the first JIT compiler. For that kind of work -- and even for traditionally performance-intensive code like 3D games (Minecraft was first written in Java) -- Java can be plenty fast enough. Java is sometimes faster than equivalent C/C++ when JIT optimisation works particularly well, or when the parallel operations in Java Streams are used.

Of course, increases in hardware performance largely made "too slow" moot. Note that Python -- orders of magnitude slower than all the compiled languages -- is hugely popular in data science, a traditionally performance-demanding field.

I'm the forum administrator and lead developer of Rel. Email me at dave@armchair.mb.ca with the Subject 'TTM Forum'. Download Rel from https://reldb.org
12