Live data from Hacker News

Project Jigsaw: Complete

mreinhold.org

11–20 of 86 posts

Re: Project Jigsaw: Complete

#11
post #3

I think it's going to take me a while to learn about the module system in Java 9, I'm probably going to bank on watching other projects do it first to see if any best practises emerge as developers get used to the new way of working. One thing I will say though is Java 9 has had a definite improvement on Java applications that run on my Raspberry Pi 3, I think because this got included http://openjdk.java.net/jeps/29…

You could probably cut that down even more by "building" your pen jvm with a restricted set of modules.

Re: Project Jigsaw: Complete

#12
post #3

I think it's going to take me a while to learn about the module system in Java 9, I'm probably going to bank on watching other projects do it first to see if any best practises emerge as developers get used to the new way of working. One thing I will say though is Java 9 has had a definite improvement on Java applications that run on my Raspberry Pi 3, I think because this got included http://openjdk.java.net/jeps/29…

> 15s

Still sounds ridiculous. Assuming this is how much time it takes to initialize the VM, I wonder if it would be possible to have a pool of VM processes that are already running and ready to accept an application code.

Re: Project Jigsaw: Complete

#13
post #4

I don't follow Java too closely and the world "module" is so hopelessly generic that I had a hard time understanding what the article was talking about. It links to this document [1] though, which is a long read, but does an excellent job of describing of describing all the ins and outs of the module system. (tl;dr Packages can now declare themselves as modules instead of simple namespaces, and they get to choose exa…

> I have a hard time being too impressed because more modern languages are doing this out of the gates and with far fewer hacks Well of course - it's easier to build something like this into a clean-slate language isn't it? It's harder to build it into an existing language and VM spec with an incomprehensibly large volume of existing code to be compatible with. It's backwards to say it's not impressive because someon…

I think the distinction is GP makes is being impressed by the concept of a module system itself, or by being able to bolt on such a system to an existing language.

A module system in and of itself is not impressive these days. Getting one into Java is.

Re: Project Jigsaw: Complete

#14
post #12
post #3

I think it's going to take me a while to learn about the module system in Java 9, I'm probably going to bank on watching other projects do it first to see if any best practises emerge as developers get used to the new way of working. One thing I will say though is Java 9 has had a definite improvement on Java applications that run on my Raspberry Pi 3, I think because this got included http://openjdk.java.net/jeps/29…

> 15s Still sounds ridiculous. Assuming this is how much time it takes to initialize the VM, I wonder if it would be possible to have a pool of VM processes that are already running and ready to accept an application code.

It's a spring boot application so comes with the baggage of initialising Spring + Spring MVC, that took a long time on JRE 8

Re: Project Jigsaw: Complete

#15

Jigsaw was what held up the Java 9 released, due to some members rejecting the proposal. It was changed and revoted upon, but it's hard to follow what was modified to make it acceptable. Is there anywhere the design goals and constraints for modules are? I'd really like to know how they ended up in their current form.

> Jigsaw was what held up the Java 9 released, due to some members rejecting the proposal. That was only a few weeks. If you check the official release schedule http://openjdk.java.net/projects/jdk9/ Jigsaw was supposed to be feature complete a year before that vote happened. Jigsaw was simply not close to ready when it was merged to master. And yes, Oracle still claims it hit every milestone on that schedule. > It w…

me guessing, i see at least two constraints that doesn't work well with a text file. The current format allows user defined annotations and the compiler find all packages of a module and automatically insert them into the module-info (you only define the exported package not all the packages).

Re: Project Jigsaw: Complete

#16
post #12

Earlier quoted context omitted.

> 15s Still sounds ridiculous. Assuming this is how much time it takes to initialize the VM, I wonder if it would be possible to have a pool of VM processes that are already running and ready to accept an application code.

It's a spring boot application so comes with the baggage of initialising Spring + Spring MVC, that took a long time on JRE 8

From my own experience, the class scanning for finding all annotations is usually the bottleneck.

I believe that the last version of Spring (5) has a way to do the scanning at compile time now.

Re: Project Jigsaw: Complete

#17
post #4

I don't follow Java too closely and the world "module" is so hopelessly generic that I had a hard time understanding what the article was talking about. It links to this document [1] though, which is a long read, but does an excellent job of describing of describing all the ins and outs of the module system. (tl;dr Packages can now declare themselves as modules instead of simple namespaces, and they get to choose exa…

> ...because more modern languages are doing this out of the gates and with far fewer hacks and more out-of-the-box tooling (e.g. Rust)

Haha...I love Rust, but you must not have been following the recent saga over modules in the community. Two things became abundantly clear:

1) There are definite issues with the current way that Rust does modules and they create problems for newcomers that don't know all the intricacies.

2) There's very little consensus in the community about the best way to fix those problems.

Initially, a couple of different, somewhat major proposals were made that would largely overhaul the system. Over the course of a few iterations, those were whittled down to a few, much smaller changes that mostly keep the current system but remove some of the stumbling blocks. It's a credit to the Rust team that they've handled it in such an open manner, but it's also creating a bit of a "design by committee" feel that's probably going to create something that everyone can live with and very few will think is close to perfect.

Re: Project Jigsaw: Complete

#18
post #3

I think it's going to take me a while to learn about the module system in Java 9, I'm probably going to bank on watching other projects do it first to see if any best practises emerge as developers get used to the new way of working. One thing I will say though is Java 9 has had a definite improvement on Java applications that run on my Raspberry Pi 3, I think because this got included http://openjdk.java.net/jeps/29…

The improvement is good, of course, but isn't the whole thing a bit of a straw man? The previous version taking 55 seconds on a Pi 3 seems utterly unacceptable to me, it's actually a pretty capable processor, and even a 15 second startup is pretty slow. Why put up with that when there are modern options (Go and Rust spring to mind) which would do so much better?

Re: Project Jigsaw: Complete

#19
post #12

Earlier quoted context omitted.

> 15s Still sounds ridiculous. Assuming this is how much time it takes to initialize the VM, I wonder if it would be possible to have a pool of VM processes that are already running and ready to accept an application code.

It's a spring boot application so comes with the baggage of initialising Spring + Spring MVC, that took a long time on JRE 8

I don't know if it's still a problem with Spring, but at a previous job about 8 years ago I was able to cut our application's start time from about 80 seconds to ~12 by writing a custom implementation of the logic that Spring used to find bridge methods to determine the proper annotations. We profiled the startup and found that over 80% of the time was being spent in reflection to resolve those bridge methods and that could be done significantly faster by using asm to load the classfile bytes and resolve the bridge method by looking directly at the invokevirtual call. Spring avoided this approach because it could fail in situations where the SecurityManager prevented filesystem access.

I don't know if that's still the case, but it always bugged me that Spring would slow down the >99% case by so much just to accommodate the <1% case.

Re: Project Jigsaw: Complete

#20

Earlier quoted context omitted.

> I have a hard time being too impressed because more modern languages are doing this out of the gates and with far fewer hacks Well of course - it's easier to build something like this into a clean-slate language isn't it? It's harder to build it into an existing language and VM spec with an incomprehensibly large volume of existing code to be compatible with. It's backwards to say it's not impressive because someon…

Can someone with an idea about this post other languages that actually attempt to modulerize it's own API? I'm not aware of any.

Elixir is an application that runs on the Erlang VM. Libraries can be brought in and started as their own applications, with their own lifecycles. I'm not privy enough in the specifics of the Rust way of things, but it sounds like this is sort of similar if you squint a little bit?

Observer screenshot from a blank IEx session: https://puu.sh/xI3re/3701a0c64e.png

Post reply on HN