digitalmars.D.announce - wiki: D on AVR
- Ernesto Castellotti (6/6) Nov 27 2019 Hi,
- Adam D. Ruppe (4/6) Nov 27 2019 Nice! We should compile this option into upstream ldc so the
- H. S. Teoh (11/20) Nov 27 2019 According to Walter (cf. https://digitalmars.com/articles/hits.pdf,
- Ernesto Castellotti (14/36) Nov 27 2019 The support to targets that use 16 bits as a pointer size has
- Dukc (4/8) Nov 28 2019 Don't you run into trouble with the fact that the defualt integer
- Ernesto Castellotti (3/12) Nov 28 2019 In LDC, the integers size depends on the target architecture.
- H. S. Teoh (7/21) Nov 28 2019 Isn't this only for size_t? Because 'int' in D is always 32-bit
- Ernesto Castellotti (6/28) Nov 28 2019 Yes LDC sets size_t for the platform, not violating the spec.
- Ola Fosheim Grostad (4/9) Nov 28 2019 Doesn't D promote all arithmetic operations to 32bit even if the
- Ernesto Castellotti (3/12) Nov 28 2019 yes, but it's not a big problem, it's enough to cast
- Walter Bright (2/4) Nov 27 2019 Yay!
Hi, I wrote a page in the wiki for basic information on how to use D on AVR 8-bit, using LLVM and LDC. https://wiki.dlang.org/D_on_AVR With BetterC everything seems to be working fine, now it's time to create a framework for using D on microcontrollers!
Nov 27 2019
On Wednesday, 27 November 2019 at 14:35:53 UTC, Ernesto Castellotti wrote:I wrote a page in the wiki for basic information on how to use D on AVR 8-bit, using LLVM and LDC.Nice! We should compile this option into upstream ldc so the binaries just work too for maximum convenience.
Nov 27 2019
On Wed, Nov 27, 2019 at 02:35:53PM +0000, Ernesto Castellotti via Digitalmars-d-announce wrote:Hi, I wrote a page in the wiki for basic information on how to use D on AVR 8-bit, using LLVM and LDC. https://wiki.dlang.org/D_on_AVR With BetterC everything seems to be working fine, now it's time to create a framework for using D on microcontrollers!According to Walter (cf. https://digitalmars.com/articles/hits.pdf, slide 5), D was designed with the assumption of running on a 32-bit or higher CPU. How is this handled in the AVR case? Or is this strictly only for betterC? (Even with -betterC I'm having some trouble imagining how basic D features might work on an 8-bit controller.) Not questioning your work -- I think this is awesome -- but just curious about the practical implications of writing D for an 8-bit environment. T -- Help a man when he is in trouble and he will remember you when he is in trouble again.
Nov 27 2019
On Wednesday, 27 November 2019 at 18:25:47 UTC, H. S. Teoh wrote:On Wed, Nov 27, 2019 at 02:35:53PM +0000, Ernesto Castellotti via Digitalmars-d-announce wrote:The support to targets that use 16 bits as a pointer size has already been added to LDC (https://github.com/ldc-developers/ldc/pull/2194), so minimal AVR support is present (AVR uses 16 bit pointers). Obviously not all the language works with AVR, however with BetterC there are no problems. But the support to druntime and phobos is non-existent, honestly I don't think it's a big problem, I am of the opinion that it is better to have a separate library to develop on AVR. Most of the modules in phobos are useless for the classic AVR work, or they are inadequate because they use GC or depend on an operating system. In my opinion, nobody really wants to use them.Hi, I wrote a page in the wiki for basic information on how to use D on AVR 8-bit, using LLVM and LDC. https://wiki.dlang.org/D_on_AVR With BetterC everything seems to be working fine, now it's time to create a framework for using D on microcontrollers!According to Walter (cf. https://digitalmars.com/articles/hits.pdf, slide 5), D was designed with the assumption of running on a 32-bit or higher CPU. How is this handled in the AVR case? Or is this strictly only for betterC? (Even with -betterC I'm having some trouble imagining how basic D features might work on an 8-bit controller.) Not questioning your work -- I think this is awesome -- but just curious about the practical implications of writing D for an 8-bit environment. T
Nov 27 2019
On Wednesday, 27 November 2019 at 19:30:15 UTC, Ernesto Castellotti wrote:The support to targets that use 16 bits as a pointer size has already been added to LDC (https://github.com/ldc-developers/ldc/pull/2194), so minimal AVR support is present (AVR uses 16 bit pointers).Don't you run into trouble with the fact that the defualt integer size is 32 bits?
Nov 28 2019
On Thursday, 28 November 2019 at 08:31:36 UTC, Dukc wrote:On Wednesday, 27 November 2019 at 19:30:15 UTC, Ernesto Castellotti wrote:In LDC, the integers size depends on the target architecture. https://github.com/ldc-developers/ldc/blob/0a1a40ebc7ee29b02a6e92daa389e3c5611f086f/gen/tollvm.cpp#L259The support to targets that use 16 bits as a pointer size has already been added to LDC (https://github.com/ldc-developers/ldc/pull/2194), so minimal AVR support is present (AVR uses 16 bit pointers).Don't you run into trouble with the fact that the defualt integer size is 32 bits?
Nov 28 2019
On Thu, Nov 28, 2019 at 05:18:59PM +0000, Ernesto Castellotti via Digitalmars-d-announce wrote:On Thursday, 28 November 2019 at 08:31:36 UTC, Dukc wrote:Isn't this only for size_t? Because 'int' in D is always 32-bit according to the spec. I can't imagine LDC would deliberately violate the spec this way. T -- What do you mean the Internet isn't filled with subliminal messages? What about all those buttons marked "submit"??On Wednesday, 27 November 2019 at 19:30:15 UTC, Ernesto Castellotti wrote:In LDC, the integers size depends on the target architecture. https://github.com/ldc-developers/ldc/blob/0a1a40ebc7ee29b02a6e92daa389e3c5611f086f/gen/tollvm.cpp#L259The support to targets that use 16 bits as a pointer size has already been added to LDC (https://github.com/ldc-developers/ldc/pull/2194), so minimal AVR support is present (AVR uses 16 bit pointers).Don't you run into trouble with the fact that the defualt integer size is 32 bits?
Nov 28 2019
On Thursday, 28 November 2019 at 17:37:31 UTC, H. S. Teoh wrote:On Thu, Nov 28, 2019 at 05:18:59PM +0000, Ernesto Castellotti via Digitalmars-d-announce wrote:Yes LDC sets size_t for the platform, not violating the spec. int in D is 32-bit as you said, that if you compare it with the size of the types of AVR-GCC it would be long, This is not a problem, just use the type aliases like those in core.stdc.stdint to work aroundOn Thursday, 28 November 2019 at 08:31:36 UTC, Dukc wrote:Isn't this only for size_t? Because 'int' in D is always 32-bit according to the spec. I can't imagine LDC would deliberately violate the spec this way. TOn Wednesday, 27 November 2019 at 19:30:15 UTC, Ernesto Castellotti wrote:In LDC, the integers size depends on the target architecture. https://github.com/ldc-developers/ldc/blob/0a1a40ebc7ee29b02a6e92daa389e3c5611f086f/gen/tollvm.cpp#L259The support to targets that use 16 bits as a pointer size has already been added to LDC (https://github.com/ldc-developers/ldc/pull/2194), so minimal AVR support is present (AVR uses 16 bit pointers).Don't you run into trouble with the fact that the defualt integer size is 32 bits?
Nov 28 2019
On Thursday, 28 November 2019 at 18:40:17 UTC, Ernesto Castellotti wrote:Yes LDC sets size_t for the platform, not violating the spec. int in D is 32-bit as you said, that if you compare it with the size of the types of AVR-GCC it would be long, This is not a problem, just use the type aliases like those in core.stdc.stdint to work aroundDoesn't D promote all arithmetic operations to 32bit even if the operands are 16 bit?
Nov 28 2019
On Thursday, 28 November 2019 at 21:48:52 UTC, Ola Fosheim Grostad wrote:On Thursday, 28 November 2019 at 18:40:17 UTC, Ernesto Castellotti wrote:yes, but it's not a big problem, it's enough to castYes LDC sets size_t for the platform, not violating the spec. int in D is 32-bit as you said, that if you compare it with the size of the types of AVR-GCC it would be long, This is not a problem, just use the type aliases like those in core.stdc.stdint to work aroundDoesn't D promote all arithmetic operations to 32bit even if the operands are 16 bit?
Nov 28 2019
On 11/27/2019 6:35 AM, Ernesto Castellotti wrote:With BetterC everything seems to be working fine, now it's time to create a framework for using D on microcontrollers!Yay!
Nov 27 2019