6 ms·
IRS details strategy for replacing its most ancient computer code (2020)
- fargle 5y agoI once worked on a project to convert 200,000 lines of Fortran to C. Mostly F77 with some F4. Fortran and F4, especially in control-flow, is a fairly primitive language. 200K F77 is probably around the same size and complexity of 200K lines of IBM assembly. Computed GOTOs and other constructs that cannot be directly transformed to "structured" code flow. You can jump into and out of the middle of loops or subroutines. We looked at a F2C compiler process. This would have been exactly analogous to the Wang method. It produced working "C" code, but it was unreadable implementation-level gobbledy-gook. But we, like the IRS, wanted to maintain this product forward in the target language "C", as if it had been originally written in it, if possible. What we did worked extremely well. It took a bit over 3 man years with about two people. #1 - we had test cases. And if there was code that the test cases didn't hit we added it first. The IRS has a few hundred million returns a year and could easily make, say every return for the last 10 years, into a "pretty exhaustive" test suite. #2 - we did an incremental approach. We did NOT convert the F4/F77 into requirements and then do a clean-room top-down re-implement. It would never have worked. We arranged the system so we could run the program with the original F4/F77 and new C in parallel. We replaced one Fortran procedure with C at a time while keeping the test cases working. In assembly, even the definition of a procedure can be nebulous. But what you do is discover the 10-20 idioms of the assembly procedures, functions, reuse, etc. and tease out how to replace with "C" or ??? If this is a big issue, use either IDA Pro or Ghidra. If they don't support IBM assembly, then that's the first subcontract you let. #3 - My partner was fastidious. Instead of the test cases simply passing, he added the self-imposed restriction of bit-identical outputs. It took work but it was possible. One function/procedure at a time, one line at a time, the system was converted from old to new. All the time it produced bit-identical outputs for all tests. In the IRS case, the test cases should be every return ever processed yields bit identical results. #4 once the last F4/F77 was removed, any C that was not idiomatic C was lifted and rewritten in a normal procedural style. Stuff like weird state machines to simulate computed GOTOs and non-structured code. This refactoring, again, was bottom up and was tested to bit identical results of all tests (which is kind of excessive!) At the end we had a maintainable "high-level" language (C, yes, yes HN) exact equivalent. This is the kind of task where rigor and bottom up is precisely what is needed and is actually much more effective. Someone should do an FOIA act to get the source and then do a nice dissertation or senior project to do this and produce maintainable Java (and/or something nicer). I find the timeframe and budget the IRS proposed to be ridiculous and the odds of success negligible. A good hacker or two could do this with a 100th the resources. Epilogue: I believe this process was completed about 15 years ago. Since then, the system remains in constant heavy use. There have been exactly ZERO bugs due to the conversion. We later moved the system from an antique RISC environment to x64 Linux. This exposed 2-3 bugs due to word length and endian-ness, that process (since it was already standard C) took one person about 3 months.
- specialist 5y agoOn a lark, I would have tried to go the other way: Java (or whatever) to ALC. Then gradually move maintenance of IMF from ALC to Java (or whatever). FWIW, parallel development sucks and likely to fail, but I've not seen another strategy work at all.
- hindsightbias 5y agoWay before Eth, the IMF code (and its business brother BMF) is the law. Think the MF is wrong? Open a case and wait a month for the tax code analyst (often a lawyer) to respond with a writeup why your intepretation of written tax code and regs is wrong and the MF is correct.
- humanwhosits 5y agoIs it possible for a taxpayer to get a copy and dry-run it themselves?
- hindsightbias 5y agoYou would need an IBM mainframe.
- throw0101a 5y agoFor the record emulators exist: * https://en.wikipedia.org/wiki/Hercules_(emulator) https://en.wikipedia.org/wiki/Hercules_(emulator) Not sure how hard it is to get the system software. There are other ways to get time on one, including via IBM in an 'online course' of sorts: * https://mainframenation.com/mainframe/how-to-get-a-mainframe-access/ https://mainframenation.com/mainframe/how-to-get-a-mainframe...
- ajxs 5y agoIn France it is: https://framagit.org/openfisca/calculette-impots-m-source-code https://framagit.org/openfisca/calculette-impots-m-source-co... The source code is actually available, written in a language called 'M'. It's been discussed a few times here on HN before: https://news.ycombinator.com/item?id=25208853 https://news.ycombinator.com/item?id=25208853 (just to link one example).
- tomohawk 5y ago> the code blocks IRS efforts to deploy a variety of digital services and to improve customer experience Sounds like a feature
- hanniabu 5y agoOnly if you're TurboTax
- exabrial 5y agoHow about we just replace the IRS instead? 5% flat VAT tax. No exceptions. No tax breaks. No more tax incentives. EDIT: Ope, my original point is a flat tax. I said VAT as I was trying to decide 'what' to tax in my head, and it seems thats what people are latching onto, instead of my three sentences following of "No exceptions".
- hindsightbias 5y agoTax law exists codify the exemptions for the rich. Gates, Bezos, billionaires/etc don’t pay taxes, you do. You can get rid of the IRS the day after you get rid of the rich.
- WalterBright 5y agoThe vast bulk of Federal income tax revenue still comes from the rich. Getting rid of them isn't going to help the rest.
- nathanvanfleet 5y agoMaking a really strong argument here.
- AnimalMuppet 5y agoIn general, I like the idea. Couple it with a UBI to protect the poor, and I like it a lot. (The poor pay very little income tax. They would have to pay the VAT. That would hurt them compared to the current system.) But that won't get you where you say you want to go. Who's going to collect that VAT, and make sure that everybody pays it? The IRS. Your approach would get rid of the tax code, but not the IRS. (In getting rid of the tax code, it would let you get rid of the computer code in question, though.) The other problem is, you can't implement a "soak the rich" approach with a VAT. And currently, there's a lot of angst around wealth inequality, and most plans to do something about it involve taxing the rich more than everyone else. So your idea is fighting an enormous political headwind. You could propose something like VAT + income tax for those who make over $1 million/year or something...
- anoncow419 5y agoSomeone should update this is from 2020?
- CharlesW 5y agoDone, thank you!
- jiveturkey42 5y ago"Coded in assembly language 59 years ago, the IMF seems small, at 200,000 lines of code. But the nature of assembler is that each line does a lot. Somehow replicating the logic in a more contemporary language has resisted efforts dating back a couple of decades." Considering that average IQ has been dropping for decades in developed countries, one has to begin wondering if we are even capable of building code or infrastructure as well as they did 50-70 years ago
- deleted 5y ago[deleted]
- asperous 5y agoIQ has actually been increasing https://ourworldindata.org/intelligence#by-country https://ourworldindata.org/intelligence#by-country
- zionic 5y agoThat’s only until 2013. As of 2020 the consensus is that the Flynn effect has reversed. We are in cognitive decline now.
- mrlonglong 5y agoI've a theory it's bad food and poor farming practices plus pollution that's causing the issues?
- zionic 5y agoThat's certainly one of the more charitable theories.
- dghlsakjg 5y agoTechnically the average IQ has always been exactly 100 if I’m not mistaken…
- wins32767 5y agoThe part that was shocking to me but shouldn't have been was the rationale for not using what sounds like a transpiler from Kennedy era Assembly to Java: > White added, “The Java that was created by the automatic tool [Wang’s process] looked a lot like the ALC. However, it’s not the kind of thing where we could hire a journeyman Java programmer off the street, and give it to him or her and and have that person be able to really understand what it was doing.” IRS, he said, in effect would have replaced code it can still deal with, with code no one could. That's good engineering management right there.
- simmonmt 5y agoI can't tell if you're being sarcastic or not. I figured transpiling would get you something that's at least black box testable using modern techniques. Then you start incrementally converting bits of it into idiomatic Java, adding more and more tests as you go. So it didn't seem like madness? But I've never done such a thing before, and am guessing there are a zillion problems with that approach. Not least that it would require an organizational commitment to stick with the conversion. Stop halfway through and sure you've got the opaque spaghetti they were worried about.
- wins32767 5y agoNot being sarcastic. They have working code and a staff of engineers that understand it currently. Transpiling it migrates the code to an intermediate state that no one understands, so why do that if you have to rewrite it again anyway?
- tablespoon 5y ago> Not being sarcastic. They have working code and a staff of engineers that understand it currently. Transpiling it migrates the code to an intermediate state that no one understands, so why do that if you have to rewrite it again anyway? If you have engineers that understand the old code, couldn't they just continue to maintain it in that form and transpile it until it's converted to idiomatic Java?
- le-mark 5y agoI actually picked up an old book on os/360 assembler at a library sale some years ago. Back in those days assembler was the what applications were coded in. Some of the airlines had their reservation systems in it until fairly recently. It’s not bad so far as assemblers go.
- jsymolon 5y agoIt's not assembler that'll get ya, it's the JCL. Past Technical Lead, "Don't bother w/ creating the JCL, copy it from <this job>"
- pinewurst 5y agoAirline reservation systems didn’t use JCL (something from OS, MVS, etc). They used a special transactional OS called ACP/TPF instead.
- euroderf 5y agoBad memories of JCL. An IBM mainframe at college, late 70s, and only a few guys that hung around the keypunch room knew the secret incantations. SYSIN DD *