www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - newbie - hey walter, improvement potentials for installer

reply "Alf P. Steinbach" <alf.p.steinbach+usenet gmail.com> writes:
Hi

I just installed D 2.x.


    * Improvement potential #1  --  installer description.

It was not clear to me that the first download is a full offline 
installer. In ignorance I used the one that downloads from web. The web 
page can possibly be mucho improved! :-)


    * Improvement potential #2  --  Start menu link to help file.

It didn't work. Sorry I didn't check where it pointed, but it started 
searching for some [index.html]. I found that file by manual searching, 
plugged it in manual in the search that the link brought up, and all's 
well that ends well, but this is DEFINITELY an improvement opportunity!


    * Improvement potential #3  --  Linker executable name.

The name [link.exe] conflicts with Microsoft's linker. Please name it 
[optlink.exe]. I just renamed it and fixed the options file, but this is 
not just an improvement opportunity, it's more on the MUST end of the 
scale: it is very impractical to have such a needless name clash.


    * Improvement potential #4  --  Standard options for tools.

Why have "-quiet" for the compiler and "-nologo" for the linker? 
Standardizing options across the toolset is a very nice improvement 
opportunity. Also, it would be nice if the linker refrained from 
reporting all about itself when it encounters an error.


   * Improvement potential #5  --  The description of Windows prog.

Following main site's links to 
[http://d-programming-language.org/windows.html], I found a real 
monstrosity as an example of purportedly simplest possible Windows GUI 
program. It's almost funny. Here is mine:

<code>
     import std.c.windows.windows;

     void main()
     {
         MessageBoxW( null, "Text", "Caption", MB_OK | MB_ICONINFORMATION );
     }
</code>


And here is how I built it:


<example>
[d:\dev\test\d]
 dmd minimal_gui.d -L-subsystem:windows

[d:\dev\test\d]
 dumpbin /headers minimal_gui.exe | find /i "sub"

2 subsystem (Windows GUI) [d:\dev\test\d]
 minimal.d

Maybe with DMD tools something potentially bad happens here. However, with extant C++ compilers (and even old Borland C++ 5.5) this way of doing things works splendidly. So here is a definite improvement potential for the web site page with the monstrous code, and if the current tools don't handle it well, also for the the toolset. :-) Cheers & hth., - Alf (at very beginning of checking out the D language)
Feb 12 2012
next sibling parent Brad Anderson <eco gnuk.net> writes:
--f46d042c6b73403b3704b8cef2a8
Content-Type: text/plain; charset=ISO-8859-1

On Sun, Feb 12, 2012 at 5:02 PM, Alf P. Steinbach <
alf.p.steinbach+usenet gmail.com> wrote:

 Hi

 I just installed D 2.x.


   * Improvement potential #1  --  installer description.

 It was not clear to me that the first download is a full offline
 installer. In ignorance I used the one that downloads from web. The web
 page can possibly be mucho improved! :-)


   * Improvement potential #2  --  Start menu link to help file.

 It didn't work. Sorry I didn't check where it pointed, but it started
 searching for some [index.html]. I found that file by manual searching,
 plugged it in manual in the search that the link brought up, and all's well
 that ends well, but this is DEFINITELY an improvement opportunity!

   * Improvement potential #3  --  Linker executable name.

 The name [link.exe] conflicts with Microsoft's linker. Please name it
 [optlink.exe]. I just renamed it and fixed the options file, but this is
 not just an improvement opportunity, it's more on the MUST end of the
 scale: it is very impractical to have such a needless name clash.


   * Improvement potential #4  --  Standard options for tools.

 Why have "-quiet" for the compiler and "-nologo" for the linker?
 Standardizing options across the toolset is a very nice improvement
 opportunity. Also, it would be nice if the linker refrained from reporting
 all about itself when it encounters an error.


  * Improvement potential #5  --  The description of Windows prog.

 Following main site's links to [http://d-programming-**
 language.org/windows.html <http://d-programming-language.org/windows.html>],
 I found a real monstrosity as an example of purportedly simplest possible
 Windows GUI program. It's almost funny. Here is mine:

 <code>
    import std.c.windows.windows;

    void main()
    {
        MessageBoxW( null, "Text", "Caption", MB_OK | MB_ICONINFORMATION );
    }
 </code>


 And here is how I built it:


 <example>
 [d:\dev\test\d]
 dmd minimal_gui.d -L-subsystem:windows

[d:\dev\test\d]
 dumpbin /headers minimal_gui.exe | find /i "sub"

2 subsystem (Windows GUI) [d:\dev\test\d]
 minimal.d

Maybe with DMD tools something potentially bad happens here. However, with extant C++ compilers (and even old Borland C++ 5.5) this way of doing things works splendidly. So here is a definite improvement potential for the web site page with the monstrous code, and if the current tools don't handle it well, also for the the toolset. :-) Cheers & hth., - Alf (at very beginning of checking out the D language)

