News for hackers. Stuff that matters.
Re:Cobol Still Powers the Global Economy by dlivingston on Tuesday July 16, 2019 @06:52PM (#20454650)
> “I think there is a misconception about [COBOL]. A misunderstanding about it as far as it being old. Usually in technology we think because it is old it is irrelevant,” he said. “But it’s still the fastest processing language out there.”

I thought this comment was born from naivety or bias, but after reading up on it a little further, it appears that it's true or close to true for many cases.

Re:Cobol Still Powers the Global Economy by tapland on Tuesday July 16, 2019 @07:26PM (#20454871)
I think it mostly stems from IBM compiler optimizations for their mainframes (which is most of today's COBOL), and not the language itself.

I do COBOL mostly in OpenVMS and only tinker with IBM in the weekends but it would be cool to see how it performs under the same circumstances compared to other languages.

Re:Cobol Still Powers the Global Economy by kragen on Wednesday July 17, 2019 @02:09AM (#20456935)
You surely know more about COBOL than I do, but what about decimal arithmetic? I mean if the problem domain requires arithmetic correctly rounded to thousandths, with the operands loaded from fixed text fields and the results stored in fixed text fields, COBOL gives you that directly in the language, and presumably on a relatively efficient form. I don't know if using instructions like 8086 DAA and AAA is a win on today's CPUs, but surely avoiding the sequence of long divisions to convert from binary to decimal is a win (if what you're doing between input and output is, like, an addition and a multiplication by 1.0575, or something). Are you thinking that maybe some C++ template Decimal class with some integer parameters is going to beat GnuCOBOL on an amd64?
Re:Cobol Still Powers the Global Economy by tapland on Wednesday July 17, 2019 @03:16AM (#20457232)
I wish I could give you a good answer, but I really haven't dug deep into the pros of the language. If you see any review of this I'd love to read it as well.
Re:Cobol Still Powers the Global Economy by kristopolous on Wednesday July 17, 2019 @01:33AM (#20456761)
Your day job, in 2019, is COBOL on OpenVMS? really? Tell me more. Is this new code? Are you using new hardware? Do you want my old alpha?
Re:Cobol Still Powers the Global Economy by tapland on Wednesday July 17, 2019 @03:23AM (#20457266)
Been doing this for just over a year and mostly been doing new development where the need has just asrisen.

We run Itanium (exciting that the first OpenVMS X86 boot was recently) and when/if I can afford a house it's going to have plenty of hard toys!

Re:Cobol Still Powers the Global Economy by HeWhoLurksLate on Wednesday July 17, 2019 @07:20AM (#20458245)
Shameless plug for r/homelab- if you're interested in doing server stuff at home, they're a great community to be a part of.
Re:Cobol Still Powers the Global Economy by randomerr on Tuesday July 16, 2019 @08:03PM (#20455132)
I've been able to get the same or very similar performance with modern languages that are a lot easier to debug. It just a matter of developers and management letting go of the old ways.
Re:Cobol Still Powers the Global Economy by tapland on Wednesday July 17, 2019 @03:14AM (#20457227)
And the company willing to fork out ??? to migrate.
Re:Cobol Still Powers the Global Economy by lostmsu on Tuesday July 16, 2019 @07:07PM (#20454755)
I'd be curious to see one. That statement seems extremely improbable.
Re:Cobol Still Powers the Global Economy by 6thaccount2 on Tuesday July 16, 2019 @07:25PM (#20454866)
Why? It is fairly close to the metal and runs on hardware DESIGNED to be fast for transactions. IBM mainframes aren't even expressed in flops but some other unit designed to represent transactions per second.

Edit: googled it and they use MIPS (millions of instructions per second).

Re:Cobol Still Powers the Global Economy by Smoosh on Wednesday July 17, 2019 @02:05AM (#20456913)
Well, in the mainframe world, people don't typically measure in MIPS or FLOPS for day-to-day work. It's all about efficiency and throughput. We care about actual elapsed time, and resource consumption rather than some abstract benchmarking metric. Part of this is because a batch job will NEVER get 100% of the CPU, because it is sharing the system with so many other processes.

                                        ----TIMINGS (MINUTES)-----                          -----PAGING COUNTS---- 
  STEPNAME PROCSTEP    RC   EXCP   CONN       TCB       SRB  CLOCK          SERV  WORKLOAD  PAGE  SWAP   VIO SWAPS
  ENDES000             00  15522   2105  0.019965  0.000636    0.1        116946  BATCH        0     0     0     0
Re:Cobol Still Powers the Global Economy by lostmsu on Wednesday July 17, 2019 @02:57AM (#20457168)
Elapsed time is the typical benchmarking metric, used, for example, by the language benchmarks game.

Not sure what "abstract metrics" are you referring to.

Re:Cobol Still Powers the Global Economy by igouy on Wednesday July 17, 2019 @11:41AM (#20460651)
Re:Cobol Still Powers the Global Economy by lostmsu on Wednesday July 17, 2019 @12:19PM (#20461137)
I know what latency and throughput are. I am asking what "abstract metrics" previous commenter was referring to as opposed to these.
Re:Cobol Still Powers the Global Economy by 6thaccount2 on Wednesday July 17, 2019 @08:21AM (#20458632)
Thanks for the helpful background. I think what I said still stands though.

In the PC world, my computer has a certain number of FLOPS even though it has no impact on my day to day work where I care more about RAM and such.

Re:Cobol Still Powers the Global Economy by lostmsu on Tuesday July 16, 2019 @07:28PM (#20454883)
Exactly because there are no public benchmarks.
Re:Cobol Still Powers the Global Economy by 0815test on Tuesday July 16, 2019 @07:30PM (#20454902)
What do you mean by "transactions" in this context? I don't think either COBOL or old IBM mainframes support software transactional memory (STM) as that's a fairly exotic technique that's mostly seen in the context of Haskell and the like, even though it does seem interesting as a model for concurrency.
Re:Cobol Still Powers the Global Economy by 6thaccount2 on Tuesday July 16, 2019 @07:49PM (#20455035)
Like user bin0 said below, a mainframe can do 30k to 1.1M transactions like wire transfers in a second.

They also have rediculously high up times and much higher security (probably mostly via obscurity).

Unfortunately, they're insanely expensive.

Re:Cobol Still Powers the Global Economy by hermitdev on Tuesday July 16, 2019 @09:21PM (#20455565)
Probably more obscurity than actual security, in my experience. I once knocked off about 10k users off of a dev mainframe LPAR simply by running a SQL query (crashed DB2 and the underlying OS). With someone with more experience than I had, probably could have been exploitable. It was an accident, but it happened.

Mainframes weren't nearly as rock solid as their reputation in the 3 years of dealing with them that I had.

Mainframes were great at processes that need high IO.

I've not dealt with them in close to 20 years, so dont know how current x64 linux or Windows stacks line up.

Mainframes are hugely expensive. 20 years ago, entry level for the hardware was around $500k, IIRC. Dont think that even provided storage or software licenses. But, yeah, youve got one largely extremely reliable piece of big iron that can handle nearly all of your needs.

Re:Cobol Still Powers the Global Economy by 6thaccount2 on Wednesday July 17, 2019 @08:31AM (#20458703)
I assume the focus is on big businesses and banks that can afford those numbers.

Kind of like how KDB+ is so expensive as they're targeting a niche audience. Even though that is purely software.

Re:Cobol Still Powers the Global Economy by OskarS on Wednesday July 17, 2019 @08:00AM (#20458474)
I'm a little bit confused by the terminology here. What exactly is a "transaction", in a lower-level sense? What does it consist of? Is it pure CPU processing of one data structure to another? Is it shuffling things around in a (local? remote?) database? Is negotiating a transaction with another mainframe somewhere else over TCP?

It matters, because otherwise any kind of performance number is meaningless. If it's just CPU processing, then 1.1 million is not that much. If it's doing some sort of network handshake/transaction with other mainframes, then it's VERY impressive.

Re:Cobol Still Powers the Global Economy by fork1 on Wednesday July 17, 2019 @09:49AM (#20459428)
You tend to have two types of processing done in a mainframe, batch and online. Transactions usually refer to online work. In the old times, it used to be someone connecting in 3270 and issuing a bunch of "transactions" to bring up screens and perform various operations. Now, it would likely involve a web layer. The server part can be CICS for example, but they are others. Think of them as application servers. Proper batch jobs tend to perform even faster. There is a few reasons to that, one of them is the full integration of the systems (ie: the batch has "shared" memory access to the database, basically it's a big stored procedure).
Re:Cobol Still Powers the Global Economy by bin0 on Tuesday July 16, 2019 @07:41PM (#20454970)
Not in that sense, in the sense of "how many cart checkouts, wire transfers, other business logic transactions can I perform per unit x time?"
Re:Cobol Still Powers the Global Economy by greglindahl on Tuesday July 16, 2019 @11:58PM (#20456300)
The concept of a transaction predates software transactional memory. It's a database term going back to when databases were invented.
Re:Cobol Still Powers the Global Economy by ethbro on Tuesday July 16, 2019 @08:05PM (#20455135)
Not particularly.

It's analogous to saying 'A 60 year old language has better compilers than younger languages.'

Which doesn't seem especially provocative.

Re:Cobol Still Powers the Global Economy by lostmsu on Wednesday July 17, 2019 @03:07AM (#20457199)
It is quite provocative, considering the amount of activity over compiler's codebase. Which in case of COBOL is likely very close to 0.
Re:Cobol Still Powers the Global Economy by lboc on Wednesday July 17, 2019 @04:37AM (#20457607)
Both IBM Enterprise COBOL [0] and GnuCOBOL [1] are in active development, and recent releases (September 2017 for both) appear to include support for the COBOL2014 standard.

Not perhaps in the same league as more fashionable languages, but certainly a fair distance away from 'close to 0'.

[0] https://www-01.ibm.com/software/support/lifecycleapp/PLCDeta... [1] https://en.wikipedia.org/wiki/GnuCOBOL

Re:Cobol Still Powers the Global Economy by AnimalMuppet on Tuesday July 16, 2019 @07:57PM (#20455092)
The fastest processing language... for what?

First, it's never going to be faster than assembly on the same machine. That is not possible.

Second, I bet it's not faster than Fortran at matrix multiplication. (And anyone who tries to do matrix multiplications in COBOL should be barred from touching a keyboard for the rest of their life.)

What it may be the fastest at is certain business calculations. And it may be the fastest at them because they are traditionally carried out in fixed-point arithmetic. IIRC (and I may not), some mainframes had specific instructions/opcodes for fixed-point math. If COBOL uses those, and other languages don't, then COBOL could in fact be the fastest... at fixed-point math calculations. That's still a long way from "the fastest processing language", though.

The claim sounds like someone has mistaken their little corner of computing for the whole universe...

Re:Cobol Still Powers the Global Economy by tasty_freeze on Tuesday July 16, 2019 @09:51PM (#20455719)
> The fastest processing language... for what?

It seems pretty clear from context that it means for doing report generation and accounting things that COBOL is known for, not for LINPACK.

> it's never going to be faster than assembly on the same machine.

You are being unhelpfully pedantic. It is not insightful to say an optimal assembly program is going to be at least as fast as a compiler for a higher level language.

Re:Cobol Still Powers the Global Economy by Tehdasi on Wednesday July 17, 2019 @12:31AM (#20456471)
I reckon the guy in the article was referring to COBOL basically having fixed sized data structures. Having all your data structures of a fixed size does allow for alot of optimizations that would otherwise not be available. However, you can make fixed size data structures in any language, and the benefits of this is somewhat moot with the large caches and fast CPUs (compared to IO) of modern computer systems.
Re:Cobol Still Powers the Global Economy by Annatar on Wednesday July 17, 2019 @02:50AM (#20457123)
Actually it's very insightful since there are a lot of people who believe that a modern compiler can beat hand-written assembler code. Raising awareness about assembler and how the machine actually works equates to better working conditions for everyone, as we'll have more competent and knowledgeable colleagues then.
Re:Cobol Still Powers the Global Economy by tasty_freeze on Wednesday July 17, 2019 @10:58AM (#20460152)
Modern compilers can often beat hand-written assembler code in practice. Theoretically they can't, but we don't live in the theoretical world. The common belief is true because most people understand the distinction.

How can that happen? One reason is choice of algorithms -- the same reason why two programmers using the same language to complete the same task can produce remarkably different results.

Another reason is profile-driven optimization -- in theory the assembly language programmer can do this too, but the effort of restructuring lots of handwritten code is too painful. Yes, it is done sometimes (eg, different inner loops for video codecs for different versions of x86 cpus).

Likewise, optimizers and superoptimizers understand the pipeline quirks of specific processors better than most people writing assembly language for x86-type processors and can produce better results.

Re:Cobol Still Powers the Global Economy by Annatar on Thursday July 18, 2019 @09:26AM (#20469497)
Case in point. What you belive is a myth. It's not true. A compiler will never be able to beat a human at writing assembler code. Read any tutorial at constructing compilers to understand why.
Re:Cobol Still Powers the Global Economy by kragen on Wednesday July 17, 2019 @02:12AM (#20456951)
It's bizarre and alarming that this fairly reasonable and well-informed (if somewhat hyperbolic) comment is downvoted into the deep grey.
Re:Cobol Still Powers the Global Economy by simonh on Wednesday July 17, 2019 @02:42AM (#20457087)
Not a downvoted, but tempted.

The question ‘fastest at what’ is right there in the original quote - processing. Assembly isn’t commonly considered a ‘processing language’ and in the context processing is a term of art for the kind of batch processing tasks cobol was designed for.

Even that aside, we all ‘know’ assembly is the fastest. It’s a given. Nitpicking comments like that betrays a hostile attitude and lack of generosity of spirit. We shouldn’t have to post pages if caveats and justifications and hedging for a comment like that.

Attacks like this come across as intellectual grandstanding and aren’t actually contributing anything of value.

Re:Cobol Still Powers the Global Economy by rdiddly on Wednesday July 17, 2019 @03:38AM (#20457336)
I agree all the indignation is a bit much. The B in COBOL stands for Business, so, surprise, it's good at business stuff. It's right there on the label.
Re:Cobol Still Powers the Global Economy by kragen on Wednesday July 17, 2019 @03:03AM (#20457187)
I am not familiar with this sense of the term “processing”, so perhaps it's less widely understood than you think. I assumed that in the context it meant the kind of processing the Central Processing Unit and Graphics Processing Unit in my hand computer does, which is pretty broad.

So I thought it was a reasonable criticism of an overly broad or at least very ambiguous assertion, regardless of its motivation. It’s quite common for the best arguments against an argument to come from people who are hostile to it for whatever reason. More carefully defining the scope of things where we would expect COBOL to get top performance marks would make the conversation far more informative and productive.

As for assembly, there is now a broad class of problems for which CPU assembly is far from the fastest solution, because GPUs are faster. Even on the CPU, there is a widespread (but usually false) belief that compilers beat expert assembly programming. So perhaps to you it's a vacuously true statement that adds no useful information, I read it as rebutting a belief many readers may really have (though, unfortunately, only as a bare assertion.)

Re:Cobol Still Powers the Global Economy by simonh on Wednesday July 17, 2019 @09:34AM (#20459268)
If you don't know, look it up or ask a question. Launching into argumentative nitpicky screeds that are actually it turns out irrelevant to the point in discussion is just annoying.

I think it's unreasonable to expect every comment about every bit of technology, old or new, discussed on HN to come with pages of preamble, caveats and definitions of terms.

Re:Cobol Still Powers the Global Economy by kragen on Wednesday July 17, 2019 @12:35PM (#20461310)
As I said, I think you are mistaken about how widespread that definition is, so looking it up wouldn't have helped.