Re: version=D_16

2017-07-13 Thread Mike via Digitalmars-d
On Monday, 10 July 2017 at 21:30:44 UTC, Walter Bright wrote: You can't use RTTI or Exceptions, for example. Those generate bloat even if they are not used - a compiler switch is typical to disable them. It's not true that C++ is "pay only for what you use". If the C++ usage is "C with

Re: version=D_16

2017-07-13 Thread Stefan Koch via Digitalmars-d
On Thursday, 13 July 2017 at 16:46:12 UTC, Luís Marques wrote: [ ... ] On D side the issue that remains is the ergonomics of having to type cast(short) more frequently. I suppose that if this proves too inconvenient we can just create a library type that avoids this issue, right? Yes. we

Re: version=D_16

2017-07-13 Thread Luís Marques via Digitalmars-d
On Monday, 10 July 2017 at 21:30:44 UTC, Walter Bright wrote: For example, ints in C are 16 bits. In D they are 32. This means that integer operations are expensive. I just realized something interesting. The same situation happens on AVR with C. AVR is 8 bit (but often competes with 16-bit

Re: version=D_16

2017-07-12 Thread Adrian Matoga via Digitalmars-d
On Monday, 10 July 2017 at 21:30:44 UTC, Walter Bright wrote: On 7/10/2017 1:52 PM, Luís Marques wrote: On Monday, 10 July 2017 at 20:19:46 UTC, Walter Bright wrote: On 7/10/2017 12:46 PM, Luís Marques wrote: I'm curious how that implementation addresses the issues I brought up: I'm not

Re: version=D_16

2017-07-12 Thread Dominikus Dittes Scherkl via Digitalmars-d
On Wednesday, 12 July 2017 at 09:38:13 UTC, Martin Tschierschke wrote: On Monday, 10 July 2017 at 23:01:50 UTC, Luís Marques wrote: On Monday, 10 July 2017 at 22:39:22 UTC, Petar Kirov [ZombineDev] wrote: The problem Walter pointed to is that due to integer Ah, that makes sense. Thanks for

Re: version=D_16

2017-07-12 Thread Martin Tschierschke via Digitalmars-d
On Monday, 10 July 2017 at 23:01:50 UTC, Luís Marques wrote: On Monday, 10 July 2017 at 22:39:22 UTC, Petar Kirov [ZombineDev] wrote: The problem Walter pointed to is that due to integer promotion, arithmetic operands of types smaller than int are converted to int, hence even if you use bytes

Re: version=D_16

2017-07-10 Thread Luís Marques via Digitalmars-d
On Monday, 10 July 2017 at 22:39:22 UTC, Petar Kirov [ZombineDev] wrote: The problem Walter pointed to is that due to integer promotion, arithmetic operands of types smaller than int are converted to int, hence even if you use bytes and shorts you would end up using ints, which are expensive

Re: version=D_16

2017-07-10 Thread via Digitalmars-d
On Monday, 10 July 2017 at 21:53:16 UTC, Luís Marques wrote: On Monday, 10 July 2017 at 21:30:44 UTC, Walter Bright wrote: You can't use RTTI or Exceptions, for example. Those generate bloat even if they are not used - a compiler switch is typical to disable them. It's not true that C++ is

Re: version=D_16

2017-07-10 Thread Luís Marques via Digitalmars-d
On Monday, 10 July 2017 at 21:30:44 UTC, Walter Bright wrote: You can't use RTTI or Exceptions, for example. Those generate bloat even if they are not used - a compiler switch is typical to disable them. It's not true that C++ is "pay only for what you use". If the C++ usage is "C with

Re: version=D_16

2017-07-10 Thread Walter Bright via Digitalmars-d
On 7/10/2017 1:52 PM, Luís Marques wrote: On Monday, 10 July 2017 at 20:19:46 UTC, Walter Bright wrote: On 7/10/2017 12:46 PM, Luís Marques wrote: I'm curious how that implementation addresses the issues I brought up: I'm not really sure how to respond, you mostly just made statements about

Re: version=D_16

2017-07-10 Thread Luís Marques via Digitalmars-d
On Monday, 10 July 2017 at 20:19:46 UTC, Walter Bright wrote: On 7/10/2017 12:46 PM, Luís Marques wrote: I'm curious how that implementation addresses the issues I brought up: I'm not really sure how to respond, you mostly just made statements about your worldview. For instance: "C++ on a

Re: version=D_16

2017-07-10 Thread Walter Bright via Digitalmars-d
On 7/10/2017 12:46 PM, Luís Marques wrote: since LDC essentially works for MSP430, even though it isn't officially supported. I'm curious how that implementation addresses the issues I brought up:

version=D_16

2017-07-10 Thread Luís Marques via Digitalmars-d
Hello, Johan Engelen suggested I bring further attention to this issue here in the D forums. We need a version identifier for 16-bit code (e.g. to conditionally define size_t correctly). This is not theoretical, it's an actual need, since LDC essentially works for MSP430, even though it