24 comments

[ 3.6 ms ] story [ 70.5 ms ] thread
Other runtimes also have fancy GC, JIT and AOTs of their own.

That is the cool thing about having multiple implementations.

Only when targeting Android.

When is JetBrains coming out with KVM?

What do you mean with KVM? A Kotlin-specific VM? I don't see the need for that as Kotlin the language is rapidly evolving into a higher level language that runs on top of JVM, Android, web and native platforms (iOS, MacOS, windows, Linux)
Thus it isn't a Java replacement to start with, a minimum common standard library, without having a platform to call its own.

Guest language everywhere besides Android.

Yes, it is a cool thing when one is into compilers.
My friend, I specifically asked for good Java resources, but did not ask for other opinions. Those who suggested other languages were just cutting in to the conversation. I don’t care about their reasoning, I just wanted to learn Java.
Then you should have ended the comment at the question mark:

"Is there a good guide to learning modern Java?"

The end. YOU obfuscated your own comment with everything after it.

Oh, interesting. It's the & type in the CLI (I.12.1.1.2 in ECMA-335).

It makes Java's GCs quite Java-specific in practice because there aren't that languages that even moderately widely used which are both statically typed (to the degree that it's possible to tell pointers apart before generating code) and restrict pointers to point to the start of the object.

Ehh yes and no. Many languages indeed use conservative GCs, but that is because it is significantly easier to implement than precise GCs which require stack maps etc. I don't think it's exactly a question about languages and static types/generating code, it's more of an implementation detail. Conservative GCs can be fast, but they are inherently less space-efficient as you retain more objects than a precise GC would. Of course in some cases a conservative GC _is_ required, for example if your language has heavy interop with C/C++ land.

Also supporting interior pointers is not too cumbersome even with a "Java-style GC" (whatever that exactly means). It requires an additional bit per smallest aligned object size to denote if an object is allocated or not. If you need to check if a pointer is an interior pointer to an object, you walk back in the bitmap and find the last object with a bit set to 1 (i.e. find the allocated object which was right before the pointer you have), get the size of that object and check that the pointer you have is within the range of the start and end of the object.

EDIT: The big issue you would face with directly porting a Java GC into other languages is the weak reference processing semantics. Each language has their own subtle differences which would make it a pain.

> And then when a dependency of one of your dependencies is broken agains the latest version

How is this any worse than Java? My most vexing dependency-hell issues have involved breaking API changes to Hamcrest matchers and Apache Http Client; more recently Jackson-databind. All of those are Java libraries, brought in via transitive dependencies, usually from Java libraries.

I'm certainly not a member of the "trendy crowd." I say Java is ugly as a fan of Lisp and C. There's just so much boilerplate to implement something basic.
> like forgetting to clean up resources on the (invisible) exceptional execution path

Except this is still possible on the non-exceptional execution path. You simply just need to forget the defer call. The only thing that solves this is RAII and destructors.

Nah the language is dead to me. And for petty reasons I don’t like significant white space. I only use it now because of work.
It still supports the older brace-style as well, doesn’t it?
Right and I don’t want to have to deal with half the community being split. Or half my coworkers doing it one way. These are just things I don’t want to deal with. I said my reasons were petty! But they’re my reasons.
You give ownership as well, thus the actor owns the handle.
Except for VC sponsored startups trying the 2nd. coming of application servers.
The choice is to switch job.
The only things left from Objective-C that actually matter are AOT (always available in commercial JDKs) and value types (Vahlhala will hopefully be ready some day).
Go is great language, provided we went back in time and it was released in 1992.

As a rebranded Limbo with Oberon-2 method syntax in 2009, not so much.

Thankfully that there are people still writing Java to keep the JVM going for Scala users.
Those features are being released to please a larger set of people. People were relying on 3rd party libraries anyway for similar capabilities.