Regards, Brad Anderson --f46d042c6b73403b3704b8cef2a8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sun, Feb 12, 2012 at 5:02 PM, Alf P. Steinbach <span dir=3D"ltr">&lt;<a = href=3D"mailto:alf.p.steinbach%2Busenet gmail.com">alf.p.steinbach+usenet g= mail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_quote"><blockquote cl= ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;p= adding-left:1ex"> Hi<br> <br> I just installed D 2.x.<br> <br> <br> =A0 * Improvement potential #1 =A0-- =A0installer description.<br> <br> It was not clear to me that the first download is a full offline installer.= In ignorance I used the one that downloads from web. The web page can poss= ibly be mucho improved! :-)<br> <br> <br> =A0 * Improvement potential #2 =A0-- =A0Start menu link to help file.<br> <br> It didn&#39;t work. Sorry I didn&#39;t check where it pointed, but it start= ed searching for some [index.html]. I found that file by manual searching, = plugged it in manual in the search that the link brought up, and all&#39;s = well that ends well, but this is DEFINITELY an improvement opportunity!<br> <br></blockquote><div><br></div><div>I&#39;ll look into this one and make a= pull request.</div><div>=A0</div><blockquote class=3D"gmail_quote" style= =3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br> =A0 * Improvement potential #3 =A0-- =A0Linker executable name.<br> <br> The name [link.exe] conflicts with Microsoft&#39;s linker. Please name it [= optlink.exe]. I just renamed it and fixed the options file, but this is not= just an improvement opportunity, it&#39;s more on the MUST end of the scal= e: it is very impractical to have such a needless name clash.<br> <br> <br> =A0 * Improvement potential #4 =A0-- =A0Standard options for tools.<br> <br> Why have &quot;-quiet&quot; for the compiler and &quot;-nologo&quot; for th= e linker? Standardizing options across the toolset is a very nice improveme= nt opportunity. Also, it would be nice if the linker refrained from reporti= ng all about itself when it encounters an error.<br> <br> <br> =A0* Improvement potential #5 =A0-- =A0The description of Windows prog.<br=

Following main site&#39;s links to [<a href=3D"http://d-programming-languag= e.org/windows.html" target=3D"_blank">http://d-programming-<u></u>language.= org/windows.html</a>], I found a real monstrosity as an example of purporte= dly simplest possible Windows GUI program. It&#39;s almost funny. Here is m= ine:<br> <br> &lt;code&gt;<br> =A0 =A0import std.c.windows.windows;<br> <br> =A0 =A0void main()<br> =A0 =A0{<br> =A0 =A0 =A0 =A0MessageBoxW( null, &quot;Text&quot;, &quot;Caption&quot;, M= B_OK | MB_ICONINFORMATION );<br> =A0 =A0}<br> &lt;/code&gt;<br> <br> <br> And here is how I built it:<br> <br> <br> &lt;example&gt;<br> [d:\dev\test\d]<br> &gt; dmd minimal_gui.d -L-subsystem:windows<br> <br> [d:\dev\test\d]<br> &gt; dumpbin /headers minimal_gui.exe | find /i &quot;sub&quot;<br> =A0 =A0 =A0 =A0 =A0 =A03.10 subsystem version<br> =A0 =A0 =A0 =A0 =A0 =A0 =A0 2 subsystem (Windows GUI)<br> <br> [d:\dev\test\d]<br> &gt; minimal.d<br> &lt;/example&gt;<br> <br> <br> Maybe with DMD tools something potentially bad happens here. However, with = extant C++ compilers (and even old Borland C++ 5.5) this way of doing thing= s works splendidly. So here is a definite improvement potential for the web= site page with the monstrous code, and if the current tools don&#39;t hand= le it well, also for the the toolset. :-)<br> <br> <br> Cheers &amp; hth.,<br> <br> - Alf (at very beginning of checking out the D language)<br> </blockquote></div><br><div>Regards,</div><div>Brad Anderson</div> --f46d042c6b73403b3704b8cef2a8--
Feb 12 2012
prev sibling next sibling parent Brad Anderson <eco gnuk.net> writes:
--bcaec55239724ce06804b8d198a1
Content-Type: text/plain; charset=ISO-8859-1

On Sun, Feb 12, 2012 at 7:07 PM, Brad Anderson <eco gnuk.net> wrote:

 On Sun, Feb 12, 2012 at 5:02 PM, Alf P. Steinbach <
 alf.p.steinbach+usenet gmail.com> wrote:

 Hi

 I just installed D 2.x.


   * Improvement potential #1  --  installer description.

 It was not clear to me that the first download is a full offline
 installer. In ignorance I used the one that downloads from web. The web
 page can possibly be mucho improved! :-)


   * Improvement potential #2  --  Start menu link to help file.

 It didn't work. Sorry I didn't check where it pointed, but it started
 searching for some [index.html]. I found that file by manual searching,
 plugged it in manual in the search that the link brought up, and all's well
 that ends well, but this is DEFINITELY an improvement opportunity!


https://github.com/D-Programming-Language/installer/pull/6 The Start Menu "Documentation" link was to the D1 documentation. If you didn't install D1 the link was broken. I have two other pull requests for the installer: https://github.com/D-Programming-Language/installer/pull/5 : Replace default NSIS welcome/finish graphic with custom D graphics https://github.com/D-Programming-Language/installer/pull/4 : Make D1 unchecked by default It'd be nice if all three of these could get merged before 2.058. Regards, Brad Anderson
   * Improvement potential #3  --  Linker executable name.

 The name [link.exe] conflicts with Microsoft's linker. Please name it
 [optlink.exe]. I just renamed it and fixed the options file, but this is
 not just an improvement opportunity, it's more on the MUST end of the
 scale: it is very impractical to have such a needless name clash.


   * Improvement potential #4  --  Standard options for tools.

 Why have "-quiet" for the compiler and "-nologo" for the linker?
 Standardizing options across the toolset is a very nice improvement
 opportunity. Also, it would be nice if the linker refrained from reporting
 all about itself when it encounters an error.


  * Improvement potential #5  --  The description of Windows prog.

 Following main site's links to [http://d-programming-**
 language.org/windows.html<http://d-programming-language.org/windows.html>],
 I found a real monstrosity as an example of purportedly simplest possible
 Windows GUI program. It's almost funny. Here is mine:

 <code>
    import std.c.windows.windows;

    void main()
    {
        MessageBoxW( null, "Text", "Caption", MB_OK | MB_ICONINFORMATION );
    }
 </code>


 And here is how I built it:


 <example>
 [d:\dev\test\d]
 dmd minimal_gui.d -L-subsystem:windows

