Hi everyone, I made this a while ago just for fun. Perceptron was one of the first algorithms I wrote back in college when I was taking machine learning classes. So I thought how cool would be to write something fairly modern (not really) like a neural network using old tech like cobol. Hope you like it.
yeah, when I was writing the comment I remember my teacher telling us that neural networks were invented a long time ago and now (2017 when I took the class) they were coming back. that's why I wrote (not really)
ERR is the name of my variable "error" S indicates that this value is signed 99 is two digits V is a decimal separator and the other 9999 are 4 decimal places
And the 01 at the start of the line is the level number as explained in the link. It is how Cobol declared nested records, which Fortran and Algol lacked but became popular through PL/I, Pascal and C.
This is really cool! It's great to see a simple but nontrivial program to get a feel for how a language like this works. Reading through and knowing no COBOL, it looks like this is logistic regression on four input features.
Also, cobol will probably never completely die. No enterprise is going to pay to rewrite systems that have been their backbone for decades. (Disclosure: I work in Logistics industry, and we have a lot of cobol that isn't going anywhere.)
COBOL seems to be very translatable to any modern language, e.g. Pascal or BASIC. Real world reasons against "why not just translate it then" are understandable, but at some point that could become economical.
COBOL's numeric stack doesn't directly translate to many modern languages, which makes the translation introduce all sorts of fun edge cases that are extremely difficult to track down.
IEEE 754, which most of our modern languages are mostly compatible with, came about in '87. Long after COBOL had standardised itself on how numbers were expected to behave.
Beside AOT compilation to native code, Fujistsu and Micro Focus have Cobol compilers with .NET and Java backends, and I wouldn't be surprised if they eventually come up with WebAssembly support as well.
Also don't forget that languages like C and UNIX are just 10 years younger than COBOL.
yeah, I wrote a neural network a while back to run both in front and back end. to the front end I used JavaScript and for the back python. apart from matrix multiplications (python I used numpy, JavaScript I wrote my own class) the code is almost identical.
that got me wondering that I could write a program to translate a language to another. a large company could commission a (bunch of) programmer(s) to do this