7.0 wishlist?

A

Andreas Leitgeb

Harold Yarmouth said:
That, I've known since high school.

So, then why did you specially point out "two-way" equivalence?
I must have misunderstood it.
A claim of mine, which I partially revoked in a followup later.
I mistakenly thought the two classes mentioned there to be in
a subclass-relation, but they were siblings. The flaw,
however, still exists with respect to AbstractHashMap.
text/html only, please.

To me, google served this as html. I don't know google
well enough for any speculations about what could make
google serve it to you any differently than to me.
Obviously I'd allow adding * on returns and removing * on parameters but
not vice versa.

That's of course right, but has another set of implications:
To even make it possible for a null-forbidding Map-implementation,
Map itself would need to be declared as forbidding nulls, which
would be a very badly incompatible change.
Introducing a new NNMap instead and retrofitting other classes
to implement only NNMap surely also would break lots of old
code.
The null-check would be right after the bytecodes that did the
assignment in this case. Any code seeing the null in that brief
time a) got exceptionally unlucky

Which is too much risk. When we're talking about safety then
we must entirely and provably lock out Mr.Murphy and his Law :)
(Ok, up to the point where the processor hardware itself may fail)
and b) is ALSO part of the concurrency problems, since it clearly
got into a data race with an assignment in another thread.

This need not be an a-priori problem: the other thread might
get the old value or the new value, but it should never ever
get an inconsistent rule-breaking new value.
Those are options, though they might impact performance.

This was my rough pseudo-bytecode:
getField(src),dup,if_null_throw_NPE,putField(tgt)
Or the version with local variable:
getField(tgt),astore,aload,if_null_throw_NPE,aload,putField(tgt)
That would be the other one:
getField(src),putField(tgt),getField(tgt),if_null_throw_NPE

So, yes, given that getField/putField are considerably more
expensive than stack or localvar accesses, it will indeed
impact performance ;-)
Strictly enforcing that there *never* is a null in such a reference,

.... is the whole point of non-null marked variables and fields.
* Get rid of the nested-catch-clause issue noted above, which annoyed
me recently in some I/O code with stuff like
[example snipped]
In such a block of code, choosing unique names for the exception
arguments is (imho) the very least of all problems. Usually you
should also log each of the interims exceptions, anyway.

Maybe such nested hierarchies are not rare, but such nested
hierarchies where the thrown exceptions are not even looked
at *are* rare.
 
H

Hendrik Maryns

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Harold Yarmouth schreef:
No, just a constant pool, like we already have.

Do we? I am sorry, I do not understand what you mean with this constant
pool? Mind explaining?
I see no reason why [a,b] would not create a new pair in the
background each time.

No existing literal does so, other than primitive literals, and those
only because primitives are passed by value rather than by reference.

Well, yes, but that is an easy claim, since the only non-primitive
literals allowed at this point are Strings. And there are enough old
threads explaining the intern() system to newbies, or even among more
experienced people, so I am afraid introducing similar features for
other things than strings will make Java much more difficult to use.
But that isn’t a concern of you, if I interpret your vision correctly.

What I wanted to say is: to me it isn’t obvious that literals should
also be unique objects. In fact, I see no reason why they would have to
be. I think that it would make sense and would probably be desirable,
but that doesn’t make it necessary and assumed.

H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkkUNOUACgkQBGFP0CTku6PGCgCgqothPXvOAL78sZWclVdSHoZe
TrUAniWbRJb1/fbkYadXNLWg6Mfld9sI
=oIh8
-----END PGP SIGNATURE-----
 
H

Hendrik Maryns

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Harold Yarmouth schreef:
Where there is a punishment (for instance, execution, or imprisonment,
or public humiliation) there is some (perhaps unconscious)
blame-assignment going on.

The very fact of a punitive action, from a (virtual or real) slap in the
face on upwards, is a tacit accusation of fault.

How about this: *slap in the face*. Are you insulted also? Maybe this
wasn’t meant for you though. Who is ‘you’ anyway? Whatever, I should
stop responding to this kind of stuff.
And *my* point, backed up by actual evidence, was that actually looking
for one draws a blank, which seems to mean that it is *not* worth doing.

