www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Raw binary(to work without OS) in D

reply "Alex" <phoenixcorp13 gmail.com> writes:
is it possible to use D to write code to work without OS?
like i do it with gcc.
Jun 21 2012
next sibling parent "Era Scarecrow" <rtcvb32 yahoo.com> writes:
On Thursday, 21 June 2012 at 16:39:07 UTC, Alex wrote:
 is it possible to use D to write code to work without OS? like 
 i do it with gcc.
With the runtime, I want to say no. If you drop the runtime and GC (including dynamic arrays), I honestly don't see why not. However if you don't have any OS connections you have to write IO yourself, some of it probably in assembly (That or it's a very silent and unfruitful program). Maybe good for certain device drivers but beyond that it doesn't seem too practical. At this moment.
Jun 21 2012
prev sibling next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 6/21/2012 9:39 AM, Alex wrote:
 is it possible to use D to write code to work without OS?
 like i do it with gcc.
Sure. But you'll need to thoroughly understand how the D runtime startup code works, so you can adjust as necessary.
Jun 21 2012
parent reply "Mehrdad" <wfunction hotmail.com> writes:
On Thursday, 21 June 2012 at 19:44:40 UTC, Walter Bright wrote:
 On 6/21/2012 9:39 AM, Alex wrote:
 is it possible to use D to write code to work without OS?
 like i do it with gcc.
Sure. But you'll need to thoroughly understand how the D runtime startup code works, so you can adjust as necessary.
Good luck getting the C-runtime part of the "D runtime" right..
Jun 21 2012
next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 6/21/2012 11:07 PM, Mehrdad wrote:
 On Thursday, 21 June 2012 at 19:44:40 UTC, Walter Bright wrote:
 On 6/21/2012 9:39 AM, Alex wrote:
 is it possible to use D to write code to work without OS?
 like i do it with gcc.
Sure. But you'll need to thoroughly understand how the D runtime startup code works, so you can adjust as necessary.
Good luck getting the C-runtime part of the "D runtime" right..
It's not that hard. But there's a lot of detail to learn & take care of.
Jun 21 2012
next sibling parent reply "Mehrdad" <wfunction hotmail.com> writes:
On Friday, 22 June 2012 at 06:35:41 UTC, Walter Bright wrote:
 On 6/21/2012 11:07 PM, Mehrdad wrote:
 Good luck getting the C-runtime part of the "D runtime" right..
It's not that hard. But there's a lot of detail to learn & take care of.
Where do you find the "detail"? (Remember this, below?) http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=155617
Jun 21 2012
next sibling parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 22-Jun-12 10:49, Mehrdad wrote:
 On Friday, 22 June 2012 at 06:35:41 UTC, Walter Bright wrote:
 On 6/21/2012 11:07 PM, Mehrdad wrote:
 Good luck getting the C-runtime part of the "D runtime" right..
It's not that hard. But there's a lot of detail to learn & take care of.
Where do you find the "detail"? (Remember this, below?)
Just replace all of symbols with abort stubs. Then implement the ones you happen to actually need.
 http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=155617
-- Dmitry Olshansky
Jun 22 2012
parent reply "Mehrdad" <wfunction hotmail.com> writes:
On Friday, 22 June 2012 at 08:00:08 UTC, Dmitry Olshansky wrote:
 Then implement the ones you happen to actually need.
Er, the question isn't WHAT to do, it's HOW. If you have any idea how to implement things like TLS, SEH, and the like, then PLEASE, share them! The point I was trying to make was, though, that this information is not being shared with anyone. Which leads me to believe that whoever has this information doesn't want people to use it for D development...
Jun 22 2012
next sibling parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 22-Jun-12 12:08, Mehrdad wrote:
 On Friday, 22 June 2012 at 08:00:08 UTC, Dmitry Olshansky wrote:
 Then implement the ones you happen to actually need.
Er, the question isn't WHAT to do, it's HOW. If you have any idea how to implement things like TLS, SEH, and the like, then PLEASE, share them!
Look at say Win32 API. There is a way to reroute most of things you listed directly to it. I actually do this kind of stuff in my spare time. Of course your own kernel has some manner of system calls too.
 The point I was trying to make was, though, that this information is not
 being shared with anyone.
If you can't figure it out on your own, chances are you won't be able to do what you wanted in the first place (e.g. real-time micro-kernel). I mean it's nothing magical, all of these things are present in say MS C compiler and people do these things with it just _fine_.
 Which leads me to believe that whoever has this information doesn't want
 people to use it for D development...
Yeah, I understand how it could be frustrating, but once you are on this kind of level you usually already running circles around all of this stuff. That being said the info won't hurt of course. -- Dmitry Olshansky
Jun 22 2012
parent reply "Mehrdad" <wfunction hotmail.com> writes:
On Friday, 22 June 2012 at 08:35:51 UTC, Dmitry Olshansky wrote:
 Look at say Win32 API. There is a way to reroute most of things 
 you listed directly to it. I actually do this kind of stuff in 
 my spare time. Of course your own kernel has some manner of 
 system calls too.
I'm talking about things like PE file sections used to support TLS and whatnot. They're unrelated to the Windows API.
 If you can't figure it out on your own, chances are you won't 
 be able to do what you wanted in the first place (e.g. 
 real-time micro-kernel).
You're not being helpful.
 I mean it's nothing magical, all of these things are present in 
 say MS C compiler and people do these things with it just 
 _fine_.
Uh, no. D puts extra crap in the binary.
 Yeah, I understand how it could be frustrating, but once you 
 are on this kind of level you usually already running circles 
 around all of this stuff.
 That being said the info won't hurt of course.
I guess I'm not at your majesty's High Level yet? Thanks for being so helpful.
Jun 22 2012
next sibling parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 22-Jun-12 18:17, Mehrdad wrote:
 You're not being helpful.
While I usually try to help people where I can do so I didn't intend to _help_ you with this post in any capacity. Aside from
Just replace all of symbols with abort stubs. Then implement the ones 
you happen to actually need.
but you are (probably) way ahead of this advice.
 I mean it's nothing magical, all of these things are present in say MS
 C compiler and people do these things with it just _fine_.
Uh, no. D puts extra crap in the binary.
Like what? I'm aware only of some fancy _beg/_end sections and a bunch of stuff from DMC runtime, mostly FP math things.
 Yeah, I understand how it could be frustrating, but once you are on
 this kind of level you usually already running circles around all of
 this stuff.
 That being said the info won't hurt of course.
I guess I'm not at your majesty's High Level yet? Thanks for being so helpful.
No problem. I meant actually low level. Like "down to hardware/OS" so it's rather the opposite ;) It's not like I've asserted yours or mine levels at anything in particular at all. (that 'you' in my paragraph above should have probably been 'one' i.e. 'once one on this kind of level...') -- Dmitry Olshansky
Jun 22 2012
parent reply "Mehrdad" <wfunction hotmail.com> writes:
On Friday, 22 June 2012 at 14:40:42 UTC, Dmitry Olshansky wrote:
 I guess I'm not at your majesty's High Level yet? Thanks for 
 being so
 helpful.
No problem.
Someone can't recognize sarcasm...
 I meant actually low level. Like "down to hardware/OS" so it's 
 rather the opposite ;)
 It's not like I've asserted yours or mine levels at anything in 
 particular at all.
Allow me to translate? "Geez, I guess you're just an idiot for needing so much spoon-fed to you. I can land people on the moon without anyone ever telling me how. Not that I never insulted you at anything in particular."
 (that 'you' in my paragraph above should have probably been 
 'one' i.e. 'once one on this kind of level...')
