News for hackers. Stuff that matters.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by pulse7 on Wednesday December 21, 2022 @03:55PM (#34086260)
After this merge we will have JVM implemented mostly in Java (aka "self hosted"). Currently about 1% of the JVM runtime is implemented in C and this will be replaced with instrumented Java code (including garbage collectors). This means that only one runtime will be maintained in the future and Java developers will do it (and not C/C++ developers which are harder to get). It will be much easier to implement and test new memory management mechanisms than it is today.

If they also decide to merge support for other languages (including WASM and LLVM) we will be able to run everything that compiles to WASM and to LLVM on the same runtime - in the same JVM. So we will get another "Docker Without Containers"...

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by kasperni on Wednesday December 21, 2022 @04:15PM (#34086490)
> Currently about 1% of the JVM runtime is implemented in C

The JIT is probably half of the VM and is written in C++.

Github [1] says (for the whole JDK, not just the VM): Java 75.1% C++ 13.4% C 7.4% Assembly 2.3% Objective-C 0.4%

[1] https://github.com/openjdk/jdk

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by mike_hearn on Wednesday December 21, 2022 @04:02PM (#34086356)
Where did you get the 1% figure from? HotSpot has millions of lines of C++, that seems far too low.

Graal doesn't affect memory management. It's a JIT compiler, not a GC. Although there's a relatively simple GC written in SystemJava for native images, G1, ZGC and Parallel will continue to be the standard GCs in the regular JVM for the foreseeable future and they are all written in C++.

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by taeric on Wednesday December 21, 2022 @04:09PM (#34086424)
To add to your question, assuming the tooling at github is ok, it has ~20% as c/c++ for https://github.com/openjdk/jdk. I would think most of that would be concentrated in the hotspot code, but I don't know. Would be delighted to know what the original post was referring to.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by fathyb on Wednesday December 21, 2022 @04:17PM (#34086522)
I think the entirety of Hotspot is written in C++ [0]? The standard library in the JDK is mostly written in Java, but the VM itself with the GC and JIT code is in C++, which makes sense.

If you do not count the standard library as part of the JVM (but part of the JDK), then the JVM is written mostly in C++.

[0]: https://github.com/openjdk/jdk/tree/master/src/hotspot

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by taeric on Wednesday December 21, 2022 @06:29PM (#34087777)
That definitely matches my read of the source. Would still be delighted to know there is something else going on, though. :D
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by samus on Wednesday December 21, 2022 @08:19PM (#34088544)
Because of its inherent memory safety, Java is attractive for anything in the JVM which is not strictly necessary to be coded in C/C++ for some reason (raw performance, low-level, or OS-specific). With Projects Valhalla ann Panama around the corner, there will be even less hard reasons going forward. Also, C/C++ compilers can be tricky dependencies at times.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by morelisp on Wednesday December 21, 2022 @04:36PM (#34086707)
It's surprising to me that effective knowledge of C and/or C++ is the stumbling block for contributing to the core of the JVM.

I work at a company with one large C++ codebase, and also many Go projects where C and C++ knowledge are helpful. We have trouble hiring good C++ developers, because our candidate pool starts as "people who want to write application servers".

But if you're already restricted to people who want to work on an extremely mature compiler, VM, and JIT - is lack of C knowledge really what's making it hard to hire people? These are people who are likely to end up reading kernel code and C-defined ABI documentation and etc. etc. even if the codebase is 100% Java...

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by lmm on Wednesday December 21, 2022 @05:22PM (#34087190)
The people who believe in and care about Java tend to be Java people; C-oriented people tend to be rather anti-Java.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by kaba0 on Wednesday December 21, 2022 @05:49PM (#34087414)
Writing state-of-the art runtimes is probably one of the hardest CS fields. They are way above this “your language sucks” category.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by lmm on Wednesday December 21, 2022 @05:53PM (#34087452)
People are human; we get petty and tribal at every level. And ever putting all that aside, if you genuinely believe that one kind of programming or another is the way forward then of course you're going to be more interested in working on technologies that support that.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by still_grokking on Wednesday December 21, 2022 @08:10PM (#34088484)
Even you're maybe right about "the C people" (most of I'm meet were indeed the kind of "there's nothing besides C") this doesn't seem to be relevant here. The JVM is written in C++, not C.

Also there is a large chunk of people (like me) who don't care about Java (the language) but very much about the JVM (and to some degree also about the Java ecosystem). I'm a Scala developer. But I'm also interested lately in Rust (and to some degree C++, as both languages are related), 'cause, you know, max performance and full control, and such.

So at least when it comes to interests there is some pool of people for sure who would like to look into the low-level JVM internals.

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by signaru on Thursday December 22, 2022 @04:03AM (#34091286)
The ideal hire would be "language implementation" people. There's a tendency for these to be C/C++ people because these offer conveniences in implementations. But they would also care about other languages and how they work.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by wiseowise on Wednesday December 21, 2022 @05:24PM (#34087205)
> We have trouble hiring good C++ developers, because our candidate pool starts as "people who want to write web applications".

You have trouble hiring good C++ developers, because you don’t pay enough.

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by moralestapia on Wednesday December 21, 2022 @05:39PM (#34087348)
Now that you touch on that and since I'm considering a role in C/C++ that came up to me.

How much is a good salary for that if you're remote (but US based) and have about 10 years of decent experience (plus a PhD in CS).

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by Koshkin on Wednesday December 21, 2022 @06:01PM (#34087542)
A good pay should cover your expenses, vacations and such, a bit of retirement savings, and leave you with some disposable money as well; otherwise, it depends on how much you want the job. (It's the same old supply vs. demand kind of thing.)
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by samus on Wednesday December 21, 2022 @08:21PM (#34088561)
That's a minimal pay in a field where the job market is kind of in favor of the employees.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by gameman144 on Thursday December 22, 2022 @12:56PM (#34096251)
In my mind, this feels more like "acceptable pay". Excluding absolute emergencies, I'd never take any job as a grown adult that didn't check all these boxes.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by morelisp on Wednesday December 21, 2022 @05:54PM (#34087466)
Also true, but not the only reason nor a particularly relevant response.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by samus on Wednesday December 21, 2022 @08:32PM (#34088630)
High salaries won't magically make experienced C/C++ programmers appear out of thin air.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by wiseowise on Thursday December 22, 2022 @03:03AM (#34090971)
Sure they will, you’ll have to constantly compete for them because supply is low, though.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by kaba0 on Wednesday December 21, 2022 @05:51PM (#34087432)
> It's surprising to me that effective knowledge of C and/or C++ is the stumbling block for contributing to the core of the JVM.

Parent is just talking out of his/her ass.

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by Alifatisk on Wednesday December 21, 2022 @03:57PM (#34086296)
Is C devs really hard to get?
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by Alupis on Wednesday December 21, 2022 @03:59PM (#34086316)
C devs? No. Competent systems-level C devs - yes.

The embedded and systems space are hard and require special talent and knowledge. You can't just take some front-end React developer and get them writing quality systems C code in a weekend... people spend entire careers in that space, and the number of people interested in that work shrinks by the year (look at all developer surveys).

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by delusional on Wednesday December 21, 2022 @04:38PM (#34086742)
But can you take some JavaEE backend developer, shove them into the compiler, and expect them to do well?

I think the language difference is a red herring.

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by yakak on Wednesday December 21, 2022 @04:47PM (#34086828)
It's certainly very interesting since Java was among the few high level languages that had unlimited access to C OS devs in theory, but it doesn't show this in practice.

I always felt they were hostile to understanding OSes and problems/solutions they provide and thereby limiting themselves to mostly junior C devs who didn't rock the boat by making real OS features for the JVM.

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by Yoric on Wednesday December 21, 2022 @05:03PM (#34086980)
Incidentally, that's one of the reasons for which Rust is so successful in this space. Rust won't magically make you productive in a week-end, but the Rust compiler (with its error messages) is pedagogic enough that it is going to help you learn from your mistakes.

That's the extreme opposite of raw C (or raw JavaScript, etc.) in which it's very easy to believe that you have solved an issue, only to realize much later that you've been entirely misunderstanding some constructions of the language and (if your code somehow managed to land) you have made the entire product unstable or insecure without realizing it.

Of course, there are tradeoffs to each approach. But I believe that investing in Rust was a great initiative from Mozilla.

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by PartiallyTyped on Wednesday December 21, 2022 @06:17PM (#34087668)
I have said this multiple times, but I am grateful for learning Rust as it helped shape the way I view memory ownership, and in the process made me a better developer.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by pyuser583 on Wednesday December 21, 2022 @05:08PM (#34087031)
How does embedded programming pay?
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by Koshkin on Wednesday December 21, 2022 @06:05PM (#34087570)
> C devs? No. Competent systems-level C devs - yes.

I don't think C is special in this regard.

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by samus on Wednesday December 21, 2022 @08:26PM (#34088596)
It actually is. Managed languages don't suffer from many kinds of bugs that C/C++ and other unsafe languages do. Memory corruption and concurrency bugs can be devilishly hard to find in the latter.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by danielscrubs on Wednesday December 21, 2022 @10:13PM (#34089297)
The percentage of developers that do C might be shrinking but the number of C developers surely has to be increasing. You can barely throw a rock in a major city without it landing on a developer nowadays.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by Alupis on Thursday December 22, 2022 @04:07PM (#34098689)
Just because someone took a class in school, or did some online tutorial doesn't make them a C developer.

Most developers you see/hear/interact with are not C developers - rather they use higher level languages mostly to build web apps and mobile apps.

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by jalcazar on Wednesday December 21, 2022 @04:02PM (#34086355)
not really hard just harder than Java
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by Alupis on Wednesday December 21, 2022 @07:20PM (#34088151)
Hard, just in a different way. I think most Systems developers would say building fancy wiz-bang web apps is hard.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by samus on Wednesday December 21, 2022 @08:28PM (#34088611)
I wouldn't call web programming is not hard, just very cumbersome at times.
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by vips7L on Wednesday December 21, 2022 @10:33PM (#34089453)
> Regarding JVM: I guess that the whole HotSpot VM will be replaced with GraalVM in the future and when this happens, majority of the JVM code will be in Java.

I believe this is still incorrect. GraalVM is HotSpot with the Graal JIT compiler and the truffle languages.

Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by pulse7 on Thursday December 22, 2022 @03:24AM (#34091075)
OK. Then I guess that the whole HotSpot VM will be replaced with GraalVM + Substrate VM in the future... :)
Re:OpenJDK Proposes Project Galahad to Merge GraalVM Native ... by vips7L on Thursday December 22, 2022 @02:02PM (#34097073)
No, it won't.