COBOL bridge for Node.js
github.com
github.com
DISPLAY "Write something and then press the <Enter> key"
OPEN INPUT SYSIN
READ SYSIN
AT END SET EOF TO TRUE
END-READ
PERFORM UNTIL EOF
Perhaps a little verbosity is good to make programming accessible to a larger audience. I've been programming for over twenty years, but the seemingly redundant "AT", "TO" and "PERFORM" does help the flow in my head. Almost as if it brings into play more of my brain's language centres because now the code can actually be read out aloud. deliverWidget(
to: factory,
withCourier: ups
)https://blog.jetbrains.com/phpstorm/2017/03/new-in-phpstorm-...
Careful, though, or you end up with AppleScript.. :-)
But yes, fair point, and AI-powered IDEs could actually make it productive, too. One problem with such verbose code is it can be easy to forget the particular incantations needed because it gets mixed up too much with natural language, but autocomplete, Intellisense, Copilot, etc. could probably bridge the gap.
const str = multiline(()=>{/*
<!doctype html>
<html>
<body>
<h1> unicorns</h1>
</body>
</html>
*/});
https://www.npmjs.com/package/multilineSorry people got personal and berated, I really do mean it when I say you have a good nose for a missing factor
because he can.
There is a big niche of hooking all of that stuff up with modern frontends and running it remotely via browser interface and maybe a Node server on a mainframe and that sort of thing. That is how you end up with projects like this. The author jokes about it being ready for production, but I'm not joking I have really seen some stuff not dissimilar from this running in production, but with it calling the IBM Enterprise COBOL compiler instead. Doesn't look like it's supported here but it could be modified trivially to run on a real mainframe, just change the name of the executable it's calling and handle the case of a different path format when given a path outside of the Unix file system (there is a Node library already that can handle this, or you can compile C code since weird path support is provided by C libraries as well and can be made into a native node extension).
A more interesting discussion might be had about dynamic linkage and how that works in mainframe COBOL environments and how it's different from C environments. And in particular how that all fits together with transaction monitor systems, which are like very primitive containers. The closest comparison would be AWS Lambda functions and other serverless abstractions. A lot of COBOL actually looks like serverless, with lots of small very modular programs that link and load each other dynamically, which is part of why there was a tendency to reject some aspects of structured programming. I've seen apps that use too much serverless that feel a lot like classic COBOL spaghetti code.
Anyways, that's my big bunch of stuff I know about COBOL, which is quite a lot but unfortunately have never had much opportunity to write it.
At this to todays other post of inline c code in React and we have the beginnings of a reliable web.
Let's call it Web 6 (because UB on a c integer overflow that was counting versions).