Oh, so now you're insulting /everyone/ like me, instead of just me! That obviously makes the situation better. Are you serious? So you're going to tell people they're just too stupid for the task if they can't figure something out by themselves?
Jun 22 2012
parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 06/22/2012 04:58 PM, Mehrdad wrote:
 On Friday, 22 June 2012 at 14:40:42 UTC, Dmitry Olshansky wrote:
 I guess I'm not at your majesty's High Level yet? Thanks for being so
 helpful.
No problem.
Someone can't recognize sarcasm...
 I meant actually low level. Like "down to hardware/OS" so it's rather
 the opposite ;)
 It's not like I've asserted yours or mine levels at anything in
 particular at all.
Allow me to translate? "Geez, I guess you're just an idiot for needing so much spoon-fed to you. I can land people on the moon without anyone ever telling me how. Not that I never insulted you at anything in particular."
 (that 'you' in my paragraph above should have probably been 'one' i.e.
 'once one on this kind of level...')
Oh, so now you're insulting /everyone/ like me, instead of just me! That obviously makes the situation better. Are you serious? So you're going to tell people they're just too stupid for the task if they can't figure something out by themselves?
Note that this kind of melodramatism is not helping your case. Getting insulted and shooting in all directions is genuinely stupid behaviour and wastes everyone's time. You have to realize that some of your comments have been rather impolite lately. Why do you assume that everyone else cares a lot more about how some random comment might be conceived?
Jun 22 2012
parent reply "Mehrdad" <wfunction hotmail.com> writes:
On Friday, 22 June 2012 at 15:12:13 UTC, Timon Gehr wrote:
 Note that this kind of melodramatism is not helping your case.
 Getting insulted and shooting in all directions is genuinely 
 stupid behaviour and wastes everyone's time.

 You have to realize that some of your comments have been rather
 impolite lately.
You mean in response to Dmitri's comments? Or to someone else? It would be very helpful for me if you could show a couple examples of what you're referring to.
 Why do you assume that everyone else cares a lot more about how 
 some random comment might be conceived?
"Might" be conceived? Is it really just me? Okay, well then you tell me: Isn't the quote
 If you can't figure it out on your own, chances are you won't 
 be able to
do what you wanted in the first place just saying I'm too stupid for this to help me anyway?
Jun 22 2012
next sibling parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 06/22/2012 05:21 PM, Mehrdad wrote:
 On Friday, 22 June 2012 at 15:12:13 UTC, Timon Gehr wrote:
 Note that this kind of melodramatism is not helping your case.
 Getting insulted and shooting in all directions is genuinely stupid
 behaviour and wastes everyone's time.

 You have to realize that some of your comments have been rather
 impolite lately.
You mean in response to Dmitri's comments? Or to someone else? It would be very helpful for me if you could show a couple examples of what you're referring to.
You like blaming someone, or claiming someone has bad intentions. Eg:
 Which leads me to believe that whoever has this information doesn't want
people to use it for D development...
 The way I'm understanding it is that the message is essentially "If you want
to develop your own
 systems with our systems programming language, then you gotta buy it, sorry.
Batteries not included."
There is no need to deduce such messages from insufficient support or documentation of a free product run 100% by volunteers. Who should such comments be directed at? What should their effect be? I only see it generating bad air.
 Why do you assume that everyone else cares a lot more about how some
 random comment might be conceived?
"Might" be conceived? Is it really just me? Okay, well then you tell me: Isn't the quote
 If you can't figure it out on your own, chances are you won't be able to
do what you wanted in the first place just saying I'm too stupid for this to help me anyway?
I think it does not matter, because the optimal reaction would be the same in each case: ignore the comment and continue the productive part of the discussion.
Jun 22 2012
parent "Mehrdad" <wfunction hotmail.com> writes:
On Friday, 22 June 2012 at 15:37:16 UTC, Timon Gehr wrote:
 You like blaming someone, or claiming someone has bad 
 intentions. Eg:

 Which leads me to believe that whoever has this information 
 doesn't want people to use it for D development...
 The way I'm understanding it is that the message is 
 essentially "If you want to develop your own
 systems with our systems programming language, then you gotta 
 buy it, sorry. Batteries not included."
There is no need to deduce such messages from insufficient support or documentation of a free product run 100% by volunteers.
I see. I would agree if you said it was nonconstructive, but I don't see how it's /impolite/ -- at all. My intention wasn't to claim Walter (assuming that's whom you meant I was referring to) has bad intentions (I -- at least partially -- understand he can't just release the code, etc.). The trouble was that his "solution" to the problem was "buy the source code". That's not /bad/ intentions... it simply goes against the nature of D/DMD. If his response had instead been "well, I'd love to share this info, but due to legal issues I can't", then I couldn't help but sympathize. The issue is that I've asked this question a bunch of times (e.g. the one I linked to earlier), and _only now_ has anyone given any reasonable response at all for solving the problem ("buy the code") -- so it only naturally makes me wonder: is that the intention of promoting? Again, wasn't trying to be "impolite" to Walter (or you or the others). I just find that the "buy the source code" comment (which, to be sure, is better than the nothing I'd gotten before) is sending completely the wrong message. If you had any other examples for where you believe I've been impolite, let me know. (Feel free to email me if you don't want to clutter here.) That would actually be helpful for me.
 I think it does not matter
I don't...
 because the optimal reaction would be the same in each case: 
 ignore the comment and continue the productive part of the 
 discussion.
I do sometimes try to do that, though I guess I'll try it more often...
Jun 22 2012
prev sibling next sibling parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 22-Jun-12 19:21, Mehrdad wrote:
 "Might" be conceived? Is it really just me? Okay, well then you tell me:

 Isn't the quote
 If you can't figure it out on your own, chances are you won't be able to
do what you wanted in the first place just saying I'm too stupid for this to help me anyway?
I actually meant my previous post to be the last in this thread. But here it goes: 1. I classify the above as speculation on my part, namely to put it in other words (not featuring any individual): "this work take a lot of low-level hacking meaning that investigating symbols output by compiler and their meaning is least of problem there usually" That's ALL I meant to say here. You can frame it like advice, insult, promotion or whatever you fell like (it's not like I or someone else can stop you). 2. The sarcasm is not lost on me, but for some reason I _think_ you are/were outraged way before my post. Being outraged doesn't help sort out things 99% of time (this is my assertion you may disagree). 3. If anything the mailing list/NG is not technical support (especially "general discussion ones") I'm not obliged to offer you any help. It's all about sharing opinions. So take it or ignore it and let's move on. -- Dmitry Olshansky
Jun 22 2012
parent reply "Mehrdad" <wfunction hotmail.com> writes:
On Friday, 22 June 2012 at 15:45:30 UTC, Dmitry Olshansky wrote:
 I actually meant my previous post to be the last in this thread.
 But here it goes:
Sorry :\
 1. I classify the above as speculation on my part, namely to 
 put it in other words (not featuring any individual):
 "this work take a lot of low-level hacking meaning that 
 investigating symbols output by compiler and their meaning is 
 least of problem there usually"
 That's ALL I meant to say here. You can frame it like advice, 
 insult, promotion or whatever you fell like (it's not like I or 
 someone else can stop you).
The trouble is I only see what you write, not what you think. What you're writing here is very clearly different in tone from what you said before, even if it wasn't intentional. (Usually the onus is more on the speaker to get his words across, not on the reader to try and decipher them.)
 2. The sarcasm is not lost on me, but for some reason I _think_ 
 you are/were outraged way before my post.
"Outraged"? Not sure at what you're referring specifically...
 Being outraged doesn't help sort out things 99% of time (this 
 is my assertion you may disagree).