Perhaps you think it is nonetheless worth doing a fruitless Google
search because it "builds character" or is educational or something of
the sort?

Doing a fruitless search if of course never worth doing, but you can
only know that it is fruitless after you did the search. And you might
have luck and actually find a library, in which case it would have been
worth doing. But hey, this is your problem, really, if you don’t want
to profit from the work of others.

This is getting philosophical, so I will drop it here.
Time and effort expended on a wild goose chase (especially one known in
advance to be a wild goose chase, conducted anyway just to satisfy some
jerk on the Internet that insists it must be done) qualifies as "harm"
in my books. No offense.

Oh, now it is you who calls me a jerk. But guess what? I am not
insulted. It takes more to insult me and I don’t think you’ll ever manage!
Actually, I find your statement above literally unbelievable. I don't
know a single person that didn't insult anyone ever, not even in the
schoolyard when they had a single-digit age, not even when given serious
provocation later in life.

Hm, you might be right there. Well then, maybe starting from age 17 or so.
Say? No. Imply?

Neither. Which of course doesn’t prevent anyone from making
implicatures. It’s called pragmatics and a really tough topic in
linguistics.

Ooh, now I insulted you again, by implying you know nothing of linguistics!

H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkkUNrQACgkQBGFP0CTku6NBuwCghScEvO+eYzEXNY0W1Ev795FJ
qjgAoLlaNc6b8C4ltyYUFQW2nrArcMpM
=YgR9
-----END PGP SIGNATURE-----
 
L

Lew

Hendrik said:
What I wanted to say is: to me it isn’t obvious that literals should
also be unique objects. In fact, I see no reason why they would have to
be. I think that it would make sense and would probably be desirable,
but that doesn’t make it necessary and assumed.

I don't think it would buy much. Interned 'String's save space, costing only
an additional reference for each use. What's the savings of a literal
reference (the very term makes me shudder) compared to a literal?

'String's are internable because they're objects and have references in the
first place. It's easy to point multiple references to the same referent.
 
J

Joshua Cranmer

Harold said:
Hey! You just insulted me again!

No. I was just correcting your negative opinion of me.
(Though the epithets were less explicit than above, those are basically
accurate capsule summaries of the semantic content of the things you
wrote.)

IYO. Your opinions of the contents of the posts and my opinions seem to
diverge considerably.
[ Snip several paragraphs of information all resulting from an incorrect

No. Nothing about me is "incorrect" and you will desist from publicly
insulting me now.

The opinions I have formed in the past few days have now been confirmed.
You are clearly delusional in thinking that you can never be wrong.
That's cheating -- the expressions for a and b have side effects. My
proposal can be amended to specify that temporaries be made and side
effects occur in the "expected" order:

That's the point. Expressions have side effects. They must occur in a
precisely specified order; chiefly, that means you can't rearrange them
and expect them to work.
z = x + y; -> t = x; u = y; z = x.plus(y); or z = y.plus(x);

That doesn't cut it. Also note that there is precise semantics as to
when exceptions must be thrown and when stuff such as incrementing
happens compared to that.
So, some things should happen at the same time as some other things.
This is the substance of your argument that none of them should happen
at all?

And you promptly ignore the expansion where I explain why that's important.
[ More aggravating paragraphs based on a faulty assumption ]

The only faulty assumptions that have been made here have been made by
you. The only one being intentionally aggravating around here is you.

You said that I hate operator overloading. That is not true. Your
statement was an assumption. An assumption that is not true is a faulty
assumption.

To paraphrase xkcd: Logic. It works, bitch.
 
L

Lew

Joshua said:
No. I was just correcting your negative opinion of me.

None of the nasty things "Harold" says or implies about you are true, Joshua.

That does not imply the converse.
 
L

Lew

Harold Yarmouth schreef:
Hendrik said:
Oh, now it is you who calls me a jerk. But guess what? I am not
insulted. It takes more to insult me and I don’t think you’ll ever manage!

None of the nasty things "Harold" says or implies about you, Hendrik, are true.
 
H

Hendrik Maryns

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lew schreef:
Harold Yarmouth schreef:



None of the nasty things "Harold" says or implies about you, Hendrik,
are true.

Cheers Lew, I know. Let’s just hope he comes to reason, or learn to
live with it. I remember being annoyed by your postings for a while as
well, but I too much value your contributions, and by now I’ve learnt to
not bother with things as unimportant as personal annoyances.

H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkkUQLsACgkQBGFP0CTku6PkyQCfdJWZYvRzUMQnx55tvu+sdXR2
PhwAnAxKuM8azFhlOt6c3/4w/O6ujcLc
=5EDf
-----END PGP SIGNATURE-----
 
H

Hendrik Maryns

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lew schreef:
I don't think it would buy much. Interned 'String's save space, costing
only an additional reference for each use. What's the savings of a
literal reference (the very term makes me shudder) compared to a literal?

'String's are internable because they're objects and have references in
the first place. It's easy to point multiple references to the same
referent.

Yes, but we’re talking about (hypothetical) other objects that would be
internalised here, such as arrays. Of course I didn’t want to suggest
to have references to primitives, or are we talking past each other now?

H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkkUQSAACgkQBGFP0CTku6NtZgCeOwxW8z6J0t33znaZslm01lYQ
8MIAoK0Bx4Tcz/wnJ1s4W82uueZ7ZQDp
=QjhB
-----END PGP SIGNATURE-----
 
J

Joshua Cranmer

Joshua said:
To paraphrase xkcd: Logic. It works, bitch.
^^^^^^^^^^

Oops, that should be `misquote.' My apologies in advance to Randall Munroe.

[ For those who don't get the reference: <http://xkcd.com/54/>. ]

In random other news, what did people think of today's xkcd? Sounds like
the perfect fixture for my room...
 
J

Joshua Cranmer

Hendrik said:
Oh, now it is you who calls me a jerk. But guess what? I am not
insulted. It takes more to insult me and I don’t think you’ll ever manage!

This can't just be you and I who are the only ones with thick skins...
 
A

Andreas Leitgeb

Lew said:
What's the savings of a literal reference (the very term makes me shudder)
compared to a literal?

His point was not intern()ing a single reference, but adding compiletime
constant array literals directly to the constant pool.

e.g.:
int[] ia= {1,2,3,4,5,6,7,8,9};
would create some new ConstantPool item, that contains the information
of that array such, that it could be obtained as easily as obtaining
a String object works with the ldc bytecode.

I do not think it's worth the trouble, but I think any idea
should have a chance of being correctly essentially understood
before being (eventually) dismissed.

Unlike String literals, which are principially constant and
immutable, array-literals more often show up like this:
int[] ia= {x,42,x+42,x-42}; // partially dependent on runtime values
and most obviously, such an array cannot be stored in the CPool.
Furthermore, even if one such an array was frequently used in some
class, then creating it in the static initializer and storing it
in a static final field seems perfectly ok to me.

Another problem is, that arrays are not immutable.
To change that and introduce worm-arrays ("write once read many")
might be an idea on its own (would save lots of arr.clone()s, like
for enum's method values()), but that's a different story.
Even *with* such readonly-arrays, pooling them wouldn't pay.
 
J

John B. Matthews

Joshua Cranmer said:
Joshua said:
To paraphrase xkcd: Logic. It works, bitch.
^^^^^^^^^^

Oops, that should be `misquote.' My apologies in advance to Randall Munroe.

[ For those who don't get the reference: <http://xkcd.com/54/>. ]

It's not just a good idea; it's the law:

In random other news, what did people think of today's xkcd? Sounds like
the perfect fixture for my room...

_Your_ room? You'd better read the EULA before doing any affixing.

[I thank the gentleman for a humorous interlude.]
 
L

Lew

Hendrik said:
Cheers Lew, I know. Let’s just hope he comes to reason, or learn to
live with it. I remember being annoyed by your postings for a while as
well, but I too much value your contributions, and by now I’ve learnt to
not bother with things as unimportant as personal annoyances.

I apologize for having annoyed you.
 
T

The ScuzzBuster

I'm not sure if that's just because we've built up extremely thick
skins and many of the more embroiled folk on this forum (e.g., Twisted

*You* try putting up with your slings and arrows on a daily basis for
two or three full years and see how thin *your* skin gets! No armor
isn't eventually eroded by enough incoming fire, no matter how high
its quality.
 
T

The ScuzzBuster

I have no interest in this thread. Please leave me out of it.

How utterly inappropriate. As a human being with feelings that is not
a public figure, I am not an appropriate subject for parody. To
suggest otherwise is to imply a vicious insult.

None of the nasty things that Joshua has said or implied about me are
at all true.
 
T

The ScuzzBuster

Didn't I suggest something similar, once?
Please NO.  How about circle plus or some other additive symbol.

You can't even type "circle plus" on any normal keyboard, so that's
completely out of the question.

Dot-plus (as in, x.+(y) instead of x + y, so, simply allowing a method
to be named "+") would be an acceptable compromise.
You NEED to know if a plus is primitive or user defined.

How do you currently tell if an identifier is primitive or user
defined? a) you know the language, and its keywords. b) your IDE
highlights them differently.

So, an overloaded + could be discerned by a) having at least one non-
primitive operand, and neither operand a String, and b) your (future,
updated) IDE might highlight it differently.
 
