News for hackers. Stuff that matters.
Re:Caramel: an Erlang back end for OCaml by romanoderoma on Sunday September 27, 2020 @05:01PM (#24610102)
C is not legacy.

The same code from 20 or 30 years ago compiles today with little or no modifications

Try to run a servlet from 1998 or a struts web app from 2001 with a recent JVM

And yet you still find them in a lot of places, that you don't see, because you don't work with them, but that probably manage some of the transactions you make

They are legacy because they are being maintained for clientst hat have been using them for at least 2 decades and are virtually untouchable, but are still being updated, slowly, to keep them running

I'm not insisting, it's what it is.

VB is not legacy, VB is dead

No large company ever relied on VB to keep going

__ever__

COBOL is still being developed, because it's still used

To the point that COBOL can interface to Java or C# because companies prefer to update thei COBOL programs to call outside than rewrite them

The final approved ISO (of Object oriented COBOL) standard was approved and published in late 2002.

Re:Caramel: an Erlang back end for OCaml by pron on Sunday September 27, 2020 @05:31PM (#24610285)
It's easier to run (and even revive) a 25-year-old applet than a 25-year-old OS/2 C application. Java has a much better backward compatibility story than C because C relies so heavily on OSes, many of which are effectively defunct.

Still, there are probably billions of legacy lines of code in C, C++ and Java, and hundreds of millions of lines of code in those languages are still being written every year (in Java more than in C/C++). In fact, more new lines of code are professionally written in new Java codebases than any other language with the possible exceptions of JS and Python (although probably not).

Like COBOL, existing VB code is still maintained, but very little new code is written. I'm not saying VB is exactly like COBOL, but I don't see any resemblance between Java and COBOL any more than I would between C and COBOL or Python and COBOL.

Re:Caramel: an Erlang back end for OCaml by romanoderoma on Sunday September 27, 2020 @07:05PM (#24610943)
> It's easier to run (and even revive) a 25-year-old applet than a 25-year-old OS/2 C application

Are you sure?

Most of the APIs have been deprecated.

Builds for modern systems (64 bit) are non existent.

OS/2 has been dead for 20 years and there isn't much code being written for it anymore, I remember the Italian train company using OS/2 terminals, they have been dismissed more than a decade ago because IBM ended support for it.

Ironically you can run OS/2 in your browser, but not Java applets.

https://www.pcjs.org/software/pcx86/sys/os2/ibm/1.0/

Now, to explain you what I mean when I say old Java code is as legacy as COBOL I will start with a story: it took Github a year and a half to upgrade from Rails 3.2 to Rails 5.2, on a less than 10 years old code base, to some of the best Ruby/Rails experts in the World.

Imagine that there are services that government agencies use, written 20 years ago in Java, by average former COBOL programmers that wanted to try new things, that will not be rewritten soon, and if they will it will take years for them to be adopted, that are interfacing with even older code running on mainframes.

Management bought the story that Java programmers were easy to find (they still are), being a Virtual Machine it would run easily (write once, run everywhere) and that was Enterprise (it was in the name).

It wasn't completely true.

The path Oracle pushed Java to make it compelling for new generations of programmers left behind a lot of already written and deployed code that can't be run directly on modern systems, can't be touched 'cause companies rely on that code and even if it could be upgrade there are no Java programmers that wants/are able to do it (it doesn't boost your career to work on it) if the hardware won't fail in the meantime.

2000 Java code is harder to write/maintain/upgrade for a Java programmer of 2020 than 2000 COBOL was for a COBOL programmer of the 70s.

In 5-10 years, when the first generation of early Java adopters will retire, there will be billions of lines of Java code that nobody will know how to keep running.

To coin an old programming phrase "The determined Real Programmer can write COBOL programs in any language"

Re:Caramel: an Erlang back end for OCaml by pron on Sunday September 27, 2020 @07:28PM (#24611114)
> Are you sure?

Yes.

> Most of the APIs have been deprecated.

Most of Java 1.0 is not deprecated, and runs unchanged today. Also, deprecated doesn't mean removed. The browser plugin is no longer developed and is not supported by contemporary browsers, but it's easy to turn an applet into a desktop app that runs on the latest version of Java (the Applet classes are still shipped with JDK 15, you can still compile that code, and you can still run it if you wrap it with some desktop runner).

> OS/2 has been dead for 20 years and there isn't much code being written for it anymore

You're missing the point. A lot of C code out there targets platforms like that. It is much harder to maintain than Java code.

> Ironically you can run OS/2 in your browser, but not Java applets.

You can run Java them (and desktop apps) the same way: https://www.leaningtech.com/pages/cheerpj.html

> The path Oracle pushed Java to make it compelling for new generations of programmers left behind a lot of already written and deployed code that can't be run directly on modern systems, can't be touched 'cause companies rely on that code and even if it could be upgrade there are no Java programmers that wants/are able to do it (it doesn't boost your career to work on it) if the hardware won't fail in the meantime.

Except this is more true for C and C++ than for Java, and I still don't see the connection with COBOL. It's easier to run old Java code than old C/C++ code because the compatibility is so much better.

> 2000 Java code is harder to write/maintain/upgrade for a Java programmer of 2020 than 2000 COBOL was for a COBOL programmer of the 70s.

I don't know if that's true or not, but I do know that 2000 Java code is much easier to maintain than 20-year-old C/C++ code. Seems like you're not familiar with legacy C/C++: the situation there is much worse. I've seen systems running on ancient hardware because the C software was written for OS/2 or a particular version of the AIX compiler that comes with an AIX version that doesn't run on more modern hardware. I don't think there's any language with a better situation than Java when it comes to old codebases.

Re:Caramel: an Erlang back end for OCaml by romanoderoma on Monday September 28, 2020 @04:52AM (#24614481)
> A lot of C code out there targets platforms like that. It is much harder to maintain than Java code.

Like a lot of Java code targeting Android is harder to maintain than C++, after just 6 months or depending on the brand of phone it runs on...

> You can run Java them (and desktop apps) the same way: https://www.leaningtech.com/pages/cheerpj.html

Cool

Re:Caramel: an Erlang back end for OCaml by pron on Monday September 28, 2020 @07:42AM (#24615559)
> Like a lot of Java code targeting Android is harder to maintain than C++, after just 6 months or depending on the brand of phone it runs on...

Android isn't Java, and it's never been. It's an incompatible fork that has never conformed to the Java specification of parts of an old version of Java. Its compatibility story might be very different from Java. It is also much smaller in its reach than Java, and even of COBOL, and its domain is also much smaller than either.