Totally agree... though (until now) I didn't see any attempt at "sorting out" anything. (The second comment only made things worse.)
 3. If anything the mailing list/NG is not technical support 
 (especially "general discussion ones") I'm not obliged to offer 
 you any help. It's all about sharing opinions.
Yes, and I wasn't asking for you to offer me help either. But insulting people -- yeah, It's against my expectations to go on an NG and be told I'm too stupid to do something. Even if it's your opinion.
 So take it or ignore it and let's move on.
Sure, if you'd like to. (I didn't get that message from you until now.)
Jun 22 2012
next sibling parent reply "Roman D. Boiko" <rb d-coding.com> writes:
On Friday, 22 June 2012 at 16:08:13 UTC, Mehrdad wrote:
 The trouble is I only see what you write, not what you think.

 What you're writing here is very clearly different in tone from 
 what you said before, even if it wasn't intentional.
 (Usually the onus is more on the speaker to get his words 
 across, not on the reader to try and decipher them.)
Comparing what Dmitry wrote earlier:
 If you can't figure it out on your own, chances are you won't 
 be able to do what you wanted in the first place (e.g. 
 real-time micro-kernel).
and
 Yeah, I understand how it could be frustrating, but once you 
 are on this kind of level you usually already running circles 
 around all of this stuff.
to later interpretation:
 1. I classify the above as speculation on my part, namely to 
 put it in other words (not featuring any individual):
 "this work take a lot of low-level hacking meaning that 
 investigating symbols output by compiler and their meaning is 
 least of problem there usually"
may seem to be very different at first. But in Russian the first and the last sentences would have similar meanings. In general, it is difficult to predict how something is going to be perceived. So it is usually OK for a person to say something assuming that others will understand the intended meaning, provided that clarification is given on request. In this case, Dmitry provided a very reasonable clarification about the meaning of word 'level'. And interpretation of a statement which I quoted first is reasonably equivalent to what Dmitry provided later. (I'm from Ukraine, we speak Russian well. Dmitry is from Russia. Hope you will believe me.)
Jun 22 2012
parent reply "Mehrdad" <wfunction hotmail.com> writes:
On Friday, 22 June 2012 at 17:06:19 UTC, Roman D. Boiko wrote:
 On Friday, 22 June 2012 at 16:08:13 UTC, Mehrdad wrote:
 The trouble is I only see what you write, not what you think.

 What you're writing here is very clearly different in tone 
 from what you said before, even if it wasn't intentional.
 (Usually the onus is more on the speaker to get his words 
 across, not on the reader to try and decipher them.)
Comparing what Dmitry wrote earlier:
 If you can't figure it out on your own, chances are you won't 
 be able to do what you wanted in the first place (e.g. 
 real-time micro-kernel).
and
 Yeah, I understand how it could be frustrating, but once you 
 are on this kind of level you usually already running circles 
 around all of this stuff.
to later interpretation:
 1. I classify the above as speculation on my part, namely to 
 put it in other words (not featuring any individual):
 "this work take a lot of low-level hacking meaning that 
 investigating symbols output by compiler and their meaning is 
 least of problem there usually"
may seem to be very different at first. But in Russian the first and the last sentences would have similar meanings.
lol. I don't speak Russian, sorry. :\ For me, the first one would imply the last one, but not necessarily the other way around.
 In general, it is difficult to predict how something is going 
 to be perceived. So it is usually OK for a person to say 
 something assuming that others will understand the intended 
 meaning, provided that clarification is given on request.
I suppose? Though if someone were trying to insult you, I'm not sure if they would ever confirm, "Yes, I mean to say you're an idiot", or that they would necessarily repeat it, even if you asked them. (Sad but true, I think.) So I'm not sure if you can ask for a clarification for everything...
 In this case, Dmitry provided a very reasonable clarification 
 about the meaning of word 'level'. And interpretation of a 
 statement which I quoted first is reasonably equivalent to what 
 Dmitry provided later.
Well, yes; he clearly said:
 I meant actually low level. Like "down to hardware/OS" so it's 
 rather the opposite ;)
so that would've been fine. What didn't help the situation was the other part...
 "[...] you usually already running circles around all of this 
 stuff"
With that part, it was saying, "If you don't know this stuff then you shouldn't be working at this level", _NOT_ "you're going to have bigger problems at this level". The implications are different. Maybe my reasoning was weird, but that's how it came across...
 (I'm from Ukraine, we speak Russian well. Dmitry is from 
 Russia. Hope you will believe me.)
I have no reason not to. :) But I also have a hard time integrating that fact into the rest of the discussion, since I obviously don't know Russian.
Jun 22 2012
parent reply "Roman D. Boiko" <rb d-coding.com> writes:
On Friday, 22 June 2012 at 17:33:17 UTC, Mehrdad wrote:
 I have no reason not to. :)
 But I also have a hard time integrating that fact into the rest 
 of the discussion, since I obviously don't know Russian.
In general, it is easy to write two very different statements in Russian which may be considered to have similar or equivalent meanings. In many cases it is OK to say something figuratively, and people will very likely perceive the meaning correctly. That may easily become a habit. This often causes me to say vague statements in English.
Jun 22 2012
parent "Mehrdad" <wfunction hotmail.com> writes:
On Friday, 22 June 2012 at 17:41:06 UTC, Roman D. Boiko wrote:
 On Friday, 22 June 2012 at 17:33:17 UTC, Mehrdad wrote:
 I have no reason not to. :)
 But I also have a hard time integrating that fact into the 
 rest of the discussion, since I obviously don't know Russian.
In general, it is easy to write two very different statements in Russian which may be considered to have similar or equivalent meanings. In many cases it is OK to say something figuratively, and people will very likely perceive the meaning correctly. That may easily become a habit. This often causes me to say vague statements in English.
No I mean, I understand what you're saying. It's just that, well, the writer's nationality is sorta beyond my scope as a reader. :-)
Jun 22 2012
prev sibling parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 22-Jun-12 20:08, Mehrdad wrote:
 On Friday, 22 June 2012 at 15:45:30 UTC, Dmitry Olshansky wrote:
 I actually meant my previous post to be the last in this thread.
 But here it goes:
Sorry :\
 1. I classify the above as speculation on my part, namely to put it in
 other words (not featuring any individual):
 "this work take a lot of low-level hacking meaning that investigating
 symbols output by compiler and their meaning is least of problem there
 usually"
 That's ALL I meant to say here. You can frame it like advice, insult,
 promotion or whatever you fell like (it's not like I or someone else
 can stop you).
The trouble is I only see what you write, not what you think. What you're writing here is very clearly different in tone from what you said before, even if it wasn't intentional. (Usually the onus is more on the speaker to get his words across, not on the reader to try and decipher them.)
Sorry, like Roman said I'm not native speaker. And I'm not sure of the emotional component of things I type. To be honest no matter what form I use I tend to be neutral in general (or so I thought). (Except some very rare cases. I recall that I told something harsh in response to the "brilliant idea" of turning enforce into assert with some version statement)
 2. The sarcasm is not lost on me, but for some reason I _think_ you
 are/were outraged way before my post.
"Outraged"? Not sure at what you're referring specifically...
I meant something like this:
 Good luck getting the C-runtime part of the "D runtime" right..
...
 If you have any idea how to implement things like TLS, SEH, and the 
like, then PLEASE, share them! You were almost shouting or demanding (or so it seemed to me). I think this was the first time I insulted somebody uninterruptedly and that went totally unexpected for me.
 Being outraged doesn't help sort out things 99% of time (this is my
 assertion you may disagree).
