New candidate JEP: 495: Simple Source Files and Instance Main Methods (Fourth Preview)

Remi Forax forax at univ-mlv.fr
Fri Oct 25 05:50:42 UTC 2024


> From: "Gavin Bierman" <gavin.bierman at oracle.com>
> To: "Eirik Bjørsnøs" <eirbjo at gmail.com>
> Cc: "amber-dev" <amber-dev at openjdk.org>
> Sent: Thursday, October 24, 2024 4:50:20 PM
> Subject: Re: New candidate JEP: 495: Simple Source Files and Instance Main
> Methods (Fourth Preview)
Hello Gavin, 

> Point taken but the title reflects the language feature(s) being added. At the
> moment, according to the JLS (7.3), a *compilation unit* is the top-level
> symbol for Java programs in the grammar. A compilation unit can be “ordinary”
> (containing a top level class or interface) or “modular” (containing a module
> declaration). What this JEP is proposing is a new sort of compilation unit. In
> the draft spec we call this a “simple" compilation unit, to contrast with
> “ordinary”. As no human says the phrase “compilation unit”, but rather everyone
> informally speaks of “source files”, we ended up calling these new sorts of
> source files “simple”.

> I guess one could say “smoother on-ramp”, or any of the alternatives, was
> similarly “...subjective, vague, generic and unquantifiable”. It’s hard but in
> the end we settled on using the two significant features (new sort of source
> file, new sort of main method) as the title. It’s a mouthful, but hopefully the
> community can help people interested in “the on-ramp stuff I heard about”
> navigate to the right JEP.

Reading the JLS changes, i also think that "simple" is not the best term, what about "primary compilation unit", the one you use before moving to an ordinary compilation unit ? 

> Hope this helps,

> Thanks,
> Gavin

regards, 
Rémi 

>> On 22 Oct 2024, at 21:04, Eirik Bjørsnøs <eirbjo at gmail.com> wrote:

>> Hi!

>> I love this feature! However, nothing is ever simple in programming. Especially
>> for beginners.

>> "Simple" is subjective, vague, generic and unquantifiable. "Simpler" would be
>> more honest, but perhaps it would be possible to come up with something that
>> actually describes this awesome feature?

>> The JEP summary and goals sections have some bits to start with: "smoother
>> on-ramp", "programming in the small", "beginner friendly". "reduced ceremony"
>> "small programs".

>> Cheers,
>> Eirik.

>> On Tue, Oct 22, 2024 at 5:38 PM Mark Reinhold < [
>> mailto:mark.reinhold at oracle.com | mark.reinhold at oracle.com ] > wrote:

>>> [ https://openjdk.org/jeps/495 | https://openjdk.org/jeps/495 ]

>>> Summary: Evolve the Java programming language so that beginners can
>>> write their first programs without needing to understand language
>>> features designed for large programs. Far from using a separate
>>> dialect of the language, beginners can write streamlined declarations
>>> for single-class programs and then seamlessly expand their programs
>>> to use more advanced features as their skills grow. Experienced
>>> developers can likewise enjoy writing small programs succinctly,
>>> without the need for constructs intended for programming in the large.
>>> This is a preview language feature.

>>> - Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20241025/0414af1d/attachment.htm>


More information about the amber-dev mailing list