Live data from Hacker News

Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

javalin.io

81–90 of 139 posts

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#81
post #44

Given Project Loom hasn't been available, how does it utilise Virtual Threads already?

Project Loom is in preview, and far from available. As far as I can see, Javalin doesn't make use of virtual threads yet.

Virtual threads are already available in the current version of the JDK (19) as a Preview feature. Because it's not a preview language feature but a preview API, libraries can use it without compiling with --enable-preview, either with reflection or by having the application supply a virtual thread ThreadFactory, which means they can make use of virtual threads if the application turns preview features on.

Preview language features are different as they require compiling with --enable-preview, which creates a "poisoned" class file that cannot be loaded at all without preview enabled, so preview language features are not recommended for use by libraries, but preview APIs are fine (see JEP 12: Preview Features https://openjdk.org/jeps/12).

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#82
Very nice!

Just a minor nitpick (for those who care about the details of OpenJDK's development): virtual threads are not Project Loom, but rather one of the JEPs contributed to the JDK by Project Loom. There are two in JDK 19 (425 and 428), another in advanced stages (429), and there will probably be more. OpenJDK Projects aren't features but teams working on producing features focused on some area and then offering them to the JDK.

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#83
Well done! Can't wait to see Loom become the default for web frameworks.

Also spotted the Vue plugin - great to see this as so many light weight web apps with a few pages can benefit from using Vue but setting up all the build chain is such a drama that it's usually not worth it. Look forward to trying it out.

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#84
post #82

Very nice! Just a minor nitpick (for those who care about the details of OpenJDK's development): virtual threads are not Project Loom, but rather one of the JEPs contributed to the JDK by Project Loom. There are two in JDK 19 (425 and 428), another in advanced stages (429), and there will probably be more. OpenJDK Projects aren't features but teams working on producing features focused on some area and then offering…

> Just a minor nitpick (for those who care about the details of OpenJDK's development): virtual threads are not Project Loom, but rather one of the JEPs contributed to the JDK by Project Loom.

Thanks for clearing that up. Would adding a "from" be sufficient?

and it uses Virtual Threads (“Project Loom”) by default

and it uses Virtual Threads (from “Project Loom”) by default

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#85

I haven’t tried this framework, but just looking at some examples, the web sockets and sse seem a bit out of place. In a Loom world you’d expect these to use channels or queues or something similar in a loop - not callbacks. Callback hell is what virtual threads try to avoid. I’m not sure if loom has any primitives like go’s multi-channel select that might make this workable though. In either case Loom and frameworks…

We don't have selectable channels yet, but they're not needed as much in Java as they are in Go, because often multiple channels are used to signal cancellation, whereas in Java there's a standard mechanism for cancellation (Thread.interrupt() at the low level, with Future.cancel being higher level, and JEP 428's structured concurrency being higher level still https://openjdk.org/jeps/428).

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#86
post #83

Well done! Can't wait to see Loom become the default for web frameworks. Also spotted the Vue plugin - great to see this as so many light weight web apps with a few pages can benefit from using Vue but setting up all the build chain is such a drama that it's usually not worth it. Look forward to trying it out.

Thank you! The Vue support is the thing in Javalin I'm the most proud of. There are a hundred web frameworks for the JVM, but none of them have anything close to the Vue support Javalin has. Some people think it's trash, but for me it's perfect.

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#87
Some quick questions: - are you using an already-existing HTTP engine, like Jetty or Tomcat?

- how do virtual threads fit into a web framework?

- do virtual threads make debugging more difficult? (A more general JVM question, I suppose)

- any performance / readability benefit, or just a coolness factor?

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#88
post #84
post #82

Very nice! Just a minor nitpick (for those who care about the details of OpenJDK's development): virtual threads are not Project Loom, but rather one of the JEPs contributed to the JDK by Project Loom. There are two in JDK 19 (425 and 428), another in advanced stages (429), and there will probably be more. OpenJDK Projects aren't features but teams working on producing features focused on some area and then offering…

> Just a minor nitpick (for those who care about the details of OpenJDK's development): virtual threads are not Project Loom, but rather one of the JEPs contributed to the JDK by Project Loom. Thanks for clearing that up. Would adding a "from" be sufficient? and it uses Virtual Threads (“Project Loom”) by default and it uses Virtual Threads (from “Project Loom”) by default

Yeah, from Project Loom (no need for quotes) would be better, but even the current usage has become colloquial and is okay. :)

Re: Show HN: I finished v5 of a JVM framework I've spent spent half a decade making

#89

Earlier quoted context omitted.

It's been SOP for some time (at least 20 years) to use an RDBMS to store your site's content and write a stateless application server to pull data from it and compose a response. Call it the "CMS pattern". Static site generation, and a few other ideas, challenges this basic pattern, but most of the worlds applications use it. Javelin is trying to make the pattern better on several axes, simplicity first-and-foremost,…

I truly mean this with love, but this is the most Java comment I've seen in a long time :-D And (in the Java/enterprise world) is completely correct.

Funny, I had a LAMP stack in mind while writing it, and more specifically WordPress. For all the enterprise Java webapps out there, I bet there are 1000x more php sites. And they all use the same basic cms pattern.
Post reply on HN