News for hackers. Stuff that matters.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by ccleve on Wednesday October 26, 2022 @11:11AM (#33344927)
I don't say nice things about Oracle very often, but they deserve some praise here. Graal is a very, very ambitious project, and Oracle has been funding it for years. It's still rough around the edges, but it promises to enable new programming languages to run on a high-performance JVM, compiled to native code. Write-once, run anywhere, at native speed. And now they're donating it. It's very decent of them.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by bluejekyll on Wednesday October 26, 2022 @12:18PM (#33345913)
It may not only be benevolence though. The JVM and Graal are not the only game in town anymore. Webassembly is growing in various areas, clienside, edge, backend. WASM fills much of the same needs as Graal, and then some since it’s embedded in every major browser.

This move is good for Graal, as it will help it compete, but there’s still a big question in my mind at least about if Graal is going to be able to compete long-term. Yes, I know Graal can also execute WASM generated binaries, so it may have a space in this environment, but will it outperform native WASM VMs? And will WASM become the de facto binary format for shipping things where JVM bytecode has been used in the past? What’s Graal’s place in the future?

Re:Oracle Contributing GraalVM Community Edition Java Code t... by vips7L on Wednesday October 26, 2022 @12:37PM (#33346158)
Is there a current WASM implementation that can out perform HotSpot? Will WASM ever outperform it? I highly doubt it.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by frant-hartm on Wednesday October 26, 2022 @03:33PM (#33348254)
GraalVM? :-)
Re:Oracle Contributing GraalVM Community Edition Java Code t... by lostmsu on Wednesday October 26, 2022 @12:34PM (#33346121)
WASM is not really a replacement for Graal. Graal is more of a language implementation framework, while WASM is a compilation target.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by lostmsu on Wednesday October 26, 2022 @10:56PM (#33352529)
I think down in the comments people mentioned, that the language part of Graal is not actually included in the contribution.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by dopidopHN on Wednesday October 26, 2022 @12:32PM (#33346101)
Yeah. I see that as a way to position the JVM for cloud-function and other highly available and disposable compute.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by mike_hearn on Wednesday October 26, 2022 @12:51PM (#33346351)
WASM isn't really a replacement for JVM bytecode. It's not like you can take a random JAR and convert it to WASM. Last I checked, WASM doesn't even support GCd languages at all, and at any rate the whole insight that makes GraalVM unique and a big deal is that universal bytecodes are a poor choice for making fast polyglot VMs. The JVM world was doing that long before WASM was even a twinkle in Google's eye, with invokedynamic and other initiatives, and it kinda works. JRuby+indy is a lot faster than MRI. But, there's a lot of compromises involved.

Truffle is interesting because it says, no, we should not be trying to compile everything to a universal bytecode. Instead, we should JIT compile the source code directly, using the JVM as a runtime library but bypassing the bytecode layer. The language semantics can be expressed much more clearly, without needing to contort things to make them look like Java, whilst still benefiting from the JVM's core feature set.

So really I'd ask it the other way around. If it weren't for the politics of the browser world and the monolithic "Chrome is the OS" approach, would WASM be competitive? Because the Graal team already proved you can run lots of different languages at relatively insane speeds using partial evaluation and bypassing bytecode. The WASM world has proven it can run C++ and Rust at slower speeds than normal, which isn't particularly unexpected. If Chrome and Safari shipped GraalVM accessible via <script> tags, how many people would care about WASM? Remember that you can run WASM and LLVM bitcode on top of GraalVM too, it's not just about textual languages.

Arguably, if you wanted to give the web an instant free upgrade that'd make many developers rejoice, integrating Graal into Chrome would be an overnight way to do it. Python, Ruby, JVM bytecode etc at V8 like speeds, in a script tag? It's technically possible, it's just not politically possible.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by chrisseaton on Wednesday October 26, 2022 @01:41PM (#33346936)
Doesn't GraalVM have both a WASM frontend and backend?
Re:Oracle Contributing GraalVM Community Edition Java Code t... by grashalm on Wednesday October 26, 2022 @02:00PM (#33347196)
No, there is only a frontend. There is a JavaScript backend though. I hope the GC proposal for WASM ultimately goes through to enable a backend in WASM too.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by chrisseaton on Wednesday October 26, 2022 @02:03PM (#33347232)
Maybe I saw a demo round-tripping through LLVM then.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by frant-hartm on Wednesday October 26, 2022 @03:00PM (#33347867)
What does frontend and backend mean in this context? With graal you can

- run wasm interpreted on OpenJDK, similar to javascript running interpreted in nashorn, or now graalvm, you just need to add couple of graal sdk jars to your dependencies

- run wasm compiled, you need to run on GraalVM for this. This is supposed to provide around 50x speedup compared to previous point

Re:Oracle Contributing GraalVM Community Edition Java Code t... by chrisseaton on Wednesday October 26, 2022 @03:04PM (#33347922)
Frontend means can you take WASM code and feed it into Graal as input. Backend means can you get Graal to produce WASM code as output.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by thesuperbigfrog on Wednesday October 26, 2022 @01:31PM (#33346831)
>> It's not like you can take a random JAR and convert it to WASM.

Maybe you can:

"TeaVM is an ahead-of-time compiler for Java bytecode that emits JavaScript and WebAssembly that runs in a browser. Its close relative is the well-known GWT. The main difference is that TeaVM does not require source code, only compiled class files. Moreover, the source code is not required to be Java, so TeaVM successfully compiles Kotlin and Scala."

https://teavm.org/

I have never had an opportunity to try out TeaVM, but it seems promising.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by mike_hearn on Wednesday October 26, 2022 @01:47PM (#33347018)
I've used TeaVM in a past project, to compile some Java to JS. It's very cool tech. Unfortunately I heard that the team ripped out the TeaVM after I left. That's understandable - I had to fix some bugs and missing pieces in TeaVM as part of that project, and I think a lot of codebases would face the same issue, but compiler hacking isn't everyone's, um, cup of tea. It was a great way to get a lot done in the two weeks I had available though.

I should have clarified. Yes, you can probably do a native-image style "compile an app+embedded JVM to wasm" by pretending V8 is a CPU. There are programs that do that sort of thing, I think Leaning Technologies makes one. That wouldn't be of use in any existing Java project though. The only reason you'd ever want to do that is because browsers offer nothing else, even though they could and at that point why not compile to JS, at least that way your GC isn't being interpreted too. If you're not constrained by the WHATWG's decisions though it doesn't offer anything.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by thesuperbigfrog on Wednesday October 26, 2022 @02:23PM (#33347468)
>> There are programs that do that sort of thing, I think Leaning Technologies makes one.

It looks like you mean CheerpJ: https://leaningtech.com/cheerpj/ https://github.com/leaningtech/cheerpj-meta

>> That wouldn't be of use in any existing Java project though. The only reason you'd ever want to do that is because browsers offer nothing else, even though they could and at that point why not compile to JS, at least that way your GC isn't being interpreted too. If you're not constrained by the WHATWG's decisions though it doesn't offer anything.

It is very use case and "what is the future of your Java application" dependent. Some organizations are looking into migrating off of Java due to a variety of reasons. These kind of "Java conversion" tools help to keep legacy Java applications running until the legacy Java applications can be replaced.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by patrickthebold on Wednesday October 26, 2022 @03:05PM (#33347930)
python support seems fairly experimental right now:

https://www.graalvm.org/22.3/reference-manual/python/

or is that something different?

Re:Oracle Contributing GraalVM Community Edition Java Code t... by mike_hearn on Wednesday October 26, 2022 @03:36PM (#33348292)
It's "experimental" in the sense that it's incomplete, but the core tech is mature and works fine. Full support means supporting all the third party modules along with interpreter extensions, every part of the standard library etc.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by bluejekyll on Wednesday October 26, 2022 @03:25PM (#33348166)
> If Chrome and Safari shipped GraalVM accessible via <script> tags, how many people would care about WASM?

That’s a good question, and partly why I was pointing out that it’s not just benevolence for Oracle to OSS this. I don’t know if the browsers vendors could embed Graal, maybe they can, (license restrictions being some of the issues I’m sure) and then that could supplant the individual JS and WASM runtimes they support. But this wasn’t even an option until today.

> Remember that you can run WASM and LLVM bitcode on top of GraalVM too, it's not just about textual languages.

Which is exactly why I mentioned that in my original comment. Yes, Graal could be that runtime, will it? Seems like a gamble for anyone who’s not already in the JVM ecosystem to some degree.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by mike_hearn on Wednesday October 26, 2022 @03:30PM (#33348224)
Despite the wording of the announcement, Graal and Truffle have been open source under permissive licenses for a long time now. The "donation" is from one open source project run by Oracle to another. Confusing, indeed, but Oracle is a big company. So it's been possible license-wise for a long time.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by bluejekyll on Thursday October 27, 2022 @12:37AM (#33353169)
In the announcement it sounds like they are planning to change the license in some manner, “Will the GraalVM license change? The plan is to align all the GraalVM technologies with Java both from a release perspective and from a licensing perspective. Additional details will follow in the coming months as we move forward through this process.”
Re:Oracle Contributing GraalVM Community Edition Java Code t... by origin_path on Thursday October 27, 2022 @02:39AM (#33354005)
They're both open source licenses just slightly different ones (gpl2+CPE and upl I guess). Sub liked to use odd licenses.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by 0x457 on Wednesday October 26, 2022 @03:31PM (#33348234)
> WASM doesn't even support GCd languages at all

Well, some GC'd languages support compilation to WASM, for example, you can compile go to WASM. The issue here is that for GC'd languages you have to bring your own runtime with GC in every module, so this doesn't really work.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by jjtheblunt on Wednesday October 26, 2022 @04:45PM (#33349161)
What dependencies does WASM necessitate? A Javascript VM, for instance, or is that only for DOM connectivity reasons?
Re:Oracle Contributing GraalVM Community Edition Java Code t... by nvrspyx on Wednesday October 26, 2022 @12:28PM (#33346037)
I know absolutely nothing about Oracle, GraalVM, OpenJDK, or Java development in general. I haven't used Java since a CS intro class during my undergrad like 10 years ago. Despite this, I've internally adopted the general consensus that Oracle is a terrible, greedy company.

Can someone play devil's advocate to explain how this news may actually favor this negative view of Oracle? The sentiment in this thread is praising Oracle's decision here, so I'm just curious if there's an alternative viewpoint that's skeptical or wary of this decision and Oracle's motivation to make it.

With that said, I'm not looking for reason to diminish the positives. I'm just curious. Good moves that benefit the community should absolutely be acknowledged and encouraged.

EDIT: It looks like another person commented how this may not be benevolent in the context of WebAssembly while I was slowly typing this comment up on mobile. I'd still be interested in this discussion though.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by vbezhenar on Wednesday October 26, 2022 @12:41PM (#33346215)
I'm java developer for the last 15 years or something like that and I can't really say much bad about Oracle Java. IMO Oracle got a good team working on Java. Java is completely open source. There are many builds of Java from different companies, I like liberica one, for example (be aware of Russian roots, though).

I have no idea about this graal thing and I think it's rather niche application. I played with it but concluded that it's not ready for me yet.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by mike_hearn on Wednesday October 26, 2022 @12:42PM (#33346221)
There isn't any way to spin it negatively.

The generalized dislike of Oracle you have seen really comes from a couple of different aspects, neither of which are relevant to this specific announcement:

1. License audits suck.

2. The Google lawsuit (about matters resolved long ago and which don't apply to anyone except Google, really).

A lot of ill will comes from people whose companies have been audited. The process is by all accounts very painful. However, what's rarely mentioned in such discussions is the alternatives and why Oracle does this. It's because their software is totally DRM free. It makes sense; you can't have a major airport or bank shutting down suddenly because a license key or credit card expired, can you? Oracle DB is mission critical stuff, it must be always available. That's why they use an audit model - it's "trust but verify". They make their stuff available for free download and you promise not to pirate it.

Every so often Oracle turn up and check to see if you're paying for what you're using. At this point there are usually two problems that crop up:

1. The company doesn't actually know if it's correctly paying for Oracle's stuff. It requires a lot of work to find out, maybe the right controls weren't in place and naughty developers just installed more copies because it was convenient etc. Then they discover they've unknowingly been pirating the DB.

2. And/or they discover they didn't understand the licensing model, which historically had some very sharp edges around virtualization (maybe still does).

Because the downloads are open and unrestricted by any form of DRM, it's easy to make these mistakes in a company that doesn't have good processes in place. At this point the users have a problem because it's just plain old copyright violation. Oracle prefers not to sue its own users for obvious reasons so at this point a third issue crops up - their sales guys like to cut deals. Buy more of our software and you'll have some useful stuff plus we'll forget about your non-compliance issues. Win/win, right? Not always for the people who aren't at the top of the firm of course, who may now be told to adopt some new product that they wouldn't otherwise have chosen and may not even be told why (it's embarrassing for the executives to admit they ended up in that situation!).

It's worth observing that with the cloud these problems go away. Use Oracle DB only in the cloud (or MS SQL etc) and the cloud provider will track your usage and ensure you're paying for it. In turn that means no need for audits.

It's very easy to criticize Oracle for the above outcomes. It's harder to come up with alternative approaches beyond really down in the weeds stuff like the exact ways virtualized cores are licensed, etc. The moment you have a commercial product there needs to be some way to ensure users are paying for it (because a lot simply won't if there's nothing in place to make them), but if you accept that outages cannot be caused by DRM or licensing errors, then you are almost forced to go with either the cloud or the audit+true-up approach. Many modern DB firms go hosted-only which brings its own problems (see the recent Azure leak). Plus Oracle DB predates the cloud, so ...

Re:Oracle Contributing GraalVM Community Edition Java Code t... by nvrspyx on Wednesday October 26, 2022 @01:33PM (#33346853)
Thank you for the very detailed response. I recognize that my impression of Oracle was certainly unfair due to my lack of knowledge and experience with them. I also recognize that it was both selfish and ignorant of me to ask for someone to spin this negatively. My comment was in good faith, but I see now that my intention doesn't really change that it was encouraging an unjust characterization of this announcement and was unfairly asking someone else to do the leg work for me.

I guess my default (and flawed) heuristic is to assume that a big corporation has an ulterior motive with goodwill or community-focused announcements. I'll take this as a learning opportunity to not blindly adopt what I perceive as the general sentiment, to stop relying on such a heuristic, and to do my own research and evaluation. In addition to the detailed response, thank you for also indirectly kicking my butt into reevaluating how I approach the unknown both logically and emotionally.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by mike_hearn on Wednesday October 26, 2022 @01:45PM (#33346984)
You're welcome and I don't think you should feel bad, your post seemed OK to me.

This particular announcement isn't even meant to generate goodwill really, although I can see why it's interpreted that way. It's not like there's a new open source release coming. It's just resolving some duplication issues in the way these already open source projects are being developed by Oracle "donating" from one arm to the other :) The goodwill should instead come from the decade+ funding of this very advanced and large research project, which is teaching the world a lot about fundamental computer science (complete with large set of academic papers), and for which almost all the core cleverness is given away under liberal licenses.

Be aware that they do have a commercial offering built on top of Graal, the enterprise edition. It makes programs go faster, and has a few other useful features. But there's nothing nefarious about that of course.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by Volundr on Wednesday October 26, 2022 @01:16PM (#33346657)
I don't think licensing is the only reason people hate Oracle. They have at the very best a mixed record when it comes to open source they've acquired. While they've done pretty well by Java and virtualbox after some initial missteps, other software such as Open office, MySQL, Solaris, ZFS, KSplice, etc has not faired nearly so well...
Re:Oracle Contributing GraalVM Community Edition Java Code t... by dtech on Wednesday October 26, 2022 @02:51PM (#33347762)
I feel like this is a bit too generous to Oracle. The DRM-free thing is indeed a feature, but they know full well that it will encourage more and more unlicensed usage which they can then "extort" additional fees out of a company once it's in place and critical, which they would probably never have gotten if beforehand a trade-off check would've been done for operational expenses or the right gates would've been needed to have gotten over.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by mike_hearn on Wednesday October 26, 2022 @03:22PM (#33348132)
My point is this: what alternative would you prefer? Oracle can't implement trade-off checks or process gates inside other companies.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by bionsystem on Thursday October 27, 2022 @08:23AM (#33356472)
Alternative : open source it and charge for support.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by mike_hearn on Thursday October 27, 2022 @11:26AM (#33359001)
Red Hat is the poster child for that approach and they charge for support based on per-core usage with audits / legal teams to back it up, no different to Oracle.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by GoOnThenDoTell on Thursday October 27, 2022 @01:43AM (#33353612)
Who is downloading oracle and using it on a whim? Surely postgres or mysql would be the path
Re:Oracle Contributing GraalVM Community Edition Java Code t... by mike_hearn on Thursday October 27, 2022 @03:53AM (#33354520)
It's more like your company already uses it, so people just copy the binaries from one server to another and start it up. Oracle DB has massively more features than postgres or mysql so there are good reasons to use it.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by commandar on Thursday October 27, 2022 @02:13AM (#33353811)
I'm not worried about or bothered by audits. We put a lot of effort into license compliance and performing regular true ups with our vendors is the norm.

A large part of Oracle's bad reputation comes from a history of entering markets, gaining a captive customer base, and then engaging in blatant rent-seeking that squeezes every last penny that they can out of their customers.

As a direct example, I'm in the healthcare space and specifically work in a Cerner shop. Our quotes from Cerner for routine integration projects have gone up literally 5-10x since Oracle acquired them. An EHR migration costs well into eight figures, so Oracle is fully aware that customers aren't easily going to be able to move away from them because things that were $15-30K (and still are with other vendors) are now running into the six figures, but it certainly doesn't leave a positive taste in the mouth.

And we knew this was coming as soon as the Oracle acquisition was announced. Because Oracle has built a reputation for doing exactly this across multiple markets over multiple decades.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by hotpotamus on Wednesday October 26, 2022 @12:40PM (#33346198)
There's an epic rant on youtube from one of the old Sun guys that gets linked occasionally. I can't remember all of it, but basically it goes that Larry Ellison/Oracle is just as simple as a lawnmower - if you stick your hand in it; it'll shred it without emotion because it's just an unthinking machine that cuts whatever you put into in the same way that Oracle is a machine to make money.

I've been at this long enough to have had my own experiences and they are indeed as bad as everyone has warned me, but it does feel like something you have to experience yourself (or at least through a trusted party like in my case) to totally believe.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by edp on Wednesday October 26, 2022 @12:44PM (#33346251)
I think you're talking about Bryan Cantrill : https://www.youtube.com/watch?v=-zRN7XLCRhc&t=33m
Re:Oracle Contributing GraalVM Community Edition Java Code t... by ethbr0 on Wednesday October 26, 2022 @04:00PM (#33348597)
It seems irrational for anyone to feel unexpectedly angry at a lawnmower for shredding their hand though -- you should have known it was a lawnmower, that's not a recent change, and it never claimed to be anything but a lawnmower. You should just be the normal level of angry that lawnmowers are dangerous.

The parent apologist was extremely precise in how they described Oracle. Oracle isn't in the "Be warm and fuzzy to developers" business: they're in the "Provide mission critical software to large enterprises" business. Logic for servicing the latter well makes things look screwy or sinister to people used to the former.

Which isn't to say the Oracle salespeople aren't scummy. But most salespeople are scummy. That's what happens when you incentivize closing sales, which is how almost all sales orgs are set up. So audit model + scummy salespeople = bad experiences. But to parent's point: what's a better model for their customer persona?

Re:Oracle Contributing GraalVM Community Edition Java Code t... by hotpotamus on Wednesday October 26, 2022 @04:53PM (#33349286)
Well, I had a colleague who worked with them directly. He was a product manager who formerly managed incident response, and this was at a company that at one time had incidents that affected significant chunks of the Internet (no longer - that mantle has passed to AWS). It's been a couple years now, so the details are a bit fuzzy, but I remember him saying that dealing with Oracle was about the worst experience he had on the job. Their representatives were outright rude and condescending, and seemingly difficult to no purpose. So that's my (2nd hand) experience with them.

I'm a bit young to have ever known much about Sun, but I get the impression that they were very respected for their products and commitment to open source, and Oracle's purchase seems to have really rankled the community. Interestingly, the only Oracle products I use are all from the Sun era - MySQL, Java, Virtualbox, and ZFS.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by kaba0 on Wednesday October 26, 2022 @02:39PM (#33347628)
Is there any “good companies”? I’m fairly sure they all become paperclip optimizers after a certain size and any seemingly good behavior is simply the better option from a profit-maximizing point of view.

Do you honestly think that all those libraries care about Pride or Black Lives Matters? Nope, they just had some calculations and as user-facing companies, marketing has a huge role on their profits. A logistic company won’t have done any such thing as they are likely not even known by the general public.

Oracle is not really an end-user facing company like Facebook or Google is, so they simply don’t care all that much about that (hence the lawnmower analogy). But.. that’s a good thing as well — you can use the lawnmower for its job, you’ll never be surprised. Graal and OpenJDK and other tech at the bottom of the tech stack are long term investments. Looking at the linux kernel, it is not developed primarily by some hacker in a basement, but by employees paid by Intel, Red Hat, Google, pretty much everyone.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by l2dy on Wednesday October 26, 2022 @12:38PM (#33346168)
> Oracle does not currently intend to contribute the polyglot technologies supporting other languages such as Python, Ruby, R, and JavaScript.

Beware that this polyglot feature you've mentioned is not moving to OpenJDK.

Re:Oracle Contributing GraalVM Community Edition Java Code t... by norswap on Wednesday October 26, 2022 @12:41PM (#33346218)
It's fully open source still (as it has always been), it just won't be part of OpenJDK.
Re:Oracle Contributing GraalVM Community Edition Java Code t... by emptysongglass on Wednesday October 26, 2022 @02:59PM (#33347860)
Maybe a newb question but may I ask for an explanation why someone would want Python to run on the JVM and how they'd get started? Is it adaptable to a Poetry-led workflow?
Re:Oracle Contributing GraalVM Community Edition Java Code t... by chrisseaton on Wednesday October 26, 2022 @03:45PM (#33348400)
> why someone would want Python to run on the JVM

* to run faster

* to get a better JIT compiler, better GC, sandboxing, etc

* to run using code from other JVM languages in the same process

* to get the JVM's monitoring tools

* to embed into a Java application

Re:Oracle Contributing GraalVM Community Edition Java Code t... by jeroenhd on Wednesday October 26, 2022 @03:45PM (#33348408)