May 13, 2013
On Monday, 13 May 2013 at 08:24:52 UTC, Iain Buclaw wrote:
> On 13 May 2013 09:11, Dicebot <m.strashun@gmail.com> wrote:
>
>> Last time I tried such stuff there was a TypeInfo emitted for templated
>> structs. Is this still the case?
>>
>
> Why would you use templates in low level (eg: kernel) code?

Why would I chose D over C if I am restricted from templates? Templates are essentially an automated type-safe copy-paste and there is a lot of copy-paste in type kernel-flavor code to be eliminated. Or, to be more specific, why shouldn't I? As you may notice, this topic author uses C++ meta-programming just fine in this environment, no reason D can't do it.

(feels like all my previous rants on this topic got unnoticed =/)
May 13, 2013
On Sunday, 12 May 2013 at 17:13:30 UTC, Timo Sintonen wrote:
> On Sunday, 12 May 2013 at 15:27:04 UTC, Iain Buclaw wrote:
>> On 12 May 2013 15:41, Rel <relmail@rambler.ru> wrote:
>>
>>> Benjamin Thaut, yes I know. but here is an example, if I add a class to
>>> the code like that:
>>>
>>>
>>> module main;
>>>
>>> extern (C) void* _Dmodule_ref = null;
>>> extern (C) void printf(const char*, ...);
>>>
>>> extern (C) void puts(const char*);
>>> extern (C) void exit(int);
>>>
>>> class A {
>>>        int a = 100;
>>>        int b = 200;
>>>
>>> };
>>>
>>> extern (C) void main() {
>>>        scope(exit) {
>>>                puts("Exiting!");
>>>                exit(0);
>>>        }
>>>
>>>        A a; printf("%d %d\n", a.a, a.b);
>>> }
>>>
>>
>> This code won't work.  classes are reference types and need to be
>> initialised with 'new'.  This requires TypeInfo_Class information to
>> do...   You could possible use 'scope A a = new A'.  But again your going
>> into the bounds of needing rtti for the initialiser var to assign it on the
>> stack.
>>
>> Structs would be your friend here...
>
> I have used the option -fno-emit-moduleinfo and got rid of _Dmodule_ref
>
> Anything created with 'new' needs memory allocation. I have just published a minimum memory allocation in my repo.
>
> The address of my minimum runtime environment repository is:
> bitbucket.org/timosi/minlibd

Will this minimum runtime environment work on Windows, too?
I'd like to try that out.
May 14, 2013
On Monday, 13 May 2013 at 20:21:55 UTC, Mr. Anonymous wrote:
>
> Will this minimum runtime environment work on Windows, too?
> I'd like to try that out.

I see no reason why this would not work. The only thing that is needed is a working cross compiler.

I have not heard of gdc cross compilers for windows and I do not have time and interest to play with that. This question has been asked several times so I think there is interest for this. If someone wants to try, there are several options:

- The compiler can made step by step. The instructions are here: http://gdcproject.org/wiki/Cross%20Compiler

- Use the native windows version and make it a cross compiler. I would like to hear a comment from mingw people if this is possible.

- There are full cross tools chains that use gcc like this:
https://launchpad.net/gcc-arm-embedded
Gdc could be added to gcc there.


As long as gdc is not part of gcc, there will not be any ready-to-use D toolchain. If there is any success, I would like to hear it
.
May 14, 2013
On 14 May 2013 06:14, Timo Sintonen <t.sintonen@luukku.com> wrote:

> On Monday, 13 May 2013 at 20:21:55 UTC, Mr. Anonymous wrote:
>
>>
>> Will this minimum runtime environment work on Windows, too? I'd like to try that out.
>>
>
> I see no reason why this would not work. The only thing that is needed is a working cross compiler.
>
>
Indeed, if it's a free-standing runtime environment.  Then it could be moved and put anywhere.



> As long as gdc is not part of gcc, there will not be any ready-to-use D
> toolchain. If there is any success, I would like to hear it
> .
>

This logic is backwards.  Go is part of gcc but there is still no ready-to-use toolchain available for, say, PPC or IA64.   We don't need to be part of gcc to get toolchains up for platforms.  Just need the people willing enough to port and support them.

-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


1 2
Next ›   Last »