[d:\dev\test\d]
 dumpbin /headers minimal_gui.exe | find /i "sub"

2 subsystem (Windows GUI) [d:\dev\test\d]
 minimal.d

Maybe with DMD tools something potentially bad happens here. However, with extant C++ compilers (and even old Borland C++ 5.5) this way of doing things works splendidly. So here is a definite improvement potential for the web site page with the monstrous code, and if the current tools don't handle it well, also for the the toolset. :-) Cheers & hth., - Alf (at very beginning of checking out the D language)

Regards, Brad Anderson

--bcaec55239724ce06804b8d198a1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sun, Feb 12, 2012 at 7:07 PM, Brad Anderson <span dir=3D"ltr">&lt;<a hre= f=3D"mailto:eco gnuk.net">eco gnuk.net</a>&gt;</span> wrote:<br><div class= =3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8= ex;border-left:1px #ccc solid;padding-left:1ex"> <div class=3D"im">On Sun, Feb 12, 2012 at 5:02 PM, Alf P. Steinbach <span d= ir=3D"ltr">&lt;<a href=3D"mailto:alf.p.steinbach%2Busenet gmail.com" target= =3D"_blank">alf.p.steinbach+usenet gmail.com</a>&gt;</span> wrote:<br></div=
<div class=3D"gmail_quote">

8ex;border-left:1px #ccc solid;padding-left:1ex"> Hi<br> <br> I just installed D 2.x.<br> <br> <br> =A0 * Improvement potential #1 =A0-- =A0installer description.<br> <br> It was not clear to me that the first download is a full offline installer.= In ignorance I used the one that downloads from web. The web page can poss= ibly be mucho improved! :-)<br> <br> <br> =A0 * Improvement potential #2 =A0-- =A0Start menu link to help file.<br> <br> It didn&#39;t work. Sorry I didn&#39;t check where it pointed, but it start= ed searching for some [index.html]. I found that file by manual searching, = plugged it in manual in the search that the link brought up, and all&#39;s = well that ends well, but this is DEFINITELY an improvement opportunity!<br> <br></blockquote><div><br></div></div><div>I&#39;ll look into this one and = make a pull request.</div></div></blockquote><div><br></div><div><a href=3D= "https://github.com/D-Programming-Language/installer/pull/6">https://github= .com/D-Programming-Language/installer/pull/6</a></div> <div><br></div><div>The Start Menu &quot;Documentation&quot; link was to th= e D1 documentation. =A0If you didn&#39;t install D1 the link was broken.</d= iv><div><br></div><div><br></div><div>I have two other pull requests for th= e installer:</div> <div><a href=3D"https://github.com/D-Programming-Language/installer/pull/5"=
https://github.com/D-Programming-Language/installer/pull/5</a>=A0:=A0Repla=

href=3D"https://github.com/D-Programming-Language/installer/pull/4">https:/= /github.com/D-Programming-Language/installer/pull/4</a>=A0:=A0Make D1 unche= cked by default</div> <div><br></div><div>It&#39;d be nice if all three of these could get merged= before 2.058.</div><div><br></div><div>Regards,</div><div>Brad Anderson</d= iv><div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8= ex;border-left:1px #ccc solid;padding-left:1ex"> <div class=3D"gmail_quote"><div><div class=3D"h5"><div>=A0</div><blockquote= class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli= d;padding-left:1ex"> <br> =A0 * Improvement potential #3 =A0-- =A0Linker executable name.<br> <br> The name [link.exe] conflicts with Microsoft&#39;s linker. Please name it [= optlink.exe]. I just renamed it and fixed the options file, but this is not= just an improvement opportunity, it&#39;s more on the MUST end of the scal= e: it is very impractical to have such a needless name clash.<br> <br> <br> =A0 * Improvement potential #4 =A0-- =A0Standard options for tools.<br> <br> Why have &quot;-quiet&quot; for the compiler and &quot;-nologo&quot; for th= e linker? Standardizing options across the toolset is a very nice improveme= nt opportunity. Also, it would be nice if the linker refrained from reporti= ng all about itself when it encounters an error.<br> <br> <br> =A0* Improvement potential #5 =A0-- =A0The description of Windows prog.<br=

Following main site&#39;s links to [<a href=3D"http://d-programming-languag= e.org/windows.html" target=3D"_blank">http://d-programming-<u></u>language.= org/windows.html</a>], I found a real monstrosity as an example of purporte= dly simplest possible Windows GUI program. It&#39;s almost funny. Here is m= ine:<br> <br> &lt;code&gt;<br> =A0 =A0import std.c.windows.windows;<br> <br> =A0 =A0void main()<br> =A0 =A0{<br> =A0 =A0 =A0 =A0MessageBoxW( null, &quot;Text&quot;, &quot;Caption&quot;, M= B_OK | MB_ICONINFORMATION );<br> =A0 =A0}<br> &lt;/code&gt;<br> <br> <br> And here is how I built it:<br> <br> <br> &lt;example&gt;<br> [d:\dev\test\d]<br> &gt; dmd minimal_gui.d -L-subsystem:windows<br> <br> [d:\dev\test\d]<br> &gt; dumpbin /headers minimal_gui.exe | find /i &quot;sub&quot;<br> =A0 =A0 =A0 =A0 =A0 =A03.10 subsystem version<br> =A0 =A0 =A0 =A0 =A0 =A0 =A0 2 subsystem (Windows GUI)<br> <br> [d:\dev\test\d]<br> &gt; minimal.d<br> &lt;/example&gt;<br> <br> <br> Maybe with DMD tools something potentially bad happens here. However, with = extant C++ compilers (and even old Borland C++ 5.5) this way of doing thing= s works splendidly. So here is a definite improvement potential for the web= site page with the monstrous code, and if the current tools don&#39;t hand= le it well, also for the the toolset. :-)<br> <br> <br> Cheers &amp; hth.,<br> <br> - Alf (at very beginning of checking out the D language)<br> </blockquote></div></div></div><br><div>Regards,</div><div>Brad Anderson</d= iv> </blockquote></div><br> --bcaec55239724ce06804b8d198a1--
Feb 12 2012
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
Hi Alf! Welcome!

On 2/12/2012 4:02 PM, Alf P. Steinbach wrote:
 Hi

 I just installed D 2.x.


 * Improvement potential #1 -- installer description.

 It was not clear to me that the first download is a full offline installer. In
 ignorance I used the one that downloads from web. The web page can possibly be
 mucho improved! :-)


 * Improvement potential #2 -- Start menu link to help file.

 It didn't work. Sorry I didn't check where it pointed, but it started searching
 for some [index.html]. I found that file by manual searching, plugged it in
 manual in the search that the link brought up, and all's well that ends well,
 but this is DEFINITELY an improvement opportunity!


 * Improvement potential #3 -- Linker executable name.

 The name [link.exe] conflicts with Microsoft's linker. Please name it
 [optlink.exe]. I just renamed it and fixed the options file, but this is not
 just an improvement opportunity, it's more on the MUST end of the scale: it is
 very impractical to have such a needless name clash.

Having clashes with programs from other vendors is a constant problem. Even having clashes with our own programs is, as people often wish to keep multiple versions installed. This is why we switched away from relying solely on environment variables, such as PATH, to find the programs and set options. Instead, sc.ini is used: http://www.d-programming-language.org/dmd-windows.html#sc_ini to set where the programs and libraries are to be found.
 * Improvement potential #4 -- Standard options for tools.

 Why have "-quiet" for the compiler and "-nologo" for the linker? Standardizing
 options across the toolset is a very nice improvement opportunity.

That's a good idea. Optlink has several anachronisms in it due to it having a long history.
 Also, it
 would be nice if the linker refrained from reporting all about itself when it
 encounters an error.

That's there so it's easy for users to cut&paste the error and also get the correct linker version, etc., when asking for help.
 * Improvement potential #5 -- The description of Windows prog.

 Following main site's links to
[http://d-programming-language.org/windows.html],
 I found a real monstrosity as an example of purportedly simplest possible
 Windows GUI program. It's almost funny. Here is mine:

 <code>
 import std.c.windows.windows;

 void main()
 {
 MessageBoxW( null, "Text", "Caption", MB_OK | MB_ICONINFORMATION );
 }
 </code>


 And here is how I built it:


 <example>
 [d:\dev\test\d]
  > dmd minimal_gui.d -L-subsystem:windows

 [d:\dev\test\d]
  > dumpbin /headers minimal_gui.exe | find /i "sub"
 3.10 subsystem version
 2 subsystem (Windows GUI)

 [d:\dev\test\d]
  > minimal.d
 </example>


 Maybe with DMD tools something potentially bad happens here. However, with
 extant C++ compilers (and even old Borland C++ 5.5) this way of doing things
 works splendidly. So here is a definite improvement potential for the web site
 page with the monstrous code, and if the current tools don't handle it well,
 also for the the toolset. :-)

Good point, the Windows examples get less love than the other stuff. On the other hand, I don't think a simple main()/MessageBoxW() program scales as a first program. It needs to be a WinMain(), and it needs to show how to get a classic GUI program started up and shut down. The user can then start hanging flesh on it for his own purposes.
 - Alf (at very beginning of checking out the D language)

Thanks for taking the time to post these first experiences. It's often hard for use to see the picture in the way a new user does.
Feb 13 2012
next sibling parent reply Vincent <thornik gmail.com> writes:
 * Improvement potential #3 -- Linker executable name.

 The name [link.exe] conflicts with Microsoft's linker. Please name it
[optlink.exe].


 This is why we switched away from relying solely on environment variables, such
 as PATH, to find the programs and set options. Instead, sc.ini is used:

Hi, Walter! I support Alf in renaming initiative. Even if you were so smart to use sc.ini, other vedors are not! I put dmd/bin in PATH where dmd.exe can be found (obvious solution), BUT link.exe sit at the same place! Despite what dmd.exe uses, MS tools will catch wrong link.exe or dmd will catch MS' link.exe (if you put MS tools first in PATH). So it's MUCH easier to rename link.exe (it's not a trademark, what a problem!), than spreading curses every time you get strange error from compiler. Situation is that MS is dominating on the market, so DM should adapt its tools to be most painless after you add 'em on computer. Good luck!
Feb 14 2012
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 2/14/2012 12:50 AM, Vincent wrote:
 * Improvement potential #3 -- Linker executable name.

 The name [link.exe] conflicts with Microsoft's linker. Please name it
 [optlink.exe].


 This is why we switched away from relying solely on environment variables, such
 as PATH, to find the programs and set options. Instead, sc.ini is used:

Hi, Walter! I support Alf in renaming initiative. Even if you were so smart to use sc.ini, other vedors are not!

It's fine if they do not, as sc.ini is designed to override any path set in the environment.
 I put dmd/bin in PATH where dmd.exe can be found (obvious solution), BUT
 link.exe sit at the same place!
 Despite what dmd.exe uses, MS tools will catch wrong link.exe or dmd will catch
 MS' link.exe (if you put MS tools first in PATH).
 So it's MUCH easier to rename link.exe (it's not a trademark, what a problem!),
 than spreading curses every time you get strange error from compiler.
 Situation is that MS is dominating on the market, so DM should adapt its tools
 to be most painless after you add 'em on computer.

 Good luck!

