September 16, 2004
>I'm a beginner to C and C++. Yesterday i search over internet and found D is easiest to learn

Yes D is a very good language.
If you have any questions, feel free to contact me, if you want.  Send an email
to  arvutilaat at arvutilaat.net  (where "at" if @ ofcourse) I have many junk
mails coming to that mail address, so the subject line should be something like
"D question", so I can recognise it.
If you are a beginner to D, or to the programming I can help you. I have worked
with D since this spring and have been programming C over 8 years and C++ over 4
or 5 years. And I am ready to answer some newbie questions.

Ofcourse you can send questions to this forum. Here are many experts, who can help you, including Walter, the man who makes the D language and the dmd compiler.


>1. D can only run on Windows Console, i can not run it in pure DOS
>Console. This is is something
>very important since C and C++ can do that. How can i run it on embedded
>system if it should require
>windows ?

Yes D works only in windows and linux for now. Maybe in the future more OS will be supported.


>2. The executable file size is so big, test using "Hello World" program
>around 97 kb and in linux it's bigger. Is that because D runs in
>win32 console mode ? Even i use exe compressor, the size doesn't cut for
>the half of the original
>size instead.

That is because D likes to compile everything it can into it's exe (or ELF-linux) file, so no one should have problems running these files. For example if you make a program in Visul C, then by default it makes a smaller file, but it requires many dll-s. I have downloaded some programs from the internet and then spent hours searching the required dll files.

So D files are bigger, but you should have less problems running them on other computers.

Greetings,
Martin.

In article <opseeytqz4ukcpn4@telkomnetinstan>, BUDI ARIEF GUSANDI says...
>
>Dear all,
>
>I'm a beginner to C and C++. Yesterday i search over internet and found D
>is easiest to learn than
>the predeccessors and very comfortable for me. But several question makes
>me a little doubt, please
>help.
>
>1. D can only run on Windows Console, i can not run it in pure DOS
>Console. This is is something
>very important since C and C++ can do that. How can i run it on embedded
>system if it should require
>windows ?
>2. The executable file size is so big, test using "Hello World" program
>around 97 kb and in linux it's bigger. Is that because D runs in
>win32 console mode ? Even i use exe compressor, the size doesn't cut for
>the half of the original
>size instead.
>
>Thank you. Keep up good working
>
>Regards,
>
>Budi


September 16, 2004
> std.asserterror => std.error.assert
> std.outofmemory => std.error.outofmemory
> std.switcherr   => std.error.switch
> std.syserror    => std.error.system

std.error.assert and std.error.switch wohn't work as module names, presumably because they contain identifiers that are keywords. std.error.asserterror and std.error.switcherror should work though.


September 16, 2004
On Thu, 16 Sep 2004 10:22:05 +0000 (UTC), Martin
<Martin_member@pathlink.com> wrote:
>
>
>>1. D can only run on Windows Console, i can not run it in pure DOS
>>Console. This is is something
>>very important since C and C++ can do that. How can i run it on embedded
>>system if it should require
>>windows ?
>
>Yes D works only in windows and linux for now. Maybe in the future more OS will be supported.
>

Besides the OS support which hopefully will grow, isn't it true that D is being designed a language that can produce compiled code that doesn't depend on any OS, allowing, for example, to write a bootable program? I think that is what the original question was about.


September 16, 2004
In article <ciamqg$1t4j$1@digitaldaemon.com>, h3r3tic says...
>
>Ummm... would've forgotten. Fixing typeinfos is crucial for D 1.0

I'll second that.  Especially having full class reflection (methods, members, ctors, etc) as a part of typeinfo would be most appreciated.

- Pragma


September 16, 2004
BUDI ARIEF GUSANDI wrote:
<snip>
> 1. D can only run on Windows Console, i can not run it in pure DOS  Console.

Yes, because MS-DOS is a 16-bit system.  D needs at least a 32-bit system, by design.

> This is is something very important since C and C++ can do that.

Walter didn't consider it worth putting in features to support legacy OSs.

http://www.digitalmars.com/d/overview.html

Features To Drop
...
Support for 16 bit computers. No consideration is given in D for mixed near/far pointers and all the machinations necessary to generate good 16 bit code. The D language design assumes at least a 32 bit flat memory space. D will fit smoothly into 64 bit architectures.

> How can i run it on embedded system if it should require windows ?
<snip>

Not sure what you mean by that....

Stewart.

-- 
My e-mail is valid but not my primary mailbox.  Please keep replies on the 'group where everyone may benefit.
September 16, 2004
In article <41493850.9E050BE9@hls.via.at>, Helmut Leitner says...
>
>> 2) Reorganize a little bit:
>>      std.asserterror => std.error.asserterr
>
>                    maybe std.error.assert ?
>
>>      std.outofmemory => std.error.outofmemory
>>      std.switcherr   => std.error.switcherr
>
>                    maybe std.error.switch ?
>
>>      std.syserror    => std.error.syserr
>
>                    maybe std.error.sys ?