T

The ScuzzBuster

I'd like to see the 'unsigned' property introduced for the primitive
numeric types.

Unsigned byte yes, maybe named "octet" instead of "unsigned byte". The
others no -- too many arithmetic headaches, not enough usefulness when
you have 64-bit signed integers that are good for representing
anything 32-bit or smaller unsigned integers could (so almost any
integer type in C, save "unsigned int" on some uncommon 64-bit-
hardware-specific implementations, and "unsigned long long" in GCC-
specific code).

The other deep but useful changes --
* Make arrays implement List, except for add(). Basically add
.size() (synonymous with .length) and .set() and .get() and
Bob's your uncle.
* Non-nullable references and const. (What's this, linked
elsewhere in this thread? A proposal to add a bunch of
annotations to use with external lint tools? No, no, no!
This should be part of the language and javac. Should have
been from the outset, really. Heck, "const" has been a
reserved word for donkey's years, but unused -- let's use
it! As a part-time C programmer I don't care for Object*
meaning something other than object-pointer, though, so the
non-null symbol should be something else. Hash, maybe, or
caret (^).)
* It would be nice if callbacks had a way to "smuggle" a
checked exception past whatever was calling it to whatever
declared the callback. A quick gloss over this thread shows
that someone else already mentioned something similar, but
it hasn't received much discussion -- as usual, operator
overloading stole the show. As it stands, you can emulate
this by explicitly wrapping the checked exception in a new
RuntimeException and then looking in the calling code for
this exception -- catch RTEs in an inner try, look for and
throw non-null getCause()s, rethrow the RTEs without cause
exceptions, and, with an outer try, catch the desired cause
exceptions. Ugly and verbose but works. A way to automate
this would be nice. I think you can sort of do it if you
are writing both the callback interface and the class that
invokes the callback, as you can use generic parameters as
throws, but this isn't much help if you want to have an
iterator over a structure that lives on disk, say, or a
Comparable that compares things over RMI.
* Actually, the whole notion of checked exceptions, runtime
exceptions, errors, and asserts may be deserving of some
rethinking.
- Checked exceptions: 99% of all checked exceptions are
IOException. Most of the rest are ParseException or
SAXException or something in a similar vein. Perhaps
the exception hierarchy should be Throwable, Error,
Exception, IOException with all unchecked save
IOException, and parsing or other malformed-input
exceptions derived from an InputFormatException that
is a direct IOException subclass.
Rationale: Checked exceptions are supposed to represent
error conditions that arise "in the wild", without
requiring a program bug to occur. Ergo, they represent
not errors in the program but errors in its input or
errors in its output. Ergo, they are all IOExceptions,
albeit sometimes in disguise.
- Runtime exceptions, errors, and asserts: these divide
up into four categories, but not exactly corresponding
to the above.
o Validation of preconditions, postconditions, and
invariants, for bug-detection, in custom code.
Typically IllegalArgumentException,
IllegalStateException, and friends get used in
precondition checking, and asserts and Errors in
the other cases. These are probably best off all
changed to asserts, but with precondition
asserts (those that appear before any other code in
a method body) perhaps being always-on and throwing
IAE (ISE if they don't reference any method
parameters) to emulate the older way. OTOH, I don't
see that precondition checks are any less or more
valuable to have enabled in production code. The
main objection to asserts is that no-one turns them
on. IDEs should turn on asserts for all code launched
from the IDE by default, and assert failures should
be trapped like breakpoints whenever a debugger is
attached.
o Safety-net validation of crucual system invariants,
preconditions, and postconditions. This is where we
get VMError, assorted other Errors, primitive-op
ArithmeticException (mainly div by zero), and non-
explicit throws of NullPointerException.
Non-nullable references would go a long way toward
helping with the latter, especially if the syntax
was not too verbose and stock javac and built-in IDE
compilers/linters caught errors in their use.
Better asserts would help too. Programmers should
be encouraged in the meantime to catch nulls when they
first go into anything they shouldn't go into, using
asserts or explicit throws (preferably of
IllegalArgumentException, since if null is an illegal
argument, it's an illegal argument error). And if
the distinction between RuntimeException and Error is
supposed to be that the latter indicates a VM failure
or other critical system problem rather than a coding
bug, then AssertionError should become
AssertionException, and that also brings us to:
o Out of memory/stack. OOME and StackOverflowError
are sort of in-between, hard to recover from but
usually indicative of a program bug, especially in
the latter case. OOME should be easier to cope with,
somehow. Don't ask me how. I think there was
discussion of that elsewhere in this thread.
o Non-local return. Perhaps it's time to make another
presently-unused reserved word useful: the dreaded
and much-maligned "goto". But with a limitation: it
can only target a label reached by a simple stack
unwind, i.e. stand in for a throw/catch of a new
RuntimeException/Error class. So you could have
int foo = bar;
quux = baz.twitchAndShout();
myLabel: fiddlesticks();
q = rx * 17;
and in something called by fiddlesticks,
if (x) goto myLabel;
with a runtime exception if there's no myLabel in
the call stack. Actual implementation being to
throw an "efficient" MyLabelRuntimeException
at the "goto" and catch it at myLabel. Here
"efficient" means "don't generate the stack
trace, unless running with a debugger attached,
and don't really have a whole new class loaded
for each label, instead parametrize the exception
and have the catch, match, and rethrow-on-no-match.".

OK -- now I've mentioned "goto" you need no further excuse to flame
the crap out of me. But you were probably going to do that anyway, so
I thought, what the hey.
 
T

The ScuzzBuster

Don't drag me into your fight with Harold. I couldn't care less, but
if I do take a side, it will not be yours. Not after what you've done,
in the past.
All the sorts of comments that cause Paul to

Nobody named "Paul" appears to be relevant to this thread.
And not true.  You were not insulting Paul, gratuitously or otherwise.

No, he wasn't, since no Paul seems to be participating in this thread.
The only one insulting Paul here seems to be you, but I can't fathom
why, since Paul hasn't done anything to provoke you or even to call
himself to your attention. All I can figure is, you're almost as
obsessed with this Paul guy as you are with me.
You didn't click "take a crap...".

What's this about, anyway, the toilet of the future or something? (I
have only skimmed this thread, and only even did that because google
showed people inexplicably talking about "Twisted" here.)

Regardless, unless it's a Swing JButton that's used to tell it to
flush itself, the toilet of the future is off-topic in this newsgroup.
As is Paul. As am I.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top