Paul Fisher wrote:

> 
> Why not just use require/ensure in the normal Kiev manner and use sed
> to augment the source if Classpath is being compiled with a normal
> java compiler?

But please, release version without the debug checks.
I don't think that this pre/post consdition checks are needed with
javac. We can just say that you need kiev to compile debug version by
yourself - after all, not everybody needs/wants to recompile core
library !!

Next thing is that classpath can distribute kiev as 'javac' of choice.
For bootstrapping unoptimized version of core lib would be enough, and
then user could build whatever he wants with kiev.

Think twice about using asserts inside the method code, especially in 
Debug.assert(cond, mess) 
form. This will cause major overhead in javac compiled version. Maybe
something like
/*ASSERT x>=0 :: message */
will be better (ignored by javac, would be compiled in by kiev if assert
flag is turned on, and is easy to read in code, in fact more readable
than Debug.assert(...) */

Next thing - maybe you can introduce require/insure/invariant inside
javadoc generated code. Do it either by adding @ tag and writing doclet
for it, or special parser that would hilite it in some way (second
option would also allow std javadoc to generate this checks in plain
text).

BTW, I suppose that we will never be able to get java compatible mark
from sun, if we would use enhanced compiler as std distribution one. It
might be better to provide it in separate pack. I think about something
similar to sun's runtime vs JDK, but our 'JDK' would just consist of
additional .jar file.
Of course both of them available in both debug and non-debug versions.

Artur


Reply via email to