I don't think the assert or switch will work as module names since they're keywords, but "sys" should work and that's a good substitution as far as I'm concerned.

>-- 
>Helmut Leitner    leitner@hls.via.at
>Graz, Austria   www.hls-software.com

jcc7
September 17, 2004
In article <cibpgd$2efk$1@digitaldaemon.com>, Martin says...

>>2. The executable file size is so big, test using "Hello World" program
>>around 97 kb and in linux it's bigger. Is that because D runs in
>>win32 console mode ? Even i use exe compressor, the size doesn't cut for
>>the half of the original
>>size instead.
>
>That is because D likes to compile everything it can into it's exe (or ELF-linux) file, so no one should have problems running these files. For example if you make a program in Visul C, then by default it makes a smaller file, but it requires many dll-s. I have downloaded some programs from the internet and then spent hours searching the required dll files.
>
>So D files are bigger, but you should have less problems running them on other computers.

If you use the DigitalMars C compiler (i.e. you write a console Hello World program in plain C) you get "only" 39 KB. I never experienced any dependency on any DLL, though, not even MSVCRT.DLL or CRTDLL.DLL. Strangely, D *does* use the C module for printf, doesn't it? Then why don't they have the same size?

Regards,
Jens


September 17, 2004
Jens wrote:

> In article <cibpgd$2efk$1@digitaldaemon.com>, Martin says...
> 
> 
>>>2. The executable file size is so big, test using "Hello World" program  around 97 kb and in linux it's bigger. Is that because D runs in
>>>win32 console mode ? Even i use exe compressor, the size doesn't cut for  the half of the original
>>>size instead.
>>
>>That is because D likes to compile everything it can into it's exe (or
>>ELF-linux) file, so no one should have problems running these files. For example
>>if you make a program in Visul C, then by default it makes a smaller file, but
>>it requires many dll-s. I have downloaded some programs from the internet and
>>then spent hours searching the required dll files.
>>
>>So D files are bigger, but you should have less problems running them on other
>>computers.
> 
> 
> If you use the DigitalMars C compiler (i.e. you write a console Hello World
> program in plain C) you get "only" 39 KB. I never experienced any
> dependency on any DLL, though, not even MSVCRT.DLL or CRTDLL.DLL.
> Strangely, D *does* use the C module for printf, doesn't it? Then why don't
> they have the same size?
> 
> Regards,
> Jens
> 
> 

D automatically links phobos.lib.  That's the cause for the extra bloat.

But to be completely serious, what the hell kind of difference is 58kb going to make on todays machines?  The only instance I can think of is if you were developing for a PDA, and even then a 100kb executable doesn't seem excessively bloated.

-Deja
September 17, 2004
On Fri, 17 Sep 2004 00:26:01 +0000 (UTC), Jens <Jens_member@pathlink.com> wrote:

> In article <cibpgd$2efk$1@digitaldaemon.com>, Martin says...
>
>>> 2. The executable file size is so big, test using "Hello World" program
>>> around 97 kb and in linux it's bigger. Is that because D runs in
>>> win32 console mode ? Even i use exe compressor, the size doesn't cut for
>>> the half of the original
>>> size instead.
>>
>> That is because D likes to compile everything it can into it's exe (or
>> ELF-linux) file, so no one should have problems running these files. For example
>> if you make a program in Visul C, then by default it makes a smaller file, but
>> it requires many dll-s. I have downloaded some programs from the internet and
>> then spent hours searching the required dll files.
>>
>> So D files are bigger, but you should have less problems running them on other
>> computers.
>
> If you use the DigitalMars C compiler (i.e. you write a console Hello World
> program in plain C) you get "only" 39 KB. I never experienced any
> dependency on any DLL, though, not even MSVCRT.DLL or CRTDLL.DLL.
> Strangely, D *does* use the C module for printf, doesn't it? Then why don't
> they have the same size?

The difference in size IIRC is due to the garbage collector, in a D application the garbage collecting code is built into the executable.

This extra size is a one off cost, I've heard it said that a larger application written in D will actually be smaller than the equivalent one in C.

It is intended, but not yet possible (I believe) to completely disable the garbage collector, meaning that you can write a D application without one, this is what you'd do to write an embedded program that has size constraints.

Ideally the GC would be part of the Operating System, if that were the case it would not be built into the application, could be more efficient, and would solve the problems that arise using a GC with DLL's etc.

Regan

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
September 17, 2004
>> How can i run it on embedded system if it should require windows ?
> <snip>
>
> Not sure what you mean by that....
>
Embedded here means that i want to put the application created with D into Flash ROM in Single Board Computer (SBC) or embedded computer, which of course has minimal size and memory to run, and most of SBC using 386 processor, which definitely using DOS 16 Bit for OS, unless we create our own OS or using linux embedded but will need some extra cost for additional memory and flash disk...

Thanks Anyway ;)

Budi