I am loathe to break 20+ years of working makefiles. But there is a simple solution for your case. Create a batch file, dmd.bat, with the contents: c:\dmd\windows\bin\dmd %1 %2 %3 %4 and put it somewhere in your PATH. Then, dmd will run the correct dmd.exe without it being on the PATH, and it will find the correct link.exe (because of sc.ini). Meanwhile, if you just type link, it will find your MS-LINK. But what most people do is have multiple .bat files, one for each compiler, to switcheroo the environment for the compiler they wish to use at the moment. After all, it isn't just link.exe. It's all the tools, the .h files, the library files, etc.
Feb 14 2012
parent Jacob Carlborg <doob me.com> writes:
On 2012-02-14 10:04, Walter Bright wrote:
 On 2/14/2012 12:50 AM, Vincent wrote:
 * Improvement potential #3 -- Linker executable name.

 The name [link.exe] conflicts with Microsoft's linker. Please name it
 [optlink.exe].


 This is why we switched away from relying solely on environment
 variables, such
 as PATH, to find the programs and set options. Instead, sc.ini is used:

Hi, Walter! I support Alf in renaming initiative. Even if you were so smart to use sc.ini, other vedors are not!

It's fine if they do not, as sc.ini is designed to override any path set in the environment.
 I put dmd/bin in PATH where dmd.exe can be found (obvious solution), BUT
 link.exe sit at the same place!
 Despite what dmd.exe uses, MS tools will catch wrong link.exe or dmd
 will catch
 MS' link.exe (if you put MS tools first in PATH).
 So it's MUCH easier to rename link.exe (it's not a trademark, what a
 problem!),
 than spreading curses every time you get strange error from compiler.
 Situation is that MS is dominating on the market, so DM should adapt
 its tools
 to be most painless after you add 'em on computer.

 Good luck!

I am loathe to break 20+ years of working makefiles. But there is a simple solution for your case. Create a batch file, dmd.bat, with the contents: c:\dmd\windows\bin\dmd %1 %2 %3 %4 and put it somewhere in your PATH. Then, dmd will run the correct dmd.exe without it being on the PATH, and it will find the correct link.exe (because of sc.ini). Meanwhile, if you just type link, it will find your MS-LINK. But what most people do is have multiple .bat files, one for each compiler, to switcheroo the environment for the compiler they wish to use at the moment. After all, it isn't just link.exe. It's all the tools, the .h files, the library files, etc.

For that problem we have DVM: https://bitbucket.org/doob/dvm -- /Jacob Carlborg
Feb 14 2012
prev sibling next sibling parent "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
On Tuesday, 14 February 2012 at 09:04:50 UTC, Walter Bright wrote:
 But there is a simple solution for your case. Create a batch 
 file, dmd.bat, with the contents:

   c:\dmd\windows\bin\dmd %1 %2 %3 %4

I would suggest replacing "%1 %2 %3 %4" with "%*".
 But what most people do is have multiple .bat files, one for 
 each compiler, to switcheroo the environment for the compiler 
 they wish to use at the moment. After all, it isn't just 
 link.exe. It's all the tools, the .h files, the library files, 
 etc.

For myself, I've written a plugin for my preferred file manager: https://github.com/CyberShadow/EnvMan
Feb 14 2012
prev sibling next sibling parent Sean Kelly <sean invisibleduck.org> writes:
It does help that Visual Studio ships with a batch file to open a console co=
nfigured for using vc++. Just don't use that when working on D apps.=20

On Feb 14, 2012, at 1:04 AM, Walter Bright <newshound2 digitalmars.com> wrot=
e:

 On 2/14/2012 12:50 AM, Vincent wrote:
 * Improvement potential #3 -- Linker executable name.
=20
 The name [link.exe] conflicts with Microsoft's linker. Please name it
 [optlink.exe].


 This is why we switched away from relying solely on environment variable=



 as PATH, to find the programs and set options. Instead, sc.ini is used:

Hi, Walter! I support Alf in renaming initiative. Even if you were so smart to use sc=


 other vedors are not!

It's fine if they do not, as sc.ini is designed to override any path set i=

=20
=20
 I put dmd/bin in PATH where dmd.exe can be found (obvious solution), BUT
 link.exe sit at the same place!
 Despite what dmd.exe uses, MS tools will catch wrong link.exe or dmd will=


 MS' link.exe (if you put MS tools first in PATH).
 So it's MUCH easier to rename link.exe (it's not a trademark, what a prob=


 than spreading curses every time you get strange error from compiler.
 Situation is that MS is dominating on the market, so DM should adapt its t=


 to be most painless after you add 'em on computer.
=20
 Good luck!

I am loathe to break 20+ years of working makefiles. =20 But there is a simple solution for your case. Create a batch file, dmd.bat=

=20
   c:\dmd\windows\bin\dmd %1 %2 %3 %4
=20
 and put it somewhere in your PATH. Then, dmd will run the correct dmd.exe w=

f sc.ini). Meanwhile, if you just type link, it will find your MS-LINK.
=20
 But what most people do is have multiple .bat files, one for each compiler=

