News for hackers. Stuff that matters.
Re:Go is Google's language, not ours by pron on Wednesday May 22, 2019 @04:10PM (#19984951)
> because it made sense even back then.

That was necessary for performance back then. User-defined value types weren't, and Java has done well without them.

> Object has semantics, and that was a mistake, because it contributes to the bloat.

I think most of the RAM bloat is due to the GC trading off extra RAM for speed rather than object headers, and I'm not sure trading off complexity for headers was right 25 years ago (JS is doing fine on the client without value types). What changed was the performance characteristics.

As to object semantics, it may be a fixable mistake. The goal is to get value types without today's object semantics while preserving a single class hierarchy at the same time. The Valhalla team thinks that's achievable.

Re:Go is Google's language, not ours by emn13 on Friday May 24, 2019 @02:46AM (#19999075)
Heap (over)use by the GC is effectively a scaling factor. How large the underlying objects are remains remains relevant: if your objects are twice the size necessary, the GC will "bloat" that further - and this tradeoff isn't entirely GC specific, other allocators such as those used to implement malloc/free have related tradeoffs to make; free() won't release memory to the OS either (and memory, released or not, may end up evicted from RAM anyhow).
Re:Go is Google's language, not ours by pron on Friday May 24, 2019 @08:21AM (#20000709)
Of course it is relevant. I'm just saying it isn't the decisive factor that makes this an absolute necessity, as evidenced by the fact that much the backbone of the largest software services in the world is Java. There are lots and lots of tradeoffs in runtime design, and it's important to look at the whole rather than at one decision in isolation and point out that it's important. As a whole, the criticality of value types for Java is relatively recent.
Re:Go is Google's language, not ours by pjmlp on Thursday May 23, 2019 @12:42AM (#19988547)
I advise you to read Mesa/Cedar report on the impact of garbage collection algorithms available at Xerox PARC bitsavers archive, EthOS or SpinOS experience with Modula-3.

All of them refer that having value types alongside GC had a relevant impact improving performance.

All systems designed before Java was a thing.

Or since you refer to JS, the paper about SELF's design.

Even Dylan was designed with AOT/JIT and value types support, which is relevant here given that its domain was being a systems language for the Newton. That politics killed it is another matter.

Re:Go is Google's language, not ours by pron on Thursday May 23, 2019 @06:50AM (#19990463)
Oh, I don't deny that value types would have helped performance back in '95, just that they were absolutely essential for Java. Smalltalk/Self and Scheme/CL didn't have them, and those were probably Java's greatest influences; I don't think VB had them, either. Also, in its first four years, before HotSpot was ready, Java was interpreted, so it had bigger performance problems.

I don't know why there was no emphasis on AOT back then. I guess they started with interpreter/JIT, and then there just wasn't much demand for AOT until now.

Re:Go is Google's language, not ours by pjmlp on Thursday May 23, 2019 @07:25AM (#19990651)
Microsoft Basics have support for value types since MS-DOS.

QuickBasic supported value types and AOT to native code, and while Visual Basic used P-Code, version 6 introduced a proper AOT native compiler.

Modula-3 was also a big influence, at least accordingly to some papers.

There was surely demand for AOT, given that most commercial JVMs had it in some form or the other since 2000.

Even Sun actually supported it in Java Embedded variant for OEMs, probably grudgingly.

Common Lisp certainly has support for value types.

Re:Go is Google's language, not ours by pron on Thursday May 23, 2019 @08:56AM (#19991239)
What user-defined value types did CL have in '95? Also, are you sure about VB having had them then?

As for AOT, there may not have been sufficient demand from Sun/Oracle. I only joined relatively recently, but we generally do expensive things only if we believe they have a huge benefit or in huge demand, and we believe it can be long-lasting. The assumption is that any new feature will require maintenance for 20 years, taking away resources from other things. So if something is expensive, even if it's cool or some people could find it very useful -- we don't do it. The assumption is that the ecosystem is large enough that others can, and will.

Re:Go is Google's language, not ours by pjmlp on Thursday May 23, 2019 @09:19AM (#19991464)
Arrays, structs, fixnums, explicit stack allocation.

I can check the respective manuals if you wish.

Yep, I did VB programming for a short while.

And please note that even though my focus is now elsewhere, Java is one of my favourite eco-systems.

As a peasant I just wished that Java 1.0 was more like Go, given the existing alternatives back then.

So it kind of stayed as a pet peeve of mine.

Same applies to .NET, just in a different way.

Re:Go is Google's language, not ours by pron on Friday May 24, 2019 @08:27AM (#20000750)
Well, we can disagree about when AOT and value types became critical for Java (and I would argue that they clearly weren't back then because Java has done spectacularly without them), but Java is getting both soon.
Re:Go is Google's language, not ours by pjmlp on Friday May 24, 2019 @09:47AM (#20001384)
I would say that it had other factors that contributed to its sucess, so it succeeded in spite of lacking those features.

However due to the hardware architecture changes and new kids on the block, it is starting to be an issue.

I keep wishing to see them arrive, have watched all the JVM Language Summit, Devoxx and JavaONE talks about them.

Meanwhile I can already enjoy them elsewhere. :(

Re:Go is Google's language, not ours by pron on Friday May 24, 2019 @11:32AM (#20002597)
> Meanwhile I can already enjoy them elsewhere. :(

That's perfectly fine. We think that our priorities are right for the workloads Java is used for (e.g. people care more about a low-latency GC like ZGC, and deep low-overhead in-production profiling, like JFR, than about AOT).