Totally agree... though (until now) I didn't see any attempt at "sorting out" anything. (The second comment only made things worse.)
Good. And bad, as it seems I need to refresh my word/phrase selection :)
 3. If anything the mailing list/NG is not technical support
 (especially "general discussion ones") I'm not obliged to offer you
 any help. It's all about sharing opinions.
Yes, and I wasn't asking for you to offer me help either. But insulting people -- yeah, It's against my expectations to go on an NG and be told I'm too stupid to do something. Even if it's your opinion.
If anything I'm not about to make any statements aimed at a particular person. If there was insult, I'm sorry as I failed to spot emotional context of things I posted.
 So take it or ignore it and let's move on.
Sure, if you'd like to. (I didn't get that message from you until now.)
OK, glad we are (sort of) having some agreement. -- Dmitry Olshansky
Jun 22 2012
parent "Mehrdad" <wfunction hotmail.com> writes:
On Friday, 22 June 2012 at 18:52:41 UTC, Dmitry Olshansky wrote:
 Sorry, like Roman said I'm not native speaker. And I'm not sure 
 of the emotional component of things I type. To be honest no 
 matter what form I use I tend to be neutral in general (or so I 
 thought).
Yeah I'm not a native either, so that doesn't help me so much either... :\ (Though I guess, from another perspective, learning English has also helped me a lot. :P my point's there though.)
 I meant something like this:

 Good luck getting the C-runtime part of the "D runtime"
right.. ...
 If you have any idea how to implement things like TLS, SEH,
and the like, then PLEASE, share them! You were almost shouting or demanding (or so it seemed to me). I think this was the first time I insulted somebody uninterruptedly and that went totally unexpected for me.
Ah. I wasn't demanding :-) "shouting" is closer but I wasn't trying to be yelling at anyone :P it just shows I didn't communicate well either. :)
 If anything I'm not about to make any statements aimed at a 
 particular person. If there was insult, I'm sorry as I failed 
 to spot emotional context of things I posted.
Sorry about my misunderstanding as well -- my inference engine kinda failed at inferring what you meant. :P
 OK, glad we are having some agreement.
Yup :)
Jun 22 2012
prev sibling parent Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On 6/22/2012 11:21 AM, Mehrdad wrote:
 On Friday, 22 June 2012 at 15:12:13 UTC, Timon Gehr wrote:

 Isn't the quote
 If you can't figure it out on your own, chances are you won't be able to
