Re: Euphoria versus Java

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Tue, 8 Apr 2003 00:03:06 -0300, rforno at tutopia.com wrote:

>
>Pete:
>I didn't know that C checked for integer overflow in some way.
LOL. I was being sarcastic, it handles overflow by ignoring it.
<snip>
> reverts to a perfectly fixed value, that is,
>the maximum negative number (assuming you were adding 1 to it), and not =
to
>an indeterminate or rubbish value.
Predictable, yes, but useful, no (or only very rarely). Anything not
useful (as in 136+121=3D1) I class as rubbish.
>Micro$oft Visual J++ 6.0 takes *less* time, believe it or not, than the =
same
>one under Visual C++. This suggests Java performs at least fewer or the =
same
>tests than C++, or maybe it has better optimizations.
I don't know enough to speak authoritatively on the relative merits of
java bytecode vs x86 machine code but I would guess that the java
runtime can optimise an increment-by-one opcode for certain cases
whereas C++ is probably just outputting a standard x86 machine code
block suitable for all cases.
> Strangely enough, the
>timings were the same, no matter the resulting executable was .class or
>.exe. I have no explanation for this.
Either the .exe works like Eu bound programs, whereby internally its
not any different, just has a copy of the interpreter bundled with it,
or the JIT compiler is at play.

>PS: Do you know if you can do in Java the same that you do in C#, as you
>explained?
No I don't think you can. I can't find any information on which
languages allow overflow checking. Python, C#, Euphoria are the only
ones as far as I know.

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu