- About Scala
- In the Enterprise
- Scala Community
- Language Research
- In the Press
- The Scala Team
- Scala's Prehistory
- Contact Us
- Learning Scala
- Tour of Scala
- Scala API
- Setup & Getting Started
- Programming Guides
- Other Guides
- Code Examples
- Scala Developers
Arithmetic Overflows - was Unsigned Arithmetic
Mon, 2011-11-07, 08:18
Just my opinion to overflows...
Am Samstag, 5. November 2011, 18:56:29 schrieb Peter C. Chapin:
> Overflow checking may result in a slower program but I tend to agree with
> you… I’d rather have it than not.
The silent overflowing inherited from Java (so no Scala invention here :-) is
one of the nastier things. I've been chasing quite some bugs routed in this
very unfortunate design decision.
I simply consider it a fundamental design flaw (in Java / the JVM -don't know
exactly where it stems from).
Well - apart from that the platform is still too tempting to leave it just
because of that... :-)
Anyway: if Scala should ever have the chance of setting this right without or
with JVM support or even just for .net I would higly recommend it. But I see
that the JVM may be a lost cause here, sadly enough.
Backward compatibility: Code that is relying on silent overflows is simply
using an antipattern (and even more often is using it not correct anyway). But
I agree that this could cause issues.
The intriguing question underneath is: what to do with cases where .net/CLR
will be acting fundamentally differently to the JVM? Discard the correct or
beneficial behaviour in favour of cross platform compatibility?
Looking forward to the "Joint Platform Future" - It will be quite an
Just my 5 cents.