ent. After all, it isn't just link.exe. It's all the tools, the .h files, th= e library files, etc.
=20

Feb 14 2012
prev sibling next sibling parent Brad Anderson <eco gnuk.net> writes:
--f46d042c6b73840a8904b8ef661f
Content-Type: text/plain; charset=ISO-8859-1

On Tue, Feb 14, 2012 at 9:40 AM, Sean Kelly <sean invisibleduck.org> wrote:

 It does help that Visual Studio ships with a batch file to open a console
 configured for using vc++. Just don't use that when working on D apps.

if a similar batch file for D would be helpful to anyone. Is there any interest in that option? I'd probably change the installer to make setting the PATH optional if I added that. Right now there is no indication that the installer is going to change your path which is a bit rude (especially when the installer used to fail and erase the entire PATH in some cases). Regards, Brad Anderson
 On Feb 14, 2012, at 1:04 AM, Walter Bright <newshound2 digitalmars.com>
 wrote:

 On 2/14/2012 12:50 AM, Vincent wrote:
 * Improvement potential #3 -- Linker executable name.

 The name [link.exe] conflicts with Microsoft's linker. Please name it
 [optlink.exe].


 This is why we switched away from relying solely on environment



 as PATH, to find the programs and set options. Instead, sc.ini is used:

Hi, Walter! I support Alf in renaming initiative. Even if you were so smart to use


 other vedors are not!

It's fine if they do not, as sc.ini is designed to override any path set

 I put dmd/bin in PATH where dmd.exe can be found (obvious solution), BUT
 link.exe sit at the same place!
 Despite what dmd.exe uses, MS tools will catch wrong link.exe or dmd


 MS' link.exe (if you put MS tools first in PATH).
 So it's MUCH easier to rename link.exe (it's not a trademark, what a


 than spreading curses every time you get strange error from compiler.
 Situation is that MS is dominating on the market, so DM should adapt


 to be most painless after you add 'em on computer.

 Good luck!

I am loathe to break 20+ years of working makefiles. But there is a simple solution for your case. Create a batch file,

   c:\dmd\windows\bin\dmd %1 %2 %3 %4

 and put it somewhere in your PATH. Then, dmd will run the correct

(because of sc.ini). Meanwhile, if you just type link, it will find your MS-LINK.
 But what most people do is have multiple .bat files, one for each

at the moment. After all, it isn't just link.exe. It's all the tools, the .h files, the library files, etc.


--f46d042c6b73840a8904b8ef661f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Feb 14, 2012 at 9:40 AM, Sean Kelly <span dir=3D"ltr">&lt;<a href= =3D"mailto:sean invisibleduck.org">sean invisibleduck.org</a>&gt;</span> wr= ote:<br><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style= =3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> It does help that Visual Studio ships with a batch file to open a console c= onfigured for using vc++. Just don&#39;t use that when working on D apps.<b= r> <div class=3D"HOEnZb"><div class=3D"h5"><br></div></div></blockquote><div><= br></div><div><div>While fixing up some PATH setting issues with the instal= ler I&#39;ve wondered if a similar batch file for D would be helpful to any= one. =A0Is there any interest in that option? =A0I&#39;d probably change th= e installer to make setting the PATH optional if I added that. =A0Right now= there is no indication that the installer is going to change your path whi= ch is a bit rude (especially when the installer used to fail and erase the = entire PATH in some cases).</div> <div><br></div><div>Regards,</div><div>Brad Anderson</div></div><div>=A0</d= iv><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left= :1px #ccc solid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5"> On Feb 14, 2012, at 1:04 AM, Walter Bright &lt;<a href=3D"mailto:newshound2= digitalmars.com">newshound2 digitalmars.com</a>&gt; wrote:<br> <br> &gt; On 2/14/2012 12:50 AM, Vincent wrote:<br> &gt;&gt;&gt;&gt; * Improvement potential #3 -- Linker executable name.<br> &gt;&gt;&gt;&gt;<br> &gt;&gt;&gt;&gt; The name [link.exe] conflicts with Microsoft&#39;s linker.= Please name it<br> &gt;&gt;&gt;&gt; [optlink.exe].<br> &gt;&gt;<br> &gt;&gt;&gt; This is why we switched away from relying solely on environmen= t variables, such<br> &gt;&gt;&gt; as PATH, to find the programs and set options. Instead, sc.ini= is used:<br> &gt;&gt;<br> &gt;&gt; Hi, Walter!<br> &gt;&gt; I support Alf in renaming initiative. Even if you were so smart to= use sc.ini,<br> &gt;&gt; other vedors are not!<br> &gt;<br> &gt; It&#39;s fine if they do not, as sc.ini is designed to override any pa= th set in the environment.<br> &gt;<br> &gt;<br> &gt;&gt; I put dmd/bin in PATH where dmd.exe can be found (obvious solution= ), BUT<br> &gt;&gt; link.exe sit at the same place!<br> &gt;&gt; Despite what dmd.exe uses, MS tools will catch wrong link.exe or d= md will catch<br> &gt;&gt; MS&#39; link.exe (if you put MS tools first in PATH).<br> &gt;&gt; So it&#39;s MUCH easier to rename link.exe (it&#39;s not a tradema= rk, what a problem!),<br> &gt;&gt; than spreading curses every time you get strange error from compil= er.<br> &gt;&gt; Situation is that MS is dominating on the market, so DM should ada= pt its tools<br> &gt;&gt; to be most painless after you add &#39;em on computer.<br> &gt;&gt;<br> &gt;&gt; Good luck!<br> &gt;<br> &gt; I am loathe to break 20+ years of working makefiles.<br> &gt;<br> &gt; But there is a simple solution for your case. Create a batch file, dmd= .bat, with the contents:<br> &gt;<br> &gt; =A0 c:\dmd\windows\bin\dmd %1 %2 %3 %4<br> &gt;<br> &gt; and put it somewhere in your PATH. Then, dmd will run the correct dmd.= exe without it being on the PATH, and it will find the correct link.exe (be= cause of sc.ini). Meanwhile, if you just type link, it will find your MS-LI= NK.<br> &gt;<br> &gt; But what most people do is have multiple .bat files, one for each comp= iler, to switcheroo the environment for the compiler they wish to use at th= e moment. After all, it isn&#39;t just link.exe. It&#39;s all the tools, th= e .h files, the library files, etc.<br> &gt;</div></div></blockquote></div> --f46d042c6b73840a8904b8ef661f--
Feb 14 2012
prev sibling next sibling parent reply "Alf P. Steinbach" <alf.p.steinbach+usenet gmail.com> writes:
On 13.02.2012 20:13, Walter Bright wrote:
 Hi Alf! Welcome!

