Live data from Hacker News

Why Continuations Are Coming to Java

infoq.com

41–50 of 185 posts

Re: Why Continuations Are Coming to Java

#41

Earlier quoted context omitted.

Assembly and C have plenty of magic to go around, don't worry.

C yes, assembly--where? Its mapping to machine code is relatively straightforward, and as is the mapping from machine code to ELF. Or do you mean all the magic the CPU does to make it go fast?

Yes, along with complications that arise as you interact with your OS and other programs.

Re: Why Continuations Are Coming to Java

#42
post #8

I find it amusing that whenever people talk about Java, they're somehow using magic to describe it. It's like Java programmers see themselves as magicians... This is especially widespread with spring boot. I've even read sentences like "It's hard to say what it does, you can only see it's effects!"

It's magic because some frameworks that are used a lot offer quite a bit of functionality, terrible documentation and awful diagnostics, so when things go wrong your best recourse is randomly tweak snippets posted on stackoverflow by other hapless victims.

Re: Why Continuations Are Coming to Java

#43

Earlier quoted context omitted.

Assembly and C have plenty of magic to go around, don't worry.

C yes, assembly--where? Its mapping to machine code is relatively straightforward, and as is the mapping from machine code to ELF. Or do you mean all the magic the CPU does to make it go fast?

It's black magic that summons spectres.

Re: Why Continuations Are Coming to Java

#44
post #36

We had a weird network issue in a production system, and because the interplay of different components was very difficult to debug I briefly investigated each component. This lead me to run Jersey (a JAX-RS implementation, ie. a REST library) with a debugger. Jersey is written in a continuation passing style. That's the only time I've seen the style outside academic discussions of Scheme. I found the code flow diffic…

Having native access to continuation control lets you avoid writing in continuation passing style. It’s common to implement native continuation control with a compiler pass that automatically converts code into continuation passing style. (Similar to how you would transpile async/await in JavaScript.)

Re: Why Continuations Are Coming to Java

#45
post #25

Earlier quoted context omitted.

The JVM is not magic, neither are Java programmers magicians, but I think the reason magical terms are used to describe Java systems is that the ecosystem had lots and lots of time to develop libraries and abstractions (a few of which happen to be of the right kind, read: leak just the right amount). Your typical Java programmer is well aware what it takes to implement a battle-proof connection pool, and will not att…

The way I would phrase it is that the Java ecosystem is simultaneously both higher level and lower level (in terms of abstraction, not the machine) than many other platforms. The ability to swap out basically any component of a framework like Spring simply by including a different dependency or replacing a bean at runtime allows for fine grained tuning that isn't possible in many other frameworks. But this flexibilit…

> simultaneously both higher level and lower level (in terms of abstraction, not the machine) than many other platforms.

I think that's a good way to characterize it.

Re: Why Continuations Are Coming to Java

#47
post #27

> I serve as a technical lead for Project Loon. That is the project that's intended to add continuations and fibers to the JDK. > However, actually, Project Loom, the goal of the project is to add continuations, fibers, and tail call elimination. I'm guessing that the project is called either Loom or Loon (and i believe it's the former), but i like the idea that there are actually two cooperating projects, each of wh…

It is indeed Loom, you know, because a loom is used to weave threads into cloth. It's possibly also a loony project, but who am I to judge.
Post reply on HN