14 ms·
A Node.js bridge for COBOL
- shrugger 10y agoJust the Javascript module the world was waiting on! I'm sure this will have a meaningful impact! /s In seriousness: My dad was a COBOL programmer for about 30 years. It would frustrate him to no end to look upon Javascript programmers and to tell him, "these guys are going to be working on your code now." I'd never advocate COBOL or anything, but I'm just saying that it took a certain breed of person to do it, and that those people aren't around anymore is a sad thing.
- andremendes 10y ago> I'm just saying that it took a certain breed of person to do it What would be this "breed" of person you saying? Could you elaborate on this? I'm genuinely curious
- sien 10y agoI'm not the poster, but I have a story which might elucidate this. The application I was working on, which had a C++ front end for a mainframe with three databases involved caused an IMS segment to crash. The guy who saw the message got in touch with our senior user and discovered exactly who was doing something to cause the IMS segment to crash. This was at about 4:30 on a Friday in a corporate government type office where about 4 out of 5 people had already gone home. Within 30 minutes he had examined the crash dump, pulled out the COBOL program that had caused the issue and found the constant that had been set 20 years ago that had now been validated. He quickly go the user to alter the case so it didn't happen and he and I put in place new higher constants to protect the data from being damaged in future. It was damn impressive. But well, there are guys like Raymond Chen at MS who can do this for windows programs and in about 20 years, when node.js often means terrible hacked together code there will be JS gurus who can do the same. But if the mainframe systems are still in operation, we have to hope those COBOL guys are still around.
- roscoebeezie 10y agoAs a 23 year old mainframe programmer who writes COBOL, I couldn't agree with you more.
- shrugger 10y agoOut of curiosity, is it a very lucrative trade anymore? My dad has always wanted me to learn the trade, I've always assumed it's that paternal 'pass the baton to the seed' instinct, and I've never bothered because I've always been afraid that most shops wouldn't give any real consideration to a millenial who says he can program mainframes. Has this been similar to your experience? I'm just curious because it's not a very typical thing, square peg in a round hole sort of situation.
- zcdziura 10y agoNot the OP, but I'm of similar age and also a mainframe programmer by trade. It's a pretty lucrative field to be into, especially because the businesses which operate mainframes tend to be very large and (mostly) stable corporations. While not as hip and cool as a Valley startup, there is something to being well paid and receiving good health and retirement benefits! =) Those same corporations are also not blind to the fact that most of their COBOL workforce will be retiring, en mass, in the coming years, and are quite desperate to hire anyone willing to learn. My employer paid for me to attend a 3 month training program in order to learn how to use and develop on the IBM zSeries mainframe. It was a fantastic experience. As well, those same companies are looking to move as much of their COBOL code off of the mainframe and onto a distributed, server platform. While you can't beat the sheer power of Big Iron chugging along through a batch cycle, the CICS user interface leaves a lot to be desired. It's much more cost and time effective to build a web interface that talks to a Java middle-layer that lives on the mainframe (such that it can directly talk with DB2 or some such), compared to designing, building, and testing a CICS program to do the same thing, yet in a much more ugly fashion.
- shrugger 10y agoWhoa, that is super cool about how they trained you and everything. I have actually heard bits and pieces of sort of like folklore from my dad about CICS and other mainframe pop culture, it's always fascinated me in a certain sense. That there's another whole universe of programming that most people have never heard of or been involved with. I'm actually in the process of getting involved with the US Army now (I'm 21) so that I can get some schooling and stuff done later, but I've thought that I might spend my off-time for the next few years trying to self-teach myself NetREXX or something and try to land a job in some MegaCorp. I'm not opposed to writing code all day in a comfy office chair with full benefits etc, especially compared to living in a dorm with couple dudes eating Ramen and trying to conquer Web 4.0 or whatever. Just doesn't appeal to me. It's reassuring that it's a viable career path, I hadn't thought much about the new generation of mainframe maintenance, but from what my dad has told me about some of the people he's worked with it certainly makes sense that these big corps would be desperate for fresh meat right about now.
- riebschlager 10y agoThis kinda feels like seeing a guy in his 50s on a date with a pretty 22-year-old.
- mindcrime 10y agoWhat's wrong with that?
- int_handler 10y agoNothing wrong with that legally or ethically. It's just one of those things that is slightly stigmatized, similar to the way that COBOL itself is stigmatized or if you ask for ketchup on your hotdog while in Chicago.
- steveax 10y agoViolates the "half plus seven" rule [1] [1]: https://en.wikipedia.org/wiki/Age_disparity_in_sexual_relationships#The_.22half-your-age-plus-seven.22_rule https://en.wikipedia.org/wiki/Age_disparity_in_sexual_relati...
- mindcrime 10y agoThat's just some half-assed lame custom that has no particular justification behind it. The age of consent is usually no more than 18 pretty much everywhere (at least in the US, where most of the HN posters seem to be), so I don't see any problem with a 50 year old guy on a date with a 20-something. I figure anybody complaining is probably just jealous. But I'm close to 50 than 20 myself, so I'm not exactly unbiased. :-)
- user_0001 10y agojealousy? ;-)
- wrong_variable 10y agolol
- TimMeade 10y ago
- deleted 10y ago[deleted]
- skissane 10y agoI wonder, is this actually used anywhere? Or is it just for fun? I expect in some bank somewhere, node.js-COBOL integration really happens, but more commonly using web services (REST or SOAP). Take the legacy COBOL application, turn it into a web service, then clients like node.js can call it. Popular COBOL application frameworks – such as CICS and Tuxedo – include support for writing SOAP and REST web services in COBOL, which are generally used to add web service endpoints to existing COBOL applications.
- brianwawok 10y agoI know of places writing COBOL that gets turned to Java and deployed like that. Sigh legacy apps :)
- chx 10y agoPlease give us a list of workplaces not to apply to.
- azemetre 10y agoI'd totally write COBOL if it paid over $500K per year. Which it may very well soon when enough people retire.
- karmajunkie 10y agoI cut my teeth writing cobol back during the Y2K thing... I think I might have been the only college student they interviewed that had cobol on the resume. It was 20 years ago but I don't remember it being any more painful than some of the other crap I've had to deal with over the years. I'd definitely brush it off for $500k :)
- virmundi 10y agoWhile I didn't personally work on the Cobol side, I worked at a company on the consuming side. The whole thing was rather fun. The Cobol code would literally enter data into screens. Sometimes the screen data input was slowed to mirror that of a human. The result from each screen were known to fit in character matrixes. They would scrape the matrix into some data structure and move to the next screen by tabs and enter key presses. After the proper screens were polled, the data was rolled up and returned. The Cobol guys liked to mock the Java team. They said that Java was slow. They pointed to how our system interacted with theirs. So one day for UAT I got permission to make async calls to their services. BAM! Mainframe was hit hard. The Cobol guys were swearing. They couldn't understand what nearly took down their system. Turns out all it took was a thread pool of 100. We ended up using the async wrappers around time-sensitive sections with only 10 or so threads, if I recall properly.
- 0x0 10y agoI'm no cobol expert, but does this just shell out to 'node -e "' + code + '"' ? What if code contains a " ? https://github.com/IonicaBizau/node.cobol/blob/master/lib/node-exec.cbl https://github.com/IonicaBizau/node.cobol/blob/master/lib/no...
- squeaky-clean 10y agoI've never used cobol, but I'm pretty sure doing so would fail. "node-exec-path.cbl" is for this, you can give it a path to a script to run. The example uses it as CALL 'EXEC_NODEJS_FILE' USING "example/server.js". Alternatively, you can escape double quotations to \" and they'll work with node -e (I'm pretty sure it's not doing this automatically though). I think I found another bug too, my only experience with cobol is the 10 minutes spent trying to understand this, so maybe someone can explain? Since in EXEC_NODEJS, NODEJS_CODE is defined as "NODEJS_CODE PIC A(100)", doesn't that limit it to 100 alphabetic characters, so even the example of "console.log('Hello World!')" would not work because of the period, parentheses, and exclamation mark?
- ahlatimer 10y agoMy first job as a developer was writing COBOL (in 2007), and I only did it for a few months, so grain of salt here. I'm fairly certain PIC A(100) should be PIC X(100). A is "alphabetic." X is "alphanumeric" but supports ASCII characters that aren't a-z or 0-9. That said, COBOL is weakly typed, so you can probably store non-alphabetic characters in a variable typed as alphabetic (at least without the compiler correcting you), but it might fail if you try to do certain operations on them.
- rhizome 10y agoYeah buddy! I was a screen-colorer for a large COBOL app in the mid-late 90s.
- djsumdog 10y agoJust because you can doesn't mean you should
- hk__2 10y agoIs it really a "bridge" when all you do is shell-out to a Node interpreter? You can’t even call a function and get its return value.
- deleted 10y ago[deleted]
- asimuvPR 10y agoI can't say how useful this might be in the real world, but I appreciate the out of the box thinking. It could be more useful if you could call Python or Perl from the COBOL program, but what do I know. One thing for sure: I will find a way to use this somehow. :)
- TimMeade 10y agoWow... This sent a chill up my back. Why? Why? I've tried so hard to forget those days. No seriously. I'm sure there is a need for a cobol bridge, just surprised to see it pop up.
- hk__2 10y ago> I'm sure there is a need for a cobol bridge, just surprised to see it pop up. Note it’s a Node bridge, i.e. call Node from COBOL, not the other way around.
- wrong_variable 10y agoAlmost like COBOL is using a time machine to talk to the future. Reminds me of Interstellar.
- hajile 10y agoThe project description has a link to another project for running COBOL in node.
- rcarmo 10y agoUp next, on 11'o'clock news: "JavaScript developer breaks all mainframes on the planet by withholding LEFTPAD.CBL"
- maxaf 10y agoWell, now it has to happen just for comedic value.
- amga_ 10y agoWAT
- gjm11 10y agoAt last, a real rival to the wildly popular Cobol on Cogs project: http://www.coboloncogs.org/ http://www.coboloncogs.org/
- int_handler 10y agoIn case anyone else is wondering like I was about why all the COBOL code is indented several spaces over: http://stackoverflow.com/questions/8959489/why-does-cobol-have-to-be-indented http://stackoverflow.com/questions/8959489/why-does-cobol-ha...
- apaprocki 10y agoStill comes in handy... A bit of recent fun :) https://github.com/BloombergMedia/whatiscode/pull/20 https://github.com/BloombergMedia/whatiscode/pull/20
- exabrial 10y agoNeeds COBOLSCRIPT integration: http://ieeexplore.ieee.org/xpl/articleDetails.jsp?reload=true&arnumber=882363 http://ieeexplore.ieee.org/xpl/articleDetails.jsp?reload=tru...
- wrong_variable 10y agoquick someone write a left pad module for it !