Thanks.
 On 2/12/2012 4:02 PM, Alf P. Steinbach wrote:

 * Improvement potential #5 -- The description of Windows prog.

 Following main site's links to
 [http://d-programming-language.org/windows.html],
 I found a real monstrosity as an example of purportedly simplest possible
 Windows GUI program. It's almost funny. Here is mine:

 <code>
 import std.c.windows.windows;

 void main()
 {
     MessageBoxW( null, "Text", "Caption", MB_OK | MB_ICONINFORMATION );
 }
 </code>


[Just in passing, a practical tip: in Thunderbird (which you're using), selecting all the text before hitting "Reply" prevents TB from removing indents from code. They added the remove-indents behavior in version 2. Nobody expects it, for why on Earth should it do that?, but it does.]
 And here is how I built it:


 <example>
 [d:\dev\test\d]
 dmd minimal_gui.d -L-subsystem:windows

[d:\dev\test\d]
 dumpbin /headers minimal_gui.exe | find /i "sub"

2 subsystem (Windows GUI) [d:\dev\test\d]
 minimal.d

Maybe with DMD tools something potentially bad happens here. However, with extant C++ compilers (and even old Borland C++ 5.5) this way of doing things works splendidly. So here is a definite improvement potential for the web site page with the monstrous code, and if the current tools don't handle it well, also for the the toolset. :-)

Good point, the Windows examples get less love than the other stuff.

He he.
 On
 the other hand, I don't think a simple main()/MessageBoxW() program
 scales as a first program. It needs to be a WinMain(), and it needs to
 show how to get a classic GUI program started up and shut down. The user
 can then start hanging flesh on it for his own purposes.

Oh, that's just Microsoft propaganda-by-example. In C and C++ the non-standard Microsoft specific WinMain startup function technically only makes the programs formally incorrect for a hosted implementation, and in practice it serves to make people accept also other Microsoft lock-in things blindly, without questioning. People are tricked into believing that this Microsoft standard-breaking thing is needed because all Microsoft examples use it, and because Microsoft's toolchain (but not e.g. the GNU toolchain) won't accept a standard `main` for a GUI subsystem program, without use of not very well documented options (MSVC linker option "/entry:mainCRTStartup"). In D, if the example code given on the D site is correct apart from the result value bug, WinMain requires a lot of ugly boiler-plate code. Re the bug, it's duplicated in the VisualD starter code for a new console project, so such boiler-plate code is definitely undesirable... So, on the Bright side, this is a real improvement opportunity :-). The main problem (pun not intended) in C and C++ is that neither standard `main` nor non-standard Microsoft `WinMain` provide the command line arguments in Unicode. Standard `main` has `char` arguments, by Windows convention encoded in Windows ANSI, which generally means data loss and e.g. that some file names can't be passed. Microsoft `WinMain` provides the arguments part of the command line, in Unicode, but not split up into individual arguments. I do not yet know the valid signatures for a D standard `main`. But if those D signatures include one with a set of Unicode arguments, then all is super-duper, and if not, then one must just do in D what one must do in C and C++ for a real and standard-conforming program, namely to use the Windows API to retrieve the arguments (if necessary).
 - Alf (at very beginning of checking out the D language)

Thanks for taking the time to post these first experiences. It's often hard for use to see the picture in the way a new user does.

I once, as a college lecturer, used to quip that one learns as long as one has students... ;-) Cheers & hth., - Alf
Feb 14 2012
next sibling parent reply =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 02/14/2012 11:45 AM, Alf P. Steinbach wrote:
 On 13.02.2012 20:13, Walter Bright wrote:
 Hi Alf! Welcome!

Thanks.

Welcome! :) I've learned a lot from you on comp.lang.c++.moderated. It is great to see you here as well. If you don't mind my asking, and of course it is totally fine if you choose not to answer, what features of D have made it worth it for you to try it out? Ali
Feb 14 2012
parent "Alf P. Steinbach" <alf.p.steinbach+usenet gmail.com> writes:
On 14.02.2012 22:21, Ali Çehreli wrote:
 On 02/14/2012 11:45 AM, Alf P. Steinbach wrote:
  > On 13.02.2012 20:13, Walter Bright wrote:
  >> Hi Alf! Welcome!
  >
  > Thanks.

 Welcome! :) I've learned a lot from you on comp.lang.c++.moderated. It
 is great to see you here as well.

 If you don't mind my asking, and of course it is totally fine if you
 choose not to answer, what features of D have made it worth it for you
 to try it out?

