View mode: basic / threaded / horizontal-split · Log in · Help
August 14, 2012
Re: OSX and 64-bit [Re: First working Win64 program!]
"Alex Rønne Petersen" <alex@lycus.org> wrote in message 
news:k0bs29$1bpl$1@digitalmars.com...
> On 13-08-2012 23:34, Walter Bright wrote:
>> On 8/13/2012 12:41 PM, Sean Kelly wrote:
>>
>> I've thought many times about adding a D feature that allows one to
>> specify "use this random character string instead of the identifier as
>> the symbol name when writing the object file", but never got around to 
>> it.
>>
>
> I've wanted a feature like that on several occasions (mostly when 
> interfacing with non-C/C++ languages). How hard it would it be to 
> implement? Theoretically, it sounds simple enough.
>

Pretty easy.  I can't remember why I wanted this in the first place, maybe 
trying to interface with c longs?  It probably needs updating (being over a 
year old) but the code is trivial.
https://github.com/yebblies/dmd/pull/new/pragma_mangle
August 14, 2012
Re: First working Win64 program!
On 2012-08-13 20:29, Walter Bright wrote:

> True, but consider that dmd is a 64 bit app, and nobody either complains
> about it or notices, and dmd by default produces a 64 bit app, and as
> far as I can tell, nobody has noticed that either.

I was agreeing with you :) One thing that we do notice is when 
interfacing with C libraries. I'm thinking of the bug where DMD doesn't 
pass structs correctly on 64bit. What's the status of that BTW?

-- 
/Jacob Carlborg
August 14, 2012
Re: OSX and 64-bit [Re: First working Win64 program!]
On 13-08-2012 23:43, Walter Bright wrote:
> On 8/13/2012 2:37 PM, Alex Rønne Petersen wrote:
>> I've wanted a feature like that on several occasions (mostly when
>> interfacing
>> with non-C/C++ languages). How hard it would it be to implement?
>> Theoretically,
>> it sounds simple enough.
>
>
> You could do it with a pragma or something. It's always going to look
> ugly, though.
>

With some help from Iain, I managed to hack something together: 
https://github.com/D-Programming-Language/dmd/pull/1085

-- 
Alex Rønne Petersen
alex@lycus.org
http://lycus.org
August 14, 2012
Re: OSX and 64-bit [Re: First working Win64 program!]
On 14-08-2012 14:00, Daniel Murphy wrote:
> "Alex Rønne Petersen" <alex@lycus.org> wrote in message
> news:k0bs29$1bpl$1@digitalmars.com...
>> On 13-08-2012 23:34, Walter Bright wrote:
>>> On 8/13/2012 12:41 PM, Sean Kelly wrote:
>>>
>>> I've thought many times about adding a D feature that allows one to
>>> specify "use this random character string instead of the identifier as
>>> the symbol name when writing the object file", but never got around to
>>> it.
>>>
>>
>> I've wanted a feature like that on several occasions (mostly when
>> interfacing with non-C/C++ languages). How hard it would it be to
>> implement? Theoretically, it sounds simple enough.
>>
>
> Pretty easy.  I can't remember why I wanted this in the first place, maybe
> trying to interface with c longs?  It probably needs updating (being over a
> year old) but the code is trivial.
> https://github.com/yebblies/dmd/pull/new/pragma_mangle
>
>

Thanks for the link! I hacked something together before I saw your post 
and it looks surprisingly similar (though my version is a bit more 
lenient in what it allows in symbol names and how many declarations it 
can affect): https://github.com/D-Programming-Language/dmd/pull/1085

-- 
Alex Rønne Petersen
alex@lycus.org
http://lycus.org
August 14, 2012
Re: First working Win64 program!
Bernard Helyer wrote:
> Clearly the solution is to look into cloning technologies.

Nah, we just need to write a software sophisticated enough that 
it can write software itself.

Then we'll need to write software simple enough to enjoy 
micro-managing that software to keep it on task.
August 14, 2012
Re: First working Win64 program!
On Tue, 14 Aug 2012 11:44:43 +0200, Bernard Helyer <b.helyer@gmail.com>  
wrote:

> On Tuesday, 14 August 2012 at 08:28:45 UTC, Walter Bright wrote:
>> On 8/13/2012 4:05 PM, Nick Sabalausky wrote:
>>> Well, not *exactly* the same boat. I always, perhaps mistakenly,  
>>> assumed
>>> the OMF issue would eventually get addressed. To see it pretty much
>>> verified that it *won't* be happening is very discouraging and
>>> frustrating. The existence of GDC and LDC doesn't solve the problem
>>> either.
>>
>>
>> There's only so much I can do with my time.
>>
>> But if someone else wants to do the work, all things are possible.
>
> Clearly the solution is to look into cloning technologies.

But wouldn't that create a soulless abomination[1]?

[1]: http://dilbert.com/fast/2001-09-28/

-- 
Simen
August 14, 2012
Re: First working Win64 program!
On 8/14/2012 7:30 AM, Jacob Carlborg wrote:
> I was agreeing with you :) One thing that we do notice is when interfacing with
> C libraries. I'm thinking of the bug where DMD doesn't pass structs correctly on
> 64bit. What's the status of that BTW?

It does pass them correctly to D functions, just not to C ones if the struct 
contains a mix of floating and integer types.
August 15, 2012
Re: First working Win64 program!
On Tuesday, 14 August 2012 at 14:41:20 UTC, F i L wrote:
> [...]
>
> Then we'll need to write software simple enough to enjoy 
> micro-managing that software to keep it on task.

Can I get it for the offshoring projects I work on? :)
August 15, 2012
Re: First working Win64 program!
On 2012-08-14 23:05, Walter Bright wrote:

> It does pass them correctly to D functions, just not to C ones if the
> struct contains a mix of floating and integer types.

Ok, so if my structs don't contain any floating point types I will be 
fine? All other types are ok? Is this in the 2.060 release or do I have 
get the latest sources from github?

-- 
/Jacob Carlborg
August 15, 2012
Re: First working Win64 program!
On Wednesday, 15 August 2012 at 10:28:15 UTC, Jacob Carlborg 
wrote:
> On 2012-08-14 23:05, Walter Bright wrote:
>
>> It does pass them correctly to D functions, just not to C ones 
>> if the
>> struct contains a mix of floating and integer types.
>
> Ok, so if my structs don't contain any floating point types I 
> will be fine? All other types are ok? Is this in the 2.060 
> release or do I have get the latest sources from github?

Does this not required that the D and C compiler are in sync 
about data layout?

Small sizes structs are often kept in registers.

--
Paulo
3 4 5 6 7 8
Top | Discussion index | About this forum | D home