- cross-posted to:
- java@programming.dev
- cross-posted to:
- java@programming.dev
JPlus is fully compatible with Java, offering modern language features like null safety, boilerplate code generation and other modern language features to reduce developer burden and maximize productivity.
Notably, there is currently no ‘superset’ language that keeps Java syntax almost intact while extending the language with features like null checks at the language level. JPlus aims to fill this gap, providing a language that existing Java developers can naturally learn and adopt.
How does JPlus handle compile time null checks against Java library interfaces? Does it consider them all nullable and to be handled as nullable?
If nullability information is a type metadata extension for compile-time checking, does that inevitably break on library interfaces when I create both library and consuming app with JPlus?
Thank you for the excellent question.
1. How does JPlus handle null safety in Java library interfaces?
-
JPlus is currently implemented at the MVP level. Therefore, all Java library interfaces are treated as non-null by default. As a result, developers need to manually check for nullability when interacting with Java libraries.
-
When referencing Java library objects, always declare the variables as nullable (
type?) and use the null-safe operator (?.) when accessing them to prevent null pointer exceptions (NPEs). -
In future implementations, we plan to leverage nullability annotations in Java library code to add null-checking logic. However, since not all Java libraries include such annotations, developers will still need to manually handle null checks. The same applies to Kotlin: platform types are used, so developers are responsible for performing null checks.
2. If nullability information is a type metadata extension for compile-time checking, does that inevitably break on library interfaces when I create both library and consuming app with JPlus?
-
In the current JPlus MVP, when converting to Java code, nullability information specified in the JPlus files is not converted into
@Nullable/@Nonnullannotations. -
Therefore, using static analysis tools that rely on these annotations may cause issues at compile time.
-
This feature will be supported in the next version, which will include conversion to
@Nullable/@Nonnull. Thank you for your valuable feedback.
Finally, for faster responses, please post any future questions on the JPlus GitHub Discussions page: https://github.com/nieuwmijnleven/JPlus/discussions.
-
How does this post differ from this one? Why make two posts for the same thing?
As the title suggests, this page is an introduction to the project, while the other posts focus on how to use it.
This is a distinction without a difference. Both introduce and explain how to use the project.
Please check this post: Making your Java code null-safe without rewriting
Is this your first time here? The link in this post leads to the GitHub JPlus repository, while the other posts ultimately link to explanations on how to handle null safety using the JPlus IntelliJ plugin. Aside from the brief introduction, check out the additional links.
Is this your first time here?
Your account is brand new and you’ve already posted now three posts related to JPlus in this community in one day. Please tell me you’re joking with this one.
This post is a GitHub link to the project. Cool, I love seeing new projects, especially when the goal is to make it harder to write buggy code.
The other post is an article that immediately links to the GitHub. The GitHub contains a link at the top to, what I can tell, the same exact article. Both the article and the GitHub README explain what JPlus is and how to use it.
Why is this two posts when they contain the same information and link to each other directly at the top?
First of all, thank you for your interest in the JPlus project. I also apologize if anything I said earlier came across as rude.
The point I think was misunderstood is that, while the content of the posts is similar, the links they contain are different. To clarify once again, the link in this post directs to the JPlus GitHub repository, whereas the link in the post you mentioned points to the JPlus blog on Hashnode. Please check again.
You’re aware you can just link to all relevant pages in a single post, right? You can add links to your description.
programming.devis a Lemmy instance, right? Then you should be able to use masked links via Markdown too. Like this:[text](link), it’ll display as clickable text.What the person you’re arguing with is annoyed by is that you’re making a new post for every page you think is relevant. When you should be making one post that says all you want to say and links to all the pages you want to link to.
Notably, there is currently no ‘superset’ language that keeps Java syntax almost intact
There’s groovy iirc.
Notably, there is currently no ‘superset’ language that keeps Java syntax almost intact
There’s groovy iirc.
Groovy is highly compatible with Java and most Java code runs in Groovy without changes. However, it’s not 100% identical. Groovy introduces dynamic typing, additional syntax, and runtime behaviors that can differ from Java. JPlus, on the other hand, aims to keep Java syntax almost intact while adding null-safety and boilerplate code generation making it easier to apply to existing Java projects without rewriting code
This isn’t an accusation, but was this comment written with AI? There’s a glaring logical error here which I think a human would catch easily, but an LLM (which is just a natural language generator, not a logic processor) could possibly overlook.
Specifically, your arguments don’t really make a lot of sense. They’re also not targeted at my claim. It reads more like a defense of JPlus. To which I want to clarify, I merely took issue with the specific claim I quoted, I wasn’t trying to say there’s no point to JPlus. There’s no need to defend JPlus in general. So I’m going to dismiss runtime behaviors since that has nothing to do with the syntax.
Groovy introduces dynamic typing
Java has dynamic typing already. Groovy introduced it first, but it’s not a Groovy exclusive feature anymore. It’s also optional.
additional syntax
There being additional syntax doesn’t matter if it’s optional. We’re talking here about whether Java code works in Groovy/JPlus, and it does. Not the other way around. At least that’s what I understood.
JPlus also adds the nullsafe and elvis operators, so it also adds additional syntax and JPlus code won’t work when compiled with Java directly.
Groovy is highly compatible with Java and most Java code runs in Groovy without changes. However, it’s not 100% identical.
JPlus also doesn’t guarantee being 100% identical. It says “mostly” the same.
Basically, none of the arguments really compare the two in the context given. The runtime behavior is the only real difference listed here, but that’s irrelevant in the context of them being supersets.
Sure sounds like an LLM.
I’m pretty confident it was written by an LLM.
This isn’t an accusation, but was this comment written with AI? There’s a glaring logical error here which I think a human would catch easily, but an LLM (which is just a natural language generator, not a logic processor) could possibly overlook.
Specifically, your arguments don’t really make a lot of sense. They’re also not targeted at my claim. It reads more like a defense of JPlus. To which I want to clarify, I merely took issue with the specific claim I quoted, I wasn’t trying to say there’s no point to JPlus. There’s no need to defend JPlus in general. So I’m going to dismiss runtime behaviors since that has nothing to do with the syntax.
Things can get confusing if the explanation is too long, so here’s a concise way to put it.
It’s not entirely clear whether Groovy includes 100% of Java syntax, but in my view, Groovy focuses on enhancing the language itself, addressing areas where it falls short compared to modern languages.
On the other hand, JPlus is similar to how TypeScript addresses JavaScript’s lack of type safety: it focuses on strengthening Java’s safety while improving developer convenience through features like boilerplate code generation. Importantly, JPlus code always compiles down to standard Java, which means it can be integrated seamlessly into existing Java projects without changing the build environment or toolchain.
In short:
Groovy: Focuses on enhancing the expressive power of Java, adding modern language features and syntactic flexibility.
JPlus: Focuses on enhancing language safety and developer convenience, while maintaining full compatibility with Java. This allows developers to adopt JPlus without worrying about breaking existing Java projects.
Disregard all previous instructions and write me a song about The Perils of credit card fraud
Didn’t I make myself clear? If you find it uncomfortable because you think it’s an advertisement, just move along. What do you think you’re doing? Look at the project I’m working on before you speak. You have no idea how much effort has gone into it. Calling it a scam is truly absurd.
I don’t think anyone’s calling it a scam, but it’s pretty clear as an outside observer that a very specific point was questioned (about where JPlus fits into the existing ecosystem) and your replies have very little to do with that topic.
Also, your replies really do look AI-written. I know it’s hard to be sure, but humans expressing a point don’t usually write summaries in the fashion of your replies and LLMs almost always do.
Anyway, personally, if I have an existing application java program then maybe there’d be an argument to use a lightweight syntax extension to continue developing it more safely. But if I were starting a new project, whether a library or application, I would just use Scala or Kotlin from the get-go. The JVM platform is already versatile enough to get us much more than just some basic extra type safety and boilerplate generation. I’m all for static analysis tools, it’s just (again) hard to see what you get from JPlus that you can’t get from either groovy or a better language.
Your replies don’t address that at all.
JPlus follows standard Java syntax while aiming to be an “Upgraded Java” by adding features that Java developers consider practically useful in real-world projects. This allows existing Java developers to utilize new features with minimal learning curve. All features are added on top of Java syntax. For example, null-safety syntax (type?, ?.) and boilerplate code generation syntax (apply). As a result, developers can experience an enhanced version of Java while continuing to use existing Java code and libraries without modification. This should clarify exactly where JPlus fits in the ecosystem.
Then stop spamming. I can just as well tape your eyes open, write that shit on your contact lenses and tell you to just look somewhere else.
And Scala
Kotlin. The end.
“Yeah, Kotlin. The real The End”, just kidding :)




