www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - druntime vararg implementation

reply "Mike" <none none.com> writes:
Greetings,

In core.varar. 
(https://github.com/D-Programming-Language/druntime/blob/master
src/core/vararg.d), 
why is the X86 implementation singled out and written in D rather 
than leveraging the standard c library implementation like the 
others?

Mike
Nov 05 2014
parent reply "Sean Kelly" <sean invisibleduck.org> writes:
On Wednesday, 5 November 2014 at 09:45:50 UTC, Mike wrote:
 Greetings,

 In core.varar. 
 (https://github.com/D-Programming-Language/druntime/blob/master
src/core/vararg.d), 
 why is the X86 implementation singled out and written in D 
 rather than leveraging the standard c library implementation 
 like the others?
No idea. It seems like a pointless duplication of code. Maybe just to have some documented functions within the module?
Nov 05 2014
parent reply "Mike" <none none.com> writes:
On Wednesday, 5 November 2014 at 14:24:00 UTC, Sean Kelly wrote:
 On Wednesday, 5 November 2014 at 09:45:50 UTC, Mike wrote:
 Greetings,

 In core.varar. 
 (https://github.com/D-Programming-Language/druntime/blob/master
src/core/vararg.d), 
 why is the X86 implementation singled out and written in D 
 rather than leveraging the standard c library implementation 
 like the others?
No idea. It seems like a pointless duplication of code. Maybe just to have some documented functions within the module?
In that case, a better question is "Why use the standard C implementation if we have working D code?".
Nov 05 2014
parent Jonathan M Davis via Digitalmars-d-learn writes:
On Thursday, November 06, 2014 00:16:48 Mike via Digitalmars-d-learn wrote:
 In that case, a better question is "Why use the standard C
 implementation if we have working D code?".
Less to maintain. Also, there's less risk of inconsistency with what C is doing. And it's low level stuff anyway where it doesn't really buy us much to implement it ourselves rather than just hooking into the existing C API. - Jonathan M Davis
Nov 05 2014