Hacker News new | ask | show | jobs
by bishop_mandible 1915 days ago
> Records (...) are borrowed from Scala.

I think records already existed in FORTRAN and other languages like ALGOL-60. C has structs, too.

2 comments

Yes you are right, records have been around for a long time.

COBOL was a popular, very early language supporting hierarchical data of different types. This dates back to approximately 1960.

FORTRAN didn’t have records other than I/O “records” (at least for the first 20 years). ALGOL-60 didn’t have records. Algol-68 did have records, however Algol-68 wasn’t in very widespread use. I never had an opportunity to use it; compiler technology at that time wasn’t really ready for such a challenging language. Algol-68 may not have had widespread use, but a number of it’s features made their way into influential languages like C, Pascal, and Simula. These languages did have records.

As I recall, IBM’s PL/1 did have records, I seem to recall using them in the 70’s in a PL/1 program. PL/1 was kind of an amalgamation of FORTRAN and COBOL’s features.

In the end... Pascal was/is hugely influential, and, yeah, it called these kinds of things "Records." But the funny thing is it's been so long since I wrote Pascal or Modula-2 that when I first heard the term "Record" in the context of Java I never made the connection.
I think it's fair, though, to say that it's likely that the implementation and/or semantics may be more based on other JVM languages, who have to work on Java's terms.

In particular, I'm talking about the fact that Java doesn't really have "copy types" or "pass by copy" or whatever. So, sure, C has struct, Swift has struct, etc, but Java can't really model its version off of the way those work.