do what you wanted in the first place just saying I'm too stupid for this to help me anyway?
No, that quote is merely pointing out, for cautionary purposes, that the task you're ultimately trying to do is typically either equally difficult, or more difficult, than this first step you're currently on. If I'm reading correctly, he simply doesn't want you to end up being unpleasantly surprised by what you may face once you do reach that point. But explaining it that way is verbose and difficult (I spent entirely too long figuring out how to word it - and I'm a native speaker), so he wrote it in a more straightforward way: As an "A implies B" relation, ie an rather frank and blunt "if...then". (AIUI, anyway) Slight soapbox, not directed at anyone in particular: Emotion tends to severely complicate communication, so for technical things (which tend to *already* be difficult to communicate), a person speaking/writing will frequently need to disregard emotion-related concerns in their choice of wording. Therefore, when reading/listening, it's best to "Be like Spock, not Bones" and always assume anything that *can* be interpreted unemotionally or benign was *intended* to be unemotional and benign, regardless of whether or not that might be a false assumption. Granted, as a reader/listener, there have been plenty of times I've colossally failed to follow that guideline, so I'm certainly not immune from such failings myself. But it's a working theory I've formulated after being in (and near) a few too many flamewars, and FWIW I think it's fairly sound.
Feb 15 2014
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 6/22/2012 7:17 AM, Mehrdad wrote:
 On Friday, 22 June 2012 at 08:35:51 UTC, Dmitry Olshansky wrote:
 Look at say Win32 API. There is a way to reroute most of things you listed
 directly to it. I actually do this kind of stuff in my spare time. Of course
 your own kernel has some manner of system calls too.
I'm talking about things like PE file sections used to support TLS and whatnot. They're unrelated to the Windows API.
The PE file section documentation can be found by googling "Windows PE file format".
Jun 22 2012
prev sibling parent reply Don Clugston <dac nospam.com> writes:
On 22/06/12 10:08, Mehrdad wrote:
 On Friday, 22 June 2012 at 08:00:08 UTC, Dmitry Olshansky wrote:
 Then implement the ones you happen to actually need.
Er, the question isn't WHAT to do, it's HOW. If you have any idea how to implement things like TLS, SEH, and the like, then PLEASE, share them!
On Windows, all of the SEH code is in D. The C library isn't used any more. I think the main thing that's still done in C is the floating point formatting.
 The point I was trying to make was, though, that this information is not
 being shared with anyone.

 Which leads me to believe that whoever has this information doesn't want
 people to use it for D development...
Jun 22 2012
next sibling parent reply "Mehrdad" <wfunction hotmail.com> writes:
On Friday, 22 June 2012 at 11:41:26 UTC, Don Clugston wrote:
 On Windows, all of the SEH code is in D. The C library isn't 
 used any more.
That's certainly changed a lot since the last time I looked, so that's good. But lots of other parts about D (TLS, GC, etc.) still have that problem though. I was never able to get the __xi_a, __xi_z, etc. stuff correct, and I've spent a heck of a lot of time on it. The way I'm understanding it is that the message is essentially "If you want to develop your own systems with our systems programming language, then you gotta buy it, sorry. Batteries not included."
Jun 22 2012
parent Walter Bright <newshound2 digitalmars.com> writes:
On 6/22/2012 7:51 AM, Mehrdad wrote:
 But lots of other parts about D (TLS, GC, etc.) still have that problem though.
 I was never able to get the __xi_a, __xi_z, etc. stuff correct, and I've spent
a
 heck of a lot of time on it.
Those are defined by Microsoft, and hold pointers to static constructors from Microsoft C generated code. It's unused by DMC, except to not muck them up in case someone links in MSC generated code.
Jun 22 2012
prev sibling next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 6/22/2012 4:41 AM, Don Clugston wrote:
 On Windows, all of the SEH code is in D. The C library isn't used any more.

 I think the main thing that's still done in C is the floating point formatting.
The startup code is done in the C library, and the thread creation stuff still relies on the C library, too.
Jun 22 2012
prev sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 6/22/12 7:41 AM, Don Clugston wrote:
 I think the main thing that's still done in C is the floating point
 formatting.
Would be great if a contributor could translate FP parsing and formatting code into D. Then we can use it in CTFE. I need it badly for some function tabulation code. Andrei
Jun 27 2012
next sibling parent "David Nadlinger" <see klickverbot.at> writes:
On Wednesday, 27 June 2012 at 12:15:37 UTC, Andrei Alexandrescu 
wrote:
 On 6/22/12 7:41 AM, Don Clugston wrote:
 I think the main thing that's still done in C is the floating 
 point
 formatting.
Would be great if a contributor could translate FP parsing and formatting code into D. Then we can use it in CTFE. I need it badly for some function tabulation code.
Same here; I need it for a side-feature in Thrift (exporting IDL for existing types at a compile time), where I'm currently just using a horrible hack which rounds slightly wrong. There a quite a few papers about efficient floating point formatting out there, and it should not be hard to convert one of the described algorithms into actual code. I originally planned to do it myself last summer, but never found the time to… David
Jun 27 2012
prev sibling next sibling parent dennis luehring <dl.soluz gmx.net> writes:
Am 27.06.2012 14:15, schrieb Andrei Alexandrescu:
 On 6/22/12 7:41 AM, Don Clugston wrote:
 I think the main thing that's still done in C is the floating point
 formatting.
Would be great if a contributor could translate FP parsing and formatting code into D. Then we can use it in CTFE. I need it badly for some function tabulation code. Andrei
can someone name these functions - or a list of them, are these standard c stuff or specials?
Jun 27 2012
prev sibling parent reply Jens Mueller <jens.k.mueller gmx.de> writes:
Andrei Alexandrescu wrote:
 On 6/22/12 7:41 AM, Don Clugston wrote:
I think the main thing that's still done in C is the floating point
formatting.
Would be great if a contributor could translate FP parsing and formatting code into D. Then we can use it in CTFE. I need it badly for some function tabulation code.
I think formatting cannot be done such that it is CTFE-able. I tried implementing a less-inefficient version. As far as I can tell at some point you need to extract the significand and the exponent. This is done by some "unsafe" cast which is not allowed in CTFE. I don't know a way to do it in CTFE-compatible way. Jens
Jun 28 2012
parent reply Don Clugston <dac nospam.com> writes:
On 28/06/12 15:31, Jens Mueller wrote:
 Andrei Alexandrescu wrote:
 On 6/22/12 7:41 AM, Don Clugston wrote:
 I think the main thing that's still done in C is the floating point
 formatting.
Would be great if a contributor could translate FP parsing and formatting code into D. Then we can use it in CTFE. I need it badly for some function tabulation code.
I think formatting cannot be done such that it is CTFE-able. I tried implementing a less-inefficient version. As far as I can tell at some point you need to extract the significand and the exponent. This is done by some "unsafe" cast which is not allowed in CTFE. I don't know a way to do it in CTFE-compatible way. Jens
Yeah, I think I will have to find a way of allowing it. But it's difficult to see a clean way of doing it.
Jun 28 2012
parent reply Jens Mueller <jens.k.mueller gmx.de> writes:
Don Clugston wrote:
 On 28/06/12 15:31, Jens Mueller wrote:
Andrei Alexandrescu wrote:
On 6/22/12 7:41 AM, Don Clugston wrote:
I think the main thing that's still done in C is the floating point
formatting.
Would be great if a contributor could translate FP parsing and formatting code into D. Then we can use it in CTFE. I need it badly for some function tabulation code.
I think formatting cannot be done such that it is CTFE-able. I tried implementing a less-inefficient version. As far as I can tell at some point you need to extract the significand and the exponent. This is done by some "unsafe" cast which is not allowed in CTFE. I don't know a way to do it in CTFE-compatible way. Jens
Yeah, I think I will have to find a way of allowing it. But it's difficult to see a clean way of doing it.
Good luck! I'm looking forward to your solution. Jens
Jun 28 2012
parent reply "Mehrdad" <wfunction hotmail.com> writes:
On Thursday, 28 June 2012 at 14:02:37 UTC, Jens Mueller wrote:
 Good luck! I'm looking forward to your solution.

 Jens
I think just exposing them via .sig and .exp might be the way to go?
Jun 28 2012
parent reply "Roman D. Boiko" <rb d-coding.com> writes:
On Thursday, 28 June 2012 at 14:04:37 UTC, Mehrdad wrote:
 I think just exposing them via .sig and .exp might be the way 
 to go?
sig is easy to confuse with sign
Jun 28 2012
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 6/28/12 10:07 AM, Roman D. Boiko wrote:
 On Thursday, 28 June 2012 at 14:04:37 UTC, Mehrdad wrote:
 I think just exposing them via .sig and .exp might be the way to go?
sig is easy to confuse with sign
.mantissa and .exp Andrei
Jun 28 2012
next sibling parent Timon Gehr <timon.gehr gmx.ch> writes:
On 06/28/2012 04:35 PM, Andrei Alexandrescu wrote:
 On 6/28/12 10:07 AM, Roman D. Boiko wrote:
 On Thursday, 28 June 2012 at 14:04:37 UTC, Mehrdad wrote:
 I think just exposing them via .sig and .exp might be the way to go?
sig is easy to confuse with sign
.mantissa and .exp Andrei
Imho, it should be either .mantissa and .exponent or .mant and .exp
Jun 28 2012
prev sibling next sibling parent reply Jens Mueller <jens.k.mueller gmx.de> writes:
Andrei Alexandrescu wrote:
 On 6/28/12 10:07 AM, Roman D. Boiko wrote:
On Thursday, 28 June 2012 at 14:04:37 UTC, Mehrdad wrote:
I think just exposing them via .sig and .exp might be the way to go?
sig is easy to confuse with sign
.mantissa and .exp
Letting the compiler define these properties is a solution. I thought Don is looking for something more general. But maybe this isn't needed here. Don't know. But using mantissa should be discouraged. I suggest calling them .significand and .exponent significand is preferred over mantissa by IEEE FP committee. I think it's fine to spell them out. There won't be much code using them anyway. Jens
Jun 28 2012
parent reply Don Clugston <dac nospam.com> writes:
On 28/06/12 17:00, Jens Mueller wrote:
 Andrei Alexandrescu wrote:
 On 6/28/12 10:07 AM, Roman D. Boiko wrote:
 On Thursday, 28 June 2012 at 14:04:37 UTC, Mehrdad wrote:
 I think just exposing them via .sig and .exp might be the way to go?
sig is easy to confuse with sign
.mantissa and .exp
Letting the compiler define these properties is a solution. I thought Don is looking for something more general. But maybe this isn't needed here. Don't know. But using mantissa should be discouraged. I suggest calling them .significand and .exponent significand is preferred over mantissa by IEEE FP committee. I think it's fine to spell them out. There won't be much code using them anyway. Jens
Yes, adding new properties would be the easiest way from a CTFE perspective; that way, they are endian-ness independent. It's a bit niche, but then again adding a special case for this in CTFE is niche as well. Maybe it would be the best approach. With naming, I'm included to agree, but the funny thing is that we have X.mant_dig as the number of digits in the significand. There's an oddity, though: the type of X.significand would be dependent on the type of X (and for the non-existent quadruple float, it would be non-existent ucent type!) Would it include the implicit bit of an 80-bit x87 real (the silly bit)?
Jun 28 2012
next sibling parent "bearophile" <bearophileHUGS lycos.com> writes:
Don Clugston:

 There's an oddity, though: the type of X.significand would be 
 dependent on the type of X (and for the non-existent quadruple 
 float, it would be non-existent ucent type!)
But ucents are in D specs and I think their name is already somewhere in the compiler. While "quadruple" (or "qfloat") is not yet in D specs: http://en.wikipedia.org/wiki/Quadruple_precision Bye, bearophile
Jun 28 2012
prev sibling next sibling parent reply "David Nadlinger" <see klickverbot.at> writes:
On Thursday, 28 June 2012 at 15:28:10 UTC, Don Clugston wrote:
 There's an oddity, though: the type of X.significand would be 
 dependent on the type of X […]
I don't think this is a problem at all – for example, the type of T.init depends on T as well… David
Jun 28 2012
parent Don Clugston <dac nospam.com> writes:
On 28/06/12 18:37, David Nadlinger wrote:
 On Thursday, 28 June 2012 at 15:28:10 UTC, Don Clugston wrote:
 There's an oddity, though: the type of X.significand would be
 dependent on the type of X […]
I don't think this is a problem at all – for example, the type of T.init depends on T as well… David
Good point.
Jul 02 2012
prev sibling parent reply Jens Mueller <jens.k.mueller gmx.de> writes:
Don Clugston wrote:
 On 28/06/12 17:00, Jens Mueller wrote:
Andrei Alexandrescu wrote:
On 6/28/12 10:07 AM, Roman D. Boiko wrote:
On Thursday, 28 June 2012 at 14:04:37 UTC, Mehrdad wrote:
I think just exposing them via .sig and .exp might be the way to go?
sig is easy to confuse with sign
.mantissa and .exp
Letting the compiler define these properties is a solution. I thought Don is looking for something more general. But maybe this isn't needed here. Don't know. But using mantissa should be discouraged. I suggest calling them .significand and .exponent significand is preferred over mantissa by IEEE FP committee. I think it's fine to spell them out. There won't be much code using them anyway. Jens
Yes, adding new properties would be the easiest way from a CTFE perspective; that way, they are endian-ness independent. It's a bit niche, but then again adding a special case for this in CTFE is niche as well. Maybe it would be the best approach.
Sounds good then.
 With naming, I'm included to agree, but the funny thing is that we
 have X.mant_dig as the number of digits in the significand.
You could add a deprecated alias to X.mant_dig and provide a new name. We should adopt IEEE's vocabulary where possible.
 There's an oddity, though: the type of X.significand would be
 dependent on the type of X (and for the non-existent quadruple
 float, it would be non-existent ucent type!)
But this is no problem, is it?
 Would it include the implicit bit of an 80-bit x87 real (the silly bit)?
Not sure what the silly bit is. You mean the bit that is implicitly always 1, don't you? mant_dig says 24 for a float. Means it is included when counting the bits. Then for consistency it should be included. Jens
Jun 28 2012
parent Don Clugston <dac nospam.com> writes:
On 28/06/12 18:36, Jens Mueller wrote:
 Don Clugston wrote:
 On 28/06/12 17:00, Jens Mueller wrote:
 Andrei Alexandrescu wrote:
 On 6/28/12 10:07 AM, Roman D. Boiko wrote:
 On Thursday, 28 June 2012 at 14:04:37 UTC, Mehrdad wrote:
 I think just exposing them via .sig and .exp might be the way to go?
sig is easy to confuse with sign
.mantissa and .exp
Letting the compiler define these properties is a solution. I thought Don is looking for something more general. But maybe this isn't needed here. Don't know. But using mantissa should be discouraged. I suggest calling them .significand and .exponent significand is preferred over mantissa by IEEE FP committee. I think it's fine to spell them out. There won't be much code using them anyway. Jens
Yes, adding new properties would be the easiest way from a CTFE perspective; that way, they are endian-ness independent. It's a bit niche, but then again adding a special case for this in CTFE is niche as well. Maybe it would be the best approach.
Sounds good then.
 With naming, I'm included to agree, but the funny thing is that we
 have X.mant_dig as the number of digits in the significand.
You could add a deprecated alias to X.mant_dig and provide a new name. We should adopt IEEE's vocabulary where possible.
 There's an oddity, though: the type of X.significand would be
 dependent on the type of X (and for the non-existent quadruple
 float, it would be non-existent ucent type!)
But this is no problem, is it?
 Would it include the implicit bit of an 80-bit x87 real (the silly bit)?
Not sure what the silly bit is. You mean the bit that is implicitly always 1, don't you? mant_dig says 24 for a float. Means it is included when counting the bits. Then for consistency it should be included.
Yes, the implicit bit. For float and double it isn't present, but it's there for 80bit x87 and 68K reals. But it would not be present for quadruple types. I'm not sure if it's always present on Itanium 80-bit reals. It's included in the 80-bit reals only for historical reasons -- it seemed like a good idea at the time. It allowed an optimisation for a long-obsolete algorithm.
Jul 02 2012
prev sibling parent reply "David Nadlinger" <see klickverbot.at> writes:
On Thursday, 28 June 2012 at 14:35:24 UTC, Andrei Alexandrescu 
wrote:
 On 6/28/12 10:07 AM, Roman D. Boiko wrote:
 On Thursday, 28 June 2012 at 14:04:37 UTC, Mehrdad wrote:
 I think just exposing them via .sig and .exp might be the way 
 to go?
sig is easy to confuse with sign
.mantissa and .exp
.exp might potentially lead to confusion regarding std.math.exp with UFCS in place. Not that this would be a huge deal, but since new property would be used only very rarely anyway, I don't think going for a longer name like .exponent or even rawExponent/exponentBits/… would be a problem. David
Jun 28 2012
next sibling parent "Paul D. Anderson" <paul.d.removethis.anderson comcast.andthis.net> writes:
On Thursday, 28 June 2012 at 16:50:59 UTC, David Nadlinger wrote:
 On Thursday, 28 June 2012 at 14:35:24 UTC, Andrei Alexandrescu 
 wrote:
 On 6/28/12 10:07 AM, Roman D. Boiko wrote:
 On Thursday, 28 June 2012 at 14:04:37 UTC, Mehrdad wrote:
 I think just exposing them via .sig and .exp might be the 
 way to go?
sig is easy to confuse with sign
.mantissa and .exp
.exp might potentially lead to confusion regarding std.math.exp with UFCS in place. Not that this would be a huge deal, but since new property would be used only very rarely anyway, I don't think going for a longer name like .exponent or even rawExponent/exponentBits/… would be a problem. David
In my BigDecimal/BigFloat modules I use .coefficient and .exponent externally but .mant and .expo internally. It would be nice to be consistent -- I can adapt to whatever is best. Paul
Jun 29 2012
prev sibling parent "Paul D. Anderson" <paul.d.removethis.anderson comcast.andthis.net> writes:
On Thursday, 28 June 2012 at 16:50:59 UTC, David Nadlinger wrote:
 On Thursday, 28 June 2012 at 14:35:24 UTC, Andrei Alexandrescu 
 wrote:
 On 6/28/12 10:07 AM, Roman D. Boiko wrote:
 On Thursday, 28 June 2012 at 14:04:37 UTC, Mehrdad wrote:
 I think just exposing them via .sig and .exp might be the 
 way to go?
sig is easy to confuse with sign
.mantissa and .exp
.exp might potentially lead to confusion regarding std.math.exp with UFCS in place. Not that this would be a huge deal, but since new property would be used only very rarely anyway, I don't think going for a longer name like .exponent or even rawExponent/exponentBits/… would be a problem. David
How about .mant and .expo? That's what I'm using in the BigDecimal/BigFloat modules as private names. The property names are .coefficient and .exponent.
Jun 29 2012
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 6/21/2012 11:49 PM, Mehrdad wrote:
 On Friday, 22 June 2012 at 06:35:41 UTC, Walter Bright wrote:
 On 6/21/2012 11:07 PM, Mehrdad wrote:
 Good luck getting the C-runtime part of the "D runtime" right..
It's not that hard. But there's a lot of detail to learn & take care of.
Where do you find the "detail"?
One way is to get the library source code for the C compiler and study it.
Jun 22 2012
parent reply "Mehrdad" <wfunction hotmail.com> writes:
On Friday, 22 June 2012 at 09:50:54 UTC, Walter Bright wrote:
 On 6/21/2012 11:49 PM, Mehrdad wrote:
 On Friday, 22 June 2012 at 06:35:41 UTC, Walter Bright wrote:
 On 6/21/2012 11:07 PM, Mehrdad wrote:
 Good luck getting the C-runtime part of the "D runtime" 
 right..
It's not that hard. But there's a lot of detail to learn & take care of.
Where do you find the "detail"?
One way is to get the library source code for the C compiler and study it.
By "get" you mean "buy", right? I find that to be against D's (supposedly) open-source nature...
Jun 22 2012
next sibling parent "Paulo Pinto" <pjmlp progtools.org> writes:
On Friday, 22 June 2012 at 14:11:59 UTC, Mehrdad wrote:
 On Friday, 22 June 2012 at 09:50:54 UTC, Walter Bright wrote:
 On 6/21/2012 11:49 PM, Mehrdad wrote:
 On Friday, 22 June 2012 at 06:35:41 UTC, Walter Bright wrote:
 On 6/21/2012 11:07 PM, Mehrdad wrote:
 Good luck getting the C-runtime part of the "D runtime" 
 right..
It's not that hard. But there's a lot of detail to learn & take care of.
Where do you find the "detail"?
One way is to get the library source code for the C compiler and study it.
By "get" you mean "buy", right? I find that to be against D's (supposedly) open-source nature...
Well Walter can also decide to invest his time somewhere else, he needs to pay his bills...
Jun 22 2012
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 6/22/2012 7:11 AM, Mehrdad wrote:
 One way is to get the library source code for the C compiler and study it.
By "get" you mean "buy", right?
For Digital Mars C, yes you can buy it. For gcc, you can look at the C library source code for free. I'm sure the latter does the same things.
 I find that to be against D's (supposedly) open-source nature...
D is open source, however, that isn't necessarily true of C. For example, the Win64 version of dmd will be designed to work with Microsoft VS, which will cost $500.
Jun 22 2012
next sibling parent reply "Roman D. Boiko" <rb d-coding.com> writes:
On Friday, 22 June 2012 at 17:23:38 UTC, Walter Bright wrote:
 D is open source, however, that isn't necessarily true of C. 
 For example, the Win64 version of dmd will be designed to work 
 with Microsoft VS, which will cost $500.
Sorry, Walter, I didn't understand this statement. Did you mean VS will cost $500? Did you mean Win64 version of dmc (not dmd)? If no, than how will dmd be designed to work with VS?
Jun 22 2012
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 6/22/2012 10:28 AM, Roman D. Boiko wrote:
 Did you mean VS will cost $500?
Yes (or whatever price MS sets it at).
 Did you mean Win64 version of dmc (not dmd)?
No. I meant dmd for Win64.
 If no, than how will dmd be designed to work with VS?
By emitting code that will link with VS code & libraries.
Jun 22 2012
next sibling parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 22-Jun-12 22:47, Walter Bright wrote:
 On 6/22/2012 10:28 AM, Roman D. Boiko wrote:
 Did you mean VS will cost $500?
Yes (or whatever price MS sets it at).
I believe SDK with compiler is a free download though I might be off on this.
 Did you mean Win64 version of dmc (not dmd)?
No. I meant dmd for Win64.
 If no, than how will dmd be designed to work with VS?
By emitting code that will link with VS code & libraries.
Great. -- Dmitry Olshansky
Jun 22 2012
next sibling parent reply "David Nadlinger" <see klickverbot.at> writes:
On Friday, 22 June 2012 at 18:56:48 UTC, Dmitry Olshansky wrote:
 I believe SDK with compiler is a free download though I might 
 be off on this.
Also, there are Express editions of Visual Studio which are currently, and will be at least for the next release, free for download. Originally, Microsoft wanted to include only the SDK for »Metro-style« apps with VC++ 2012 Express, but after this caused massively negative reactions in the developer/internet/open-source/… community, a native code edition was announced as well. David
Jun 22 2012
next sibling parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 22-Jun-12 23:23, David Nadlinger wrote:
 Originally, Microsoft wanted to include only the SDK for »Metro-style«
 apps with VC++ 2012 Express, but after this caused massively negative
 reactions in the developer/internet/open-source/… community, a native
 code edition was announced as well.

 David
Yay! P.S. Sorry can't resist ;) -- Dmitry Olshansky
Jun 22 2012
prev sibling parent reply "Paulo Pinto" <pjmlp progtools.org> writes:
On Friday, 22 June 2012 at 19:23:10 UTC, David Nadlinger wrote:
 On Friday, 22 June 2012 at 18:56:48 UTC, Dmitry Olshansky wrote:
 I believe SDK with compiler is a free download though I might 
 be off on this.
Also, there are Express editions of Visual Studio which are currently, and will be at least for the next release, free for download. Originally, Microsoft wanted to include only the SDK for »Metro-style« apps with VC++ 2012 Express, but after this caused massively negative reactions in the developer/internet/open-source/… community, a native code edition was announced as well. David
I guess you wanted to say "desktop" instead of "native code", as Metro is also native code.
Jun 22 2012
next sibling parent "David Nadlinger" <see klickverbot.at> writes:
On Friday, 22 June 2012 at 22:46:28 UTC, Paulo Pinto wrote:
 I guess you wanted to say "desktop" instead of "native code",
 as Metro is also native code.
Yes, of course, that's what I meant.
Jun 22 2012
prev sibling parent reply "bearophile" <bearophileHUGS lycos.com> writes:
Paulo Pinto:

 as Metro is also native code.
Are you sure? Do you have a reference on this? Bye, bearophile
Jun 28 2012
parent reply "Paulo Pinto" <pjmlp progtools.org> writes:
On Thursday, 28 June 2012 at 13:39:54 UTC, bearophile wrote:
 Paulo Pinto:

 as Metro is also native code.
Are you sure? Do you have a reference on this? Bye, bearophile
The huge amount of documentation made available at BUILD time, plus Windows 8 to play with? WinRT (aka Metro) is COM based. Instead of me dumping a list of links, what you want to know exactly? -- Paulo
Jun 28 2012
parent "bearophile" <bearophileHUGS lycos.com> writes:
Paulo Pinto:

 The huge amount of documentation made available at BUILD time, 
 plus Windows 8 to play with?

 WinRT (aka Metro) is COM based.

 Instead of me dumping a list of links, what you want to know 
 exactly?
OK. No need for a list. Bye, bearophile
Jun 28 2012
prev sibling parent "Roman D. Boiko" <rb d-coding.com> writes:
On Friday, 22 June 2012 at 18:56:48 UTC, Dmitry Olshansky wrote:
 On 22-Jun-12 22:47, Walter Bright wrote:
 On 6/22/2012 10:28 AM, Roman D. Boiko wrote:
 Did you mean VS will cost $500?
Yes (or whatever price MS sets it at).
I believe SDK with compiler is a free download though I might be off on this.
Correct. VS SDK is free, the same is true for Windows SDK. Also there are VS express and VS shell, which are also free. But I'm sure that Visual Studio itself is not a dependency and there is nothing to link to in it, only in SDKs.
Jun 22 2012
prev sibling next sibling parent Sean Kelly <sean invisibleduck.org> writes:
On Jun 22, 2012, at 11:47 AM, Walter Bright wrote:

 On 6/22/2012 10:28 AM, Roman D. Boiko wrote:
 Did you mean VS will cost $500?
Yes (or whatever price MS sets it at).
I think there's a free version of VS.
Jun 22 2012
prev sibling parent Brad Anderson <eco gnuk.net> writes:
On Fri, Jun 22, 2012 at 1:19 PM, Sean Kelly <sean invisibleduck.org> wrote:

 On Jun 22, 2012, at 11:47 AM, Walter Bright wrote:

 On 6/22/2012 10:28 AM, Roman D. Boiko wrote:
 Did you mean VS will cost $500?
Yes (or whatever price MS sets it at).
I think there's a free version of VS.
Yes, Visual Studio Express. They had announced that Visual Studio Express 2012 wouldn't support native applications (only target Window 8's WinRT) but they have since reversed that decision. Unless there is some other obstacle that gets in the way Win64 DMD users should be able to get everything they need for free. Regards, Brad Anderson
Jun 22 2012
prev sibling parent reply mta`chrono <chrono mta-international.net> writes:
Am 22.06.2012 19:23, schrieb Walter Bright:
 On 6/22/2012 7:11 AM, Mehrdad wrote:
 One way is to get the library source code for the C compiler and
 study it.
By "get" you mean "buy", right?
For Digital Mars C, yes you can buy it. For gcc, you can look at the C library source code for free. I'm sure the latter does the same things.
 I find that to be against D's (supposedly) open-source nature...
D is open source, however, that isn't necessarily true of C. For example, the Win64 version of dmd will be designed to work with Microsoft VS, which will cost $500.
I'm afright. Please explain what is meant by this, Walter.
Jun 22 2012
parent reply "Roman D. Boiko" <rb d-coding.com> writes:
On Friday, 22 June 2012 at 18:26:22 UTC, mta`chrono wrote:
 Am 22.06.2012 19:23, schrieb Walter Bright:
 D is open source, however, that isn't necessarily true of C. 
 For example, the Win64 version of dmd will be designed to work 
 with
 Microsoft VS, which will cost $500.
