1

JPlus is a modern programming language and compiler that acts as a superset of Java — bringing the benefits of null safety and powerful boilderplate code generation declarative features while remaining fully interoperable with existing Java code and libraries.

3

Null-pointer exceptions are a common error in Java, causing inconvenience for many developers. Preventing null pointer exceptions in advance is important, but for developers who want to focus solely on logic, handling them can be tedious. Moreover, it’s not always easy to account for every scenario. Typically, static analysis tools are used to detect potential null pointer issues, but developers still have to find and fix the code themselves. JPlus reduces that burden. Let’s write null-safe Java code with JPlus.

5
submitted 1 month ago* (last edited 1 month ago) by justicecoder@programming.dev to c/programming@lemmy.ml

Hi everybody, this is the JPlus development team.

JPlus is a Java superset programming language, extending standard Java syntax with additional features. So far, we have introduced null-safety and boilerplate code generation features. Currently, we are planning to add Named Parameter support to JPlus. This feature allows specifying parameter names explicitly when calling methods or constructors.

The point we would like to discuss is whether to support Default Values.

Option A: Named Parameter only

  • Pros: Simpler syntax, minimal implementation and learning overhead

  • Cons: Call sites may become longer in some situations

Option B: Named Parameter + Default Value

  • Pros: More concise code, allows omitting some arguments when calling

  • Cons: Can make code slightly harder to read if too many defaults are used

We would like to gather opinions on whether default values are truly necessary in practical coding scenarios.

If you want to learn more about JPlus, please refer to the links below:

2

Null-pointer exceptions are a common error in Java, causing inconvenience for many developers. Preventing null pointer exceptions in advance is important, but for developers who want to focus solely on logic, handling them can be tedious. Moreover, it’s not always easy to account for every scenario. Typically, static analysis tools are used to detect potential null pointer issues, but developers still have to find and fix the code themselves. JPlus reduces that burden. Let’s write null-safe Java code with JPlus.

[-] justicecoder@programming.dev 2 points 1 month ago

The idea might be enough. Lots of companies running legacy code would be interested in this idea since it would make maintaining/patching it easy.

Thank you for your response. I will take your valuable feedback into careful consideration.

[-] justicecoder@programming.dev 3 points 1 month ago

Yoy won’t find your target audience here on lemmy.

Instead you should look for companies that have open job/freelancer positions for maintaining legacy java code and pitch your project to them.

That’s a great idea. Thank you. However, I’m not sure if such opportunities would be available at my current stage.

[-] justicecoder@programming.dev 1 points 1 month ago* (last edited 1 month ago)
[-] justicecoder@programming.dev 1 points 1 month ago

"Yeah, Kotlin. The real The End", just kidding :)

[-] justicecoder@programming.dev 1 points 1 month ago

AFAIK Kotlin and Java code can co-exist as source level. Never tried it though. I guess it depends on the end case scenario what to use.

JPlus retains almost all of Java’s syntax while providing conveniences like null checks, allowing Java developers to use it immediately without additional learning. In contrast, Kotlin can utilize Java classes but requires learning Kotlin syntax and its libraries, and it cannot use Java syntax directly or automatically guarantee null safety. Therefore, JPlus offers a distinct advantage over Kotlin.

[-] justicecoder@programming.dev 1 points 1 month ago

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.

[-] justicecoder@programming.dev 2 points 1 month ago

From Wikipedia:

In computer science, a preprocessor (or precompiler)[1] is a program that processes its input data to produce output that is used as input in another program. […], which is often used by some subsequent programs like compilers.

The emphasis is mine.

Both Typescript and SASS are examples of preprocessors.

By that logic, the C compiler would also be a preprocessor since it converts C code into assembly. Simply calling something a preprocessor just because its output is source code is not logically correct. The same applies to JPlus: the fact that it ultimately produces Java source code does not make it a preprocessor. Internally, it performs compiler-level processes such as AST generation, null-safety checks, and boilerplate code generation, so it should be regarded as a proper compiler.

[-] justicecoder@programming.dev 1 points 1 month ago

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.

[-] justicecoder@programming.dev 3 points 1 month ago* (last edited 1 month ago)

Kotlin isn’t a superset, you can’t just compile a java file with kotlin and have it work afaik. That seems to be the point here.

This is more like a preprocessor anyway, like SASS to CSS. The compiler spits out Java source code, not jvm bytecode.

Exactly, as you said, Kotlin isn’t a Java superset. you can’t just compile a Java file with Kotlin and have it work. JPlus works similarly in that it outputs standard Java source code rather than JVM bytecode.

However, JPlus is not merely a “preprocessor.” It actually parses Java source like a compiler, performs null-safety checks and boilerplate code generation on the generated parse tree, and finally produces standard Java code. In that sense, JPlus should be considered a compiler. The only difference is that its output is Java code; if the code generation step were extended to produce JVM bytecode directly, it could bypass the Java source entirely and generate bytecode straightaway.

The key point is that, just like TypeScript addresses JavaScript’s lack of type safety, JPlus fills in some of Java’s gaps. It allows you to keep almost all of your existing Java code while adding features like null-safety and automatic boilerplate generation, improving both safety and developer convenience.

[-] justicecoder@programming.dev 2 points 1 month ago

There’s Groovy. Their examples use a bit different syntax, like a lack of semicolons, and Gradle might also give the wrong idea. But it’s fully compatible with Java source code iirc, just adds its own stuff on top and broadens the allowed syntax a bit.

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

[-] justicecoder@programming.dev 6 points 1 month ago

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

[-] justicecoder@programming.dev 5 points 1 month ago

Isn’t kotlin a better option?

Kotlin is great for null-safety, but JPlus allows you to enforce null-safety without rewriting your existing Java code, which can be easier for teams working in legacy projects or who prefer staying in pure Java.

22
submitted 1 month ago* (last edited 1 month ago) by justicecoder@programming.dev to c/programming@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.

12

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.

26
submitted 1 month ago* (last edited 1 month ago) by justicecoder@programming.dev to c/programming@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.

view more: next ›

justicecoder

joined 1 month ago