Well, there's Walter, compiler genius, and Andrei, template genius, and I figure that with both of them doing D stuff there must be something here. ;-) Cheers, - Alf
Feb 14 2012
prev sibling next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 2/14/2012 11:45 AM, Alf P. Steinbach wrote:
 On 13.02.2012 20:13, Walter Bright wrote:
 Hi Alf! Welcome!

Thanks.
 On 2/12/2012 4:02 PM, Alf P. Steinbach wrote:

 * Improvement potential #5 -- The description of Windows prog.

 Following main site's links to
 [http://d-programming-language.org/windows.html],
 I found a real monstrosity as an example of purportedly simplest possible
 Windows GUI program. It's almost funny. Here is mine:

 <code>
 import std.c.windows.windows;

 void main()
 {
 MessageBoxW( null, "Text", "Caption", MB_OK | MB_ICONINFORMATION );
 }
 </code>


[Just in passing, a practical tip: in Thunderbird (which you're using), selecting all the text before hitting "Reply" prevents TB from removing indents from code. They added the remove-indents behavior in version 2. Nobody expects it, for why on Earth should it do that?, but it does.]
 And here is how I built it:


 <example>
 [d:\dev\test\d]
 dmd minimal_gui.d -L-subsystem:windows

[d:\dev\test\d]
 dumpbin /headers minimal_gui.exe | find /i "sub"

2 subsystem (Windows GUI) [d:\dev\test\d]
 minimal.d

Maybe with DMD tools something potentially bad happens here. However, with extant C++ compilers (and even old Borland C++ 5.5) this way of doing things works splendidly. So here is a definite improvement potential for the web site page with the monstrous code, and if the current tools don't handle it well, also for the the toolset. :-)

Good point, the Windows examples get less love than the other stuff.

He he.
 On
 the other hand, I don't think a simple main()/MessageBoxW() program
 scales as a first program. It needs to be a WinMain(), and it needs to
 show how to get a classic GUI program started up and shut down. The user
 can then start hanging flesh on it for his own purposes.

Oh, that's just Microsoft propaganda-by-example. In C and C++ the non-standard Microsoft specific WinMain startup function technically only makes the programs formally incorrect for a hosted implementation, and in practice it serves to make people accept also other Microsoft lock-in things blindly, without questioning. People are tricked into believing that this Microsoft standard-breaking thing is needed because all Microsoft examples use it, and because Microsoft's toolchain (but not e.g. the GNU toolchain) won't accept a standard `main` for a GUI subsystem program, without use of not very well documented options (MSVC linker option "/entry:mainCRTStartup"). In D, if the example code given on the D site is correct apart from the result value bug, WinMain requires a lot of ugly boiler-plate code. Re the bug, it's duplicated in the VisualD starter code for a new console project, so such boiler-plate code is definitely undesirable... So, on the Bright side, this is a real improvement opportunity :-).

Yes, unfortunately, I am not an expert at Windows event loop GUI programming, and so I am unsure of the right way to do this. So I fell back on the standard way.
 But if those D signatures include one with a set of Unicode arguments, then all
 is super-duper, and if not, then one must just do in D what one must do in C
and
 C++ for a real and standard-conforming program, namely to use the Windows API
to
 retrieve the arguments (if necessary).

In D, the main(string[] args) are supposed to be in Unicode (more specifically, UTF-8).
 I once, as a college lecturer, used to quip that one learns as long as one has
 students... ;-)

And the old but true corollary, the best way to learn something is to try and teach it to others.
Feb 14 2012
parent Mike Parker <aldacron gmail.com> writes:
On 2/15/2012 7:16 AM, Walter Bright wrote:

 And the old but true corollary, the best way to learn something is to
 try and teach it to others.

After 18 years of teaching English here in Korea, I find it very difficult not to correct friends and family back home. If my high school teachers could see me now...
Feb 14 2012
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 2/14/2012 2:02 PM, Sean Kelly wrote:
 D should pass the command-line args as properly translated UTF-8.  If this
 doesn't happen, consider it a bug.  Regarding Windows specifically, D
 currently gets the args via GetCommandLineW(), so if that doesn't muck things
 up then all should be well.

Just to add to that, D is designed to be a Unicode language from front-to-back. The runtime library (and that would include the code that calls main()) is supposed to do any translations necessary to make that happen when dealing with operating systems APIs. For user level programming, it is considered good style to adhere to this practice. I.e. all data imported into the program should be converted on input to Unicode, processed, and converted to the output representation upon output. All runtime library interfaces expect text strings to be in Unicode.
Feb 14 2012
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
You can get the runtime arguments at any point in your D code (and
especially in module constructors that run before main) via
'Runtime.args', by importing 'core.runtime'.
Feb 14 2012
prev sibling parent Sean Kelly <sean invisibleduck.org> writes:
On Feb 14, 2012, at 11:45 AM, Alf P. Steinbach wrote:
=20
 The main problem (pun not intended) in C and C++ is that neither =

line arguments in Unicode. Standard `main` has `char` arguments, by = Windows convention encoded in Windows ANSI, which generally means data = loss and e.g. that some file names can't be passed. Microsoft `WinMain` = provides the arguments part of the command line, in Unicode, but not = split up into individual arguments.
=20
 I do not yet know the valid signatures for a D standard `main`.
=20
 But if those D signatures include one with a set of Unicode arguments, =

must do in C and C++ for a real and standard-conforming program, namely = to use the Windows API to retrieve the arguments (if necessary). D should pass the command-line args as properly translated UTF-8. If = this doesn't happen, consider it a bug. Regarding Windows specifically, = D currently gets the args via GetCommandLineW(), so if that doesn't muck = things up then all should be well.=
Feb 14 2012