TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

What if we could transpile COBOL into Elixir

58 pointsby cgarvisalmost 4 years ago

15 comments

cdumleralmost 4 years ago
There are plenty of ways to port out of COBOL, none will work.<p>I once interviewed for a COBOL position. It was a typical large financial institution. It was a lead position that wanted a migration plan out and then would lead to a team for me. I have a lot of systems integration and information management knowledge. I have worked on planning multi-year projects and migrating out of large systems like this before. The interview went well, and afterwards they showed me around the place and what they were doing.<p>I sat down again in the office with the hiring director, and I enquired about how long he has been with the company and what he has been working on. Turns out he had been hired in five years ago and had already attempted this once before without success. I knew without a doubt why they didn&#x27;t have success, and it had nothing to do with COBOL.<p>Financial companies are highly risk adverse. COBOL developers know this. COBOL developers know that if the shop isn&#x27;t COBOL their job is at risk. So, COBOL developers will constantly introduce &quot;what about this risk&quot; issues, which then must be considered in committee; thus, the company is eternally paralyzed. The fact that the director couldn&#x27;t make it anywhere in five years meant nothing was going to change.<p>As I recall, I checked in a few years later and they were still in the same place. I suspect it might have been a decent place if all I wanted in life was a paycheck. They were nice people.
评论 #28143394 未加载
评论 #28269806 未加载
评论 #28142360 未加载
评论 #28142596 未加载
评论 #28158493 未加载
restlessbytesalmost 4 years ago
&gt; What if we could transpile COBOL into Elixir<p>You&#x27;ve then successfully ported your code base from one language for which it&#x27;s really difficult to find programmers to another language for which it&#x27;s really difficult to to find programmers.
评论 #28142041 未加载
评论 #28142060 未加载
评论 #28143054 未加载
WJWalmost 4 years ago
You can transpile anything to anything, but computers will not be able to rewrite the code to match idiomatic style in the new language. Rather, (taking the example from the article) you get COBOL style in Elixir syntax and everyone is unhappy. Much better options are to maintain a COBOL team that continuously updates the program during its lifetime so that knowledge of how it works is never lost, or (if that is no longer possible) do periodic rewrites every two decades or so.<p>If your first response to this is &quot;but that would cost a fortune!&quot;, you are completely correct. The biggest illusion in software is that a &quot;complete&quot; program is now &quot;done&quot; and will need no more investment. Software is a machine for producing information, fundamentally not much different from a lathe or a textile loom. If your company depends on a piece of software to continue existing, it is now de facto a software company. Many institutions have not yet realized this and will run into existential problems within a few decades.
评论 #28142037 未加载
bencollier49almost 4 years ago
The issue typically isn&#x27;t just the COBOL itself, but the surrounding architecture. This will take in the nuances of the underlying operating system, system language operations and batch tasks.<p>For example, the COBOL might potentially have been on an ICL VME system. This will undoubtedly have a lot of support code written in things like SCL (System Control Language), and potentially even 68k assembly.<p>There are companies which specialise in migrating COBOL code from legacy environments. This can involve migrating the COBOL code itself to a different variant and rigorously testing it, and then often introducing utilities which replace operating system functionality which was present on the original mainframe.<p>The alternative is to &quot;salami slice&quot; bits of functionality into modern services written afresh, and slowly work towards decommissioning the old setup, but often this has to be done at the same time as a migration to modern hardware, due to the scale of the systems involved and the time taken for these sorts of projects to complete.
评论 #28144134 未加载
lucozadealmost 4 years ago
I feel a need to comment but I can&#x27;t find a form of words that isn&#x27;t condescending to the point of rudeness. So this will probably come off as rude...<p>Transpiling, to more or less any language, is the easy bit. By a very, very long way. The hard bit is everything else. I mean, do they really think they&#x27;re the first people to think about using a transpiler over the last 30&#x2F;40&#x2F;50 years?<p>If they had said that they&#x27;d used their transpiler on a real production codebase and their transpiled code <i>was now running in production in any volume</i>, I&#x27;d be quite impressed. But they didn&#x27;t say that because it&#x27;s blatantly obvious from the tone of the article that that will never occur.<p>Now, I don&#x27;t have any issue with people being ignorant of a subject that they don&#x27;t understand. That&#x27;s the norm for most people for most things. But I have to say that this level of naivety doesn&#x27;t reflect well on their company. They clearly made no effort to understand the problem that they are purporting to solve. Is that really how they function as a company?
Wildgoosealmost 4 years ago
The Japanese have a philosophy whereby they will rebuild a shrine every 20 years. The knowledge of what is necessary remains current, and understood. And the shrine continues in its purpose.<p>Perhaps we should consider how we can regularly rewrite different parts of our software ecosystems using new languages and approaches while preserving the essential knowledge and security aspects of what we have already built?<p>The important part isn&#x27;t the language that the code is written in, it is the full understanding of the problem and thus the solution provided.
评论 #28142782 未加载
评论 #28143338 未加载
评论 #28142722 未加载
评论 #28143164 未加载
tyingqalmost 4 years ago
You will have solved the easiest part. Now get started on replicating JCL, VSAM, CICS, IMS, RACF, and the rest of the ecosystem that COBOL code depends on :)
评论 #28141984 未加载
philipswoodalmost 4 years ago
Please no...<p>I&#x27;ve been unfortunate enough to witness first hand what +-5,0000,000 lines of Natural Adabas code transpiled to +-15,000,000 lines of Java code looks like, and it was not pretty.
评论 #28142136 未加载
评论 #28143145 未加载
评论 #28142913 未加载
pronoiacalmost 4 years ago
I checked my bookmarks, and there have been success stories for porting cobol into other languages. Here&#x27;s a discussion from 2019, from cobol into Java: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19839563" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19839563</a><p>Phase 1: automation of cobol to (ugly) Java<p>Phase 2: make the code more idiomatic for (cleaner) Java<p>Phase 3: move the infrastructure to AWS<p>In the discussion, someone mentioned &quot;There are commercial COBOL compilers available that compile to Java bytecode.&quot;<p>Offhand, if someone were still on cobol, I&#x27;m not sure if they&#x27;d trust the comparatively new Elixir, but I can also see leapfrogging being a thing. (And I know it&#x27;s based on Erlang, which pre-dates Java.)
tjalfialmost 4 years ago
This reminded me of the old lisp2cobol[0] joke script.<p>[0] <a href="https:&#x2F;&#x2F;stuff.mit.edu&#x2F;afs&#x2F;sipb.mit.edu&#x2F;project&#x2F;lisp2cobol&#x2F;l2c" rel="nofollow">https:&#x2F;&#x2F;stuff.mit.edu&#x2F;afs&#x2F;sipb.mit.edu&#x2F;project&#x2F;lisp2cobol&#x2F;l2...</a>
forgotpwd16almost 4 years ago
No one running COBOL will use it because those legacy applications &quot;just work&quot;. Debugging and making certain the resulted transpiled code does as well will take a monumental effort (read: money). That is why those codebases haven&#x27;t been ported because, based on similar efforts, transpilers are only partially easier than a manual rewrite.<p>That answering the what if question. The project itself is interesting.
scnsalmost 4 years ago
Why should we? When we have this: <a href="http:&#x2F;&#x2F;www.coboloncogs.org" rel="nofollow">http:&#x2F;&#x2F;www.coboloncogs.org</a><p>Sorry, no https availlable.
vajrabumalmost 4 years ago
Anybody who is developing a COBOL compiler should know that there&#x27;s a test suite for the language. See here (<a href="https:&#x2F;&#x2F;www.itl.nist.gov&#x2F;div897&#x2F;ctg&#x2F;cobol_form.htm" rel="nofollow">https:&#x2F;&#x2F;www.itl.nist.gov&#x2F;div897&#x2F;ctg&#x2F;cobol_form.htm</a>)<p>Also, I haven&#x27;t seen any mention of any of the bits of the COBOL ecosystem here? No DB2, IDMS, IMS DB&#x2F;DC, VSAM, CICS, REXX, JCL? These are a big part of why COBOL applications are sticky.
rhabarbaalmost 4 years ago
COBOL code is surprisingly readable when compared to &quot;modern&quot; JavaScript-like languages. The site linked above shows a very good example of this.
sharklazeralmost 4 years ago
Then you could transpile COBOL into Elixir...