News for hackers. Stuff that matters.
Re:Records Come to Java by pron on Thursday January 16, 2020 @05:38PM (#22069790)
I meant that it's worked out pretty well for Java. ML -- one of my favorite languages, alongside Java and a couple of others -- has also managed to avoid being used by anyone, really. But look at Java now: it has generics and higher-order functions, and it's getting a uniform treatment of types (Project Valhalla), and pattern matching [1]. And so while ML introduced those features in a research context, Java is the language that has made and will make the world actually use them. Being ahead of your time is often just as much of a mistake as being behind (as far as product design goes).

As to the question of "holding programming back," it is yet to be seen how much of an impact these features have in practice. Same goes for what ML "lacked." I personally like some features more and some less, as do you, but I don't think anyone knows which programming language features really push programming forward.

[1]: https://cr.openjdk.java.net/~briangoetz/amber/pattern-match....

Re:Records Come to Java by AnimalMuppet on Thursday January 16, 2020 @07:03PM (#22070475)
"Holding programming back" means that it would have advanced in the absence of Java. What language would have advanced it? Cladote seems to assume that ML would have, which would have been actually used if Java hadn't taken over the world. That seems unsupported by evidence. Overly optimistic, as well.

And if Cladote's answer, ML, would not have taken over, then did Java hold back anything? No. Was it better than, say, C++? For many uses, yes.

"We would have ruled the world if it wasn't for you meddling kids!" is wishful thinking. If ML was so good, it should have won anyway. Instead, "has managed to avoid being used by anyone" is a pretty fair assessment.

Re:Records Come to Java by psychoslave on Friday January 17, 2020 @12:10AM (#22072064)
>If ML was so good, it should have won anyway.

Experience proves otherwise, to the best of my knoledge. For gaining wide propagation in a niche, whether of habitat or market, being the paragon of what can be conceived is rarely the way to optimize success. There are many other factors, and technical merit is lightly pondered.

That's true for life, where there are numerous examples where a function is filled by an organ that evolved in a counter manner of what an engineer sense of elegance/parsimony would provide.

That's also something that happens for technical products, where early proliferation in the market seems to offer a far more successful advantage than excellence of the product.

That said, I never had the opportunity to touch ML, and only already heard about it through my personal research on the roots of Coq that I studied during my CS courses in University. I didn't touched much of Java since I left University. Last year I worked on an SDK provided for several languages, including Java, so it gave me the opportunity to look at how it evolved, and play with its integration of functional paradigm. That still requires far too much boilerplate code to my gust, but is bit less frustrating in how you can structure your code.

Re:Records Come to Java by pron on Friday January 17, 2020 @06:40AM (#22073825)
> Experience proves otherwise, to the best of my knowledge.

It's very hard to say that it does in programming, at least. Even though we could easily come up with value metrics for programming languages, we don't really know what they are for any particular language. However, that, in itself tells us something. The software industry is an environment with strong selective pressures. That big difference in "quality" (i.e. some metric with a bottom-line impact) will go unnoticed is hard to believe. It doesn't make sense from a theoretical perspective -- adaptive traits should be detected in a selective environment, and it also doesn't fit with observed reality. We observe that technologies that truly provide an adaptive benefit are adopted at a pace commensurate with their relative adaptability; often practically overnight.

So we have reasons to believe that it is not true that "better" languages lose, at least not ones that have some measure of adoption at all.

Re:Records Come to Java by ernst_klim on Friday January 17, 2020 @08:16AM (#22074302)
> strong selective pressures

The opposite is true. Unlike in electronics, construction, shipbuilding, you can write a shitty software and patch the hell out of it after release most of the time with the few exceptions.

Hence the only thing that matters is how cheap and replaceable the developers are. Unlike pharma or architecture, where errors are always costly.

Java was successful because is was 1) pushed by big enterprise company, 2) familiar to people with C,C++,perl background and 3) overall easy to write at the expense of verbosity and bloated codebases (who cares if you could just hire too many of the cheap devs who would write as many classes as needed).

Re:Records Come to Java by pron on Friday January 17, 2020 @10:27AM (#22075382)
> The opposite is true. Unlike in electronics, construction, shipbuilding, you can write a shitty software and patch the hell out of it after release most of the time with the few exceptions.

What happens in software is what the market wants. You cannot claim that something is better if it is better at doing something that the industry doesn't want (and even that you can't show). It's like the Betamax vs. VHS: Betamax was better at some metric that few if anyone cared about, but VHS was better at what people actually cared about.

> Java was successful because

Java was (and is) successful because it was (and is) a very good product with good backing. At the time, other companies, like Microsoft, Borland, IBM and others that few now remember also heavily pushed other products, and they didn't do as well. I am not claiming that Java is the best possible programming environment, but it is pretty funny to claim that some specific platform/language is better with absolutely nothing to support that claim.

Re:Records Come to Java by ernst_klim on Friday January 17, 2020 @11:30AM (#22076071)
> What happens in software is what the market wants.

Sure thing, I'm just emphasizing that it's a more of a social-enterprise-management issue, than a software quality.

> Java was (and is) successful because it was (and is) a very good product with good backing.

Or just because it's Sun/Oracle/baked into android/symbian. Who knows? IMHO it's more of a "nobody was fired for using java" than "java is a good language". It's a language for managers, not for programmers.

> Microsoft, Borland, IBM

MS does pretty well with CLR, for another reason, though. There were no product at the moment which could compete with Java in terms of marketing, money, support etc.

Borland had nothing for serious enterprise, MS had C++ and VB only back then, regarding IBM I don't even know what you mean, Smalltalk?

Re:Records Come to Java by pron on Friday January 17, 2020 @12:15PM (#22076669)
> Or just because it's Sun/Oracle/baked into android/symbian.

Fact is, in the 25 years since its introduction virtually no one has built a platform with a similar combination of performance, productivity and observability. Java has very little competition in the "serious software" space, although platforms/languages like Node, Python and Go -- that suffer in some or all of the factors I mentioned -- get used in microservices, that are eating into "serious software".

> Borland had nothing for serious enterprise, MS had C++ and VB only back then, regarding IBM I don't even know what you mean, Smalltalk?

I meant Borland with Delphi (which was quite heavily used for a while, even after Java came out), MS with Visual C++, VB and Fox Pro, and IBM with Smalltalk.

Re:Records Come to Java by Cladode on Friday January 17, 2020 @02:15PM (#22078076)
I agree with what you write.

But I also believe the counterfactual that, had Sun/Oracle been based their language upon (core) ML rather than Java (with suitable pragmatic additions like code loading and been able to convince programmers to use it), then that language would be even more dominant and performant today. Many of Java's mistakes and detours would have been avoided from Day 1.

Can I prove this? No. But the fact that Java and essentially all other successful languages have gradually been adapting essentially all of ML (sans modules), is evidence. It means that language designers like G Bierman, A Hejlsberg, Odersky et al, too have gone Milner's way.

Re:Records Come to Java by pron on Friday January 17, 2020 @02:42PM (#22078390)
> then that language would be even more dominant and performant today

I think you should watch the first 20 minutes of this talk: https://youtu.be/Dq2WQuWVrgQ

Java's early designers realised (or believed) that the features with most bang-for-the buck weren't linguistic, but were: GC, dynamic linking, and performance with observability. Linguistic features, overall, were a detractor from those, because people were hesitant to use them, and so they missed out on the big benefits. Java decided to provide these most important features wrapped in a language that was non-threatening at the time; James Gosling called it "a wolf in sheep's clothing." In other words, a familiar language was a very central part of the strategy. You say you believe it would have worked with a non-familiar one, well, we can never know, but if it hadn't, then much none of the other, more important features would have mattered.

> But the fact that Java and essentially all other successful languages have gradually been adapting essentially all of ML (sans modules), is evidence

As I said in another comment, it's not that all successful languages are adopting ML's features but some, and those ones do it because they influence one another and they knowingly borrow from ML because they like it. In other words, the designers of some influential languages like ML. Is it a coincidence? I don't know, but I'm hesitant to say that it's evidence that ML was "right." I, too, personally like ML, but I wouldn't claim its design leads to better outcomes than others. Some successful language clearly do not adopt ML's features -- e.g. all the untyped ones and Go.

BTW, Java's objects are a different take on modules. If you've seen 1ML, that's almost an OO language.

Re:Records Come to Java by Cladode on Friday January 17, 2020 @03:35PM (#22078953)
I understand the network effect, I understand that most decisions on PL are not based on technical reasons. Most non-experts mostly worry about syntax, as per P Wadler:

   "The simplest thing to do is a significant 
   change to the semantics. People won't argue 
   the way they do about syntax."
ML had GC, it would have been easy to add dynamic linking, and X Leroy made Ocaml fast, with a tiny fraction of the resources that have been poured into the JVM. Admittedly, this was a major breakthrough that was unexpected. I reckon the main problem was getting OO to work properly with generics: type inference becomes a problem and you have to worry about co/contravariance.

A Hejlsberg certainly wasn't on the ML train in the past. For a start he didn't think generics are a good idea (he told me personaly). Typescript shows that he changed his mind! Go explicitly rejected generics at the start, but Go-2 is scheduled to get them.

Module systems are not such a big deal in my exerience, I don't think ML's was a full success.

Re:Records Come to Java by Cladode on Thursday January 16, 2020 @07:30PM (#22070630)
If we collapse the two concepts of

- best possible X

- most popular X

are we loosing possibly interesting perspectives on X?

Re:Records Come to Java by pron on Thursday January 16, 2020 @07:38PM (#22070688)
I don't think AnimalMuppet is confusing most popular with best. But as you don't have the data required to conclude which language is better by any meaningful metric, anyway, then your claim is just wishful thinking. If ML had won and Java lost, one could have just as easily said that ML was holding programming back from some imagined benefit Java would have brought. I think that it is you who are confusing "an interesting perspective" with a value judgment. Yes, ML had pattern matching before Java, while Java had pervasive dynamic linking and dynamic code loading. Those are simple facts and perhaps "an interesting perspective," but how do you decide which is better?
Re:Records Come to Java by Cladode on Thursday January 16, 2020 @07:55PM (#22070788)
Nobody has credible data enabling reproducible comparison of programming languages. The big lacuna of PL research ...

If popularity mattered ... PHP, JavaScript etc.

I find the evolution of all successful programming languages eventually to evolve into an ML-like core fascinating.

Re:Records Come to Java by pron on Thursday January 16, 2020 @08:26PM (#22070993)
> Nobody has credible data enabling reproducible comparison of programming languages.

Right, so as "better" and "best" are unknown, we should stop using those terms. I like Java and I like ML, but I don't know that one of them is better than the other, and if so which.

> I find the evolution of all successful programming languages eventually to evolve into an ML-like core fascinating.

Some of the successful typed languages, sure: Java, C++, C#, but the three heavily influence one another, and at least Java's and C#'s designers were aware of ML. So I don't think that, to the extent this is true, it's some "natural" draw, but rather a direct or indirect influence. On the other hand, you have Go, which is also quite successful (admittedly in a lower tier of success), and it doesn't seem to be converging on something ML-like, though (although it is influenced by another Milner idea), and neither is C.

Re:Records Come to Java by AnimalMuppet on Thursday January 16, 2020 @10:39PM (#22071649)
Absolutely. Popularity is absolutely fallible.

But I don't take claims of "X language was better and should have won" claims very seriously, partly because it's claimed by advocates of so many different languages. Should ML have won, or should Pascal/Modula2/Oberon? I've seen that claim, here, just from different people and for different reasons.

But I also don't take such claims very seriously because, while popularity can be wrong, so can unpopularity. That one guy spouting off about how everyone else is wrong and he's right? Sometimes he is right - but not often. More often, that person who thinks they have the right answer is seeing less than the full picture. I mean, how many people use Java? Several million? Would ML really have been a better answer for the majority of those several million people?

I react the same in government, by the way. When someone says, "I know what you should want, and I'm going to make it happen, even if it isn't what you actually want", well, I trust the people to know what fits them better than someone who isn't in their shoes.