Re: Reimplementing software building blocks like malloc and free in D

2018-08-13 Thread bpr via Digitalmars-d
On Monday, 13 August 2018 at 01:49:35 UTC, Mike Franklin wrote: On Sunday, 12 August 2018 at 06:35:17 UTC, Eugene Wissner wrote: P.S. In the last weeks I had thoughts to split low-level stuff from tanya and put it into a separate library, kind of native, gc-free x86-64 (and maybe aarch64) Linu

Re: Reimplementing software building blocks like malloc and free in D

2018-08-12 Thread Mike Franklin via Digitalmars-d
On Sunday, 12 August 2018 at 06:35:17 UTC, Eugene Wissner wrote: P.S. In the last weeks I had thoughts to split low-level stuff from tanya and put it into a separate library, kind of native, gc-free x86-64 (and maybe aarch64) Linux runtime for D. Probably I should go for it :) In recent mont

Re: Reimplementing software building blocks like malloc and free in D

2018-08-12 Thread Aruna Maurya via Digitalmars-d
On Sunday, 12 August 2018 at 11:37:54 UTC, Mike Parker wrote: On Sunday, 12 August 2018 at 11:23:55 UTC, Aruna Maurya wrote: So I'll be taking Eugene's code as reference to try and implement malloc free and realloc in dlang. Be sure to send your proposal in by August 15! Yes. Definitely!I

Re: Reimplementing software building blocks like malloc and free in D

2018-08-12 Thread Mike Parker via Digitalmars-d
On Sunday, 12 August 2018 at 11:23:55 UTC, Aruna Maurya wrote: So I'll be taking Eugene's code as reference to try and implement malloc free and realloc in dlang. Be sure to send your proposal in by August 15!

Re: Reimplementing software building blocks like malloc and free in D

2018-08-12 Thread Aruna Maurya via Digitalmars-d
On Sunday, 12 August 2018 at 08:34:46 UTC, Mike Franklin wrote: On Sunday, 12 August 2018 at 07:00:30 UTC, Eugene Wissner wrote: [...] Inline ASM is a feature of D, so "idiomatic D" includes assembly implementations. Where D shines here is with it's metaprogramming capabilities and the abi

Re: Reimplementing software building blocks like malloc and free in D

2018-08-12 Thread Mike Franklin via Digitalmars-d
On Sunday, 12 August 2018 at 06:44:37 UTC, Aruna Maurya wrote: Also what about other implementations like memset or memcmp. Have they been implemented or require work from scratch? I don't know of any D implementations of these other than the trivial and naive. I think it's a lot of work for

Re: Reimplementing software building blocks like malloc and free in D

2018-08-12 Thread Mike Franklin via Digitalmars-d
On Sunday, 12 August 2018 at 07:00:30 UTC, Eugene Wissner wrote: Also what about other implementations like memset or memcmp. Have they been implemented or require work from scratch? These functions are still mostly implemented in asm, so I'm not sure there is an "idiomatic D" way. I would on

Re: Reimplementing software building blocks like malloc and free in D

2018-08-12 Thread Mike Franklin via Digitalmars-d
On Sunday, 12 August 2018 at 07:00:30 UTC, Eugene Wissner wrote: Also what about other implementations like memset or memcmp. Have they been implemented or require work from scratch? These functions are still mostly implemented in asm, so I'm not sure there is an "idiomatic D" way. I would on

Re: Reimplementing software building blocks like malloc and free in D

2018-08-12 Thread Eugene Wissner via Digitalmars-d
On Sunday, 12 August 2018 at 06:44:37 UTC, Aruna Maurya wrote: On Sunday, 12 August 2018 at 05:24:56 UTC, Mike Franklin wrote: On Sunday, 12 August 2018 at 04:16:24 UTC, Aruna Maurya wrote: [...] I'd say there is only 1 requirement: implementing `malloc`, `realloc`, and `free` in idiomatic

Re: Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread Aruna Maurya via Digitalmars-d
On Sunday, 12 August 2018 at 05:24:56 UTC, Mike Franklin wrote: On Sunday, 12 August 2018 at 04:16:24 UTC, Aruna Maurya wrote: [...] I'd say there is only 1 requirement: implementing `malloc`, `realloc`, and `free` in idiomatic D without any dependencies on other libraries from other langu

Re: Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread Eugene Wissner via Digitalmars-d
On Sunday, 12 August 2018 at 05:24:56 UTC, Mike Franklin wrote: I wasn't aware of Eugene's implementation. At first glance it looks real nice. It appears to have some dependencies on other features of his Tanya library, so at a minimum, those will have to be removed or replaced. It depend

Re: Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread Mike Franklin via Digitalmars-d
On Sunday, 12 August 2018 at 04:16:24 UTC, Aruna Maurya wrote: So there are essentially two requirements here. Building the memory management functionalities from scratch in idiomatic D and implementing the existing runtime hooks as templates. The latter isn't quite a part of the idea as menti

Re: Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread Aruna Maurya via Digitalmars-d
On Saturday, 11 August 2018 at 20:15:06 UTC, Mike Franklin wrote: On Saturday, 11 August 2018 at 18:59:00 UTC, Aruna Maurya wrote: [...] The compiler recognizes certain expressions and lowers them to functions in the D runtime that we call runtime hooks. See https://wiki.dlang.org/Runtime_

Re: Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread Mike Franklin via Digitalmars-d
On Saturday, 11 August 2018 at 18:59:00 UTC, Aruna Maurya wrote: 1. If it would have been C++, the above can be implemented by using the mmap() syscall to allocate memory from the heap. However, something that I am not able to understand in the idea description is 'runtime hoo

Re: Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread Eugene Wissner via Digitalmars-d
On Saturday, 11 August 2018 at 18:59:00 UTC, Aruna Maurya wrote: Hello all! I am a Computer Science undergraduate student. Currently a junior, I find the idea of 're-implementing software building blocks like malloc and free in D' listed in the wiki page of SAOC(Symmetry Autumn of Code) quite

Re: Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread rikki cattermole via Digitalmars-d
On 12/08/2018 6:59 AM, Aruna Maurya wrote: 1. If it would have been C++, the above can be implemented by using the mmap() syscall to  allocate memory from the heap. However, something that I am not able to understand in the idea description is 'runtime hooks'. A runtime hook i

Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread Aruna Maurya via Digitalmars-d
Hello all! I am a Computer Science undergraduate student. Currently a junior, I find the idea of 're-implementing software building blocks like malloc and free in D' listed in the wiki page of SAOC(Symmetry Autumn of Code) quite interesting. I don't have experience of coding in D however, I ha