A strange div bug on Linux x86_64, (both dmd & ldc2): long -5000 / size_t 2 = 9223372036854773308

Walter Bright newshound2 at digitalmars.com
Fri Aug 14 21:29:42 UTC 2020

On 8/14/2020 6:32 AM, Adam D. Ruppe wrote:
> just I don't care, I want 16 bit operations here.

The design considerations are mutually incompatible:

1. performance
2. aesthetics
3. requiring casts breaks generic code
4. should be able to index the entire address space
5. I need wraparound arithmetic
6. I need saturation arithmetic
7. must throw exception on overflow/underflow
8. must not throw exception on overflow/underflow
9. should work like 3rd grade arithmetic
10. type inference
11. should work like C
12. should work like C#
13. should work like Java
14. should work like Python

Language design is an art where we do the best we can given what the language 
use is targeted at.

D is meant for high performance, systems programming, memory safety, and C 
compatibility. The compromises go in that direction.

More information about the Digitalmars-d mailing list