I'm afright. Please explain what is meant by this, Walter.
I also asked for clarification a few posts before. Most likely Walter meant that DMC (not DMD) for Win64 will work with Visual Studio, which is not free. Also DMC is not free, but it costs way below $500.
Jun 22 2012
parent dennis luehring <dl.soluz gmx.net> writes:
Am 22.06.2012 20:30, schrieb Roman D. Boiko:
 On Friday, 22 June 2012 at 18:26:22 UTC, mta`chrono wrote:
 Am 22.06.2012 19:23, schrieb Walter Bright:
 D is open source, however, that isn't necessarily true of C.
 For example, the Win64 version of dmd will be designed to work
 with
 Microsoft VS, which will cost $500.
I'm afright. Please explain what is meant by this, Walter.
I also asked for clarification a few posts before. Most likely Walter meant that DMC (not DMD) for Win64 will work with Visual Studio, which is not free. Also DMC is not free, but it costs way below $500.
no - dmd64 will work with VS
Jun 22 2012
prev sibling next sibling parent Iain Buclaw <ibuclaw ubuntu.com> writes:
On 22 June 2012 07:35, Walter Bright <newshound2 digitalmars.com> wrote:
 On 6/21/2012 11:07 PM, Mehrdad wrote:
 On Thursday, 21 June 2012 at 19:44:40 UTC, Walter Bright wrote:
 On 6/21/2012 9:39 AM, Alex wrote:
 is it possible to use D to write code to work without OS?
 like i do it with gcc.
Sure. But you'll need to thoroughly understand how the D runtime startup code works, so you can adjust as necessary.
Good luck getting the C-runtime part of the "D runtime" right..
It's not that hard. But there's a lot of detail to learn & take care of.
Wouldn't it be useful if the compiler had diagnostics for all implicit allocations it makes (ie: closures, array literals)? Similar to that of the -vtls switch. These such things you may want to avoid in a freestanding environment (no link to C runtime). -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';
Jun 28 2012
prev sibling next sibling parent Sean Kelly <sean invisibleduck.org> writes:
On Jun 28, 2012, at 9:45 AM, Iain Buclaw wrote:
=20
 Wouldn't it be useful if the compiler had diagnostics for all implicit
 allocations it makes (ie: closures, array literals)?  Similar to that
 of the -vtls switch. These such things you may want to avoid in a
 freestanding environment (no link to C runtime).
Yes it would. I guess the question is how to expose this. Generally = speaking though, array append type operations allocate, AA insertions = allocate, and non-scope delegate use allocates. I think that's it.=
Jun 28 2012
prev sibling parent reply Iain Buclaw <ibuclaw ubuntu.com> writes:
On 28 June 2012 18:02, Sean Kelly <sean invisibleduck.org> wrote:
 On Jun 28, 2012, at 9:45 AM, Iain Buclaw wrote:
 Wouldn't it be useful if the compiler had diagnostics for all implicit
 allocations it makes (ie: closures, array literals)? =A0Similar to that
 of the -vtls switch. These such things you may want to avoid in a
 freestanding environment (no link to C runtime).
Yes it would. =A0I guess the question is how to expose this. =A0Generally=
speaking though, array append type operations allocate, AA insertions allo= cate, and non-scope delegate use allocates. =A0I think that's it.
From a user perspective?  A switch that has a less ugly than
-vimplicit_library_calls. Which spurts out messages like: "Function %s builds a closure", func or "Expression %s makes implicit allocation call to %s", expr, func --=20 Iain Buclaw *(p < e ? p++ : p) =3D (c & 0x0f) + '0';
Jun 29 2012
parent "bearophile" <bearophileHUGS lycos.com> writes:
Iain Buclaw:

From a user perspective?  A switch that has a less ugly than
-vimplicit_library_calls. Which spurts out messages like: "Function %s builds a closure", func
http://d.puremagic.com/issues/show_bug.cgi?id=5070 Bye, bearophile
Jun 29 2012
prev sibling parent "Paulo Pinto" <pjmlp progtools.org> writes:
On Friday, 22 June 2012 at 06:07:59 UTC, Mehrdad wrote:
 On Thursday, 21 June 2012 at 19:44:40 UTC, Walter Bright wrote:
 On 6/21/2012 9:39 AM, Alex wrote:
 is it possible to use D to write code to work without OS?
 like i do it with gcc.
Sure. But you'll need to thoroughly understand how the D runtime startup code works, so you can adjust as necessary.
Good luck getting the C-runtime part of the "D runtime" right..
I don't really know the runtime code of the generated binary code, but this is no different than other high level languages used for OS development, like Modula-3 or Oberon. The C runtime just needs to be replaced by an Assembly runtime that provides the ground work for the language runtime at the OS level. The way this is done on Oberon's case is well documented. After all the reason why C has so tiny runtime, is that in C the OS is the language runtime.
Jun 22 2012
prev sibling parent reply "AlexPhoenix" <phoenixcorp13 gmail.com> writes:
On Thursday, 21 June 2012 at 16:39:07 UTC, Alex wrote:
 is it possible to use D to write code to work without OS?
 like i do it with gcc.
by the way, with which args i must run D to generate raw binary?
Feb 11 2014
parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
On Tuesday, 11 February 2014 at 11:53:48 UTC, AlexPhoenix wrote:
 by the way, with which args i must run D to generate raw binary?
This is more of a linker question than a compiler one... check out the makefile.bare in here http://arsdnet.net/dcode/minimal.zip It makes a raw binary that can be loaded by GRUB
Feb 11 2014
parent "AlexPhoenix" <phoenixcorp13 gmail.com> writes:
On Tuesday, 11 February 2014 at 18:09:56 UTC, Adam D. Ruppe wrote:
 On Tuesday, 11 February 2014 at 11:53:48 UTC, AlexPhoenix wrote:
 by the way, with which args i must run D to generate raw 
 binary?
This is more of a linker question than a compiler one... check out the makefile.bare in here http://arsdnet.net/dcode/minimal.zip It makes a raw binary that can be loaded by GRUB
I found trouble. I trying to do the same with: dmd -m32 -debug -c ITextScreen.d -gc -defaultlib= -debuglib= -version=bare_metal -debug=allocations and the then i trying to link with ld(also try with objcopy and gcc) from MinGW, and have ITextScreen.obj: file not recognized: File format not recognized what i do wrong?
Feb 13 2014