August 02, 2010
dsimcha wrote:
> I absolutely despise using qualified names because they are both syntactic noise
> and extra typing.  D lets me just import tons of stuff and skip the qualified
> names in most cases.  Most of the time it does what I mean, and it complains if
> and only if there's ambiguity about what I mean.

I am inordinately pleased with how the anti-hijacking design worked out. I think it is unique to D2.

Consider, for example, what a botch C++ did with this (namespaces and Koenig lookup). C# requires lots of pointless qualifications.

D2's design works so well most people don't even notice it. It just works.
August 02, 2010
On Sun, Aug 1, 2010 at 8:06 PM, Michel Fortin <michel.fortin@michelf.com> wrote:
> On 2010-08-01 20:07:10 -0400, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> said:
>
>> Ideally we'd have a one-click OSX installer for dmd - a .dmg file. Is someone able and willing to own this project? I think improving the out-of-the-box experience is important and urgent.
>
> I agree too. That's why I made sure the D for Xcode installer installs DMD too, so the user doesn't have to bother about that whole mess. <http://michelf.com/projects/d-for-xcode/>
>
> If you download this package from Safari it'll automatically open in Mac OS X's standard installer program from where you can proceed with the installation. The installer package does not contains DMD: it downloads the latest version from the website during the install process. It installs DMD 1 and DMD 2 and makes them work both from the command line though symlink trickery.
>
> A nice "side effect" of using this installer is that you'll also be ready to use D from whithin Xcode. But you can deactivate that part by customizing the install and unchecking the relevant subpackages. You can install just DMD 2 or just DMD 1 that way too.
>
> Try it, it just works.

Looks cool. That would have been a pretty good experience were it linked from the OSX download page.

I looked in MacPorts for a package before looking on the D site. gdc-0.24 already has one, but dmd and ldc don't. It should be fairly straightforward to write one (http://guide.macports.org/#development.creating-portfile), and I'll try to do so for dmd in the next couple days unless someone gets to it first.
August 02, 2010
On 2010-08-02 02:07, Andrei Alexandrescu wrote:
> Hello,
>
>
> I got an email from someone who got an interest in D following my talk
> at Google. He tried to install dmd on OSX, but got turned off (and
> rightly so) for the unnecessary difficulties of that process and the
> lack of documentation. Nicely of him he took the time to write me and
> detail his experience. Following that, Walter managed to fix the most
> egregious documentation errors.
>
> Ideally we'd have a one-click OSX installer for dmd - a .dmg file. Is
> someone able and willing to own this project? I think improving the
> out-of-the-box experience is important and urgent.
>
>
> Andrei
>
> P.S. My talk at Google went, I think, reasonably well. It could've gone
> a whole lot better; I neglected to make a couple of points. The talk was
> recorded and, I was told, the recording will be on YouTube some time
> next week. My mentions of Python and Haskell will probably get me
> mortified in certain circles.

Have you guys completely forgot http://dsource.org/projects/dmd-installer/browser/trunk/osx ? It's been there for over a year.

-- 
/Jacob Carlborg
August 02, 2010
On 2010-08-02 02:22, Ryan W Sims wrote:
> On 8/1/10 5:07 PM, Andrei Alexandrescu wrote:
>> Hello,
>>
>> I got an email from someone who got an interest in D following my talk
>> at Google. He tried to install dmd on OSX, but got turned off (and
>> rightly so) for the unnecessary difficulties of that process and the
>> lack of documentation. Nicely of him he took the time to write me and
>> detail his experience. Following that, Walter managed to fix the most
>> egregious documentation errors.
>
> Are those fixes reflected anywhere on the site? I found the process to
> be a little clumsy, but not hideous; I would be very interested to see
> what's changed, though.
>
> [Possibly OT?]
> The only real trouble I ran into is this:
> $ ./rdmd
> dyld: unknown required load command 0x80000022
> Trace/BPT trap

I'm guessing that is because rdmd is built on Mac OS X 10.6 and you're running it on Mac OS X 10.5.

>> Ideally we'd have a one-click OSX installer for dmd - a .dmg file. Is
>> someone able and willing to own this project? I think improving the
>> out-of-the-box experience is important and urgent.
>
> I don't know that a simple .dmg file is the right way to go, since you
> need to get some binaries onto the user's path. I think it'd have to be
> a .mpkg package IIRC (which are, admittedly, distributed in a .dmg files)
>
> I don't have much experience with packaging for OSX, but if there are
> not more experienced folks willing to take it on, I'm willing to take
> this on: would love to help, but sadly I don't have the compiler chops
> to make a more significant contribution.
>
>> Andrei
>>
>> P.S. My talk at Google went, I think, reasonably well. It could've gone
>> a whole lot better; I neglected to make a couple of points. The talk was
>> recorded and, I was told, the recording will be on YouTube some time
>> next week. My mentions of Python and Haskell will probably get me
>> mortified in certain circles.
>
> [OT]
> I thought it went well myself, but I might be something of an easy mark.
> Which points did you miss?


-- 
/Jacob Carlborg
August 02, 2010
On 2010-08-02 00:02:35 -0400, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> said:

> That sounds encouraging. Would you be willing to modify and contribute your installer for dmd?

Notice the installer is already open source, part of the D for Xcode project. You might want a change of license, but for the installer changing the license is not a problem.

As for modifications, what do you have in mind? I guess you'll want DMD to be stored inside the package instead of downloaded during installation. Also, do you want to preserve the filesystem layout used by D for Xcode or you want to go with something different?

-- 
Michel Fortin
michel.fortin@michelf.com
http://michelf.com/

August 02, 2010
On 08/02/2010 06:01 AM, Jacob Carlborg wrote:
> On 2010-08-02 02:07, Andrei Alexandrescu wrote:
>> Hello,
>>
>>
>> I got an email from someone who got an interest in D following my talk
>> at Google. He tried to install dmd on OSX, but got turned off (and
>> rightly so) for the unnecessary difficulties of that process and the
>> lack of documentation. Nicely of him he took the time to write me and
>> detail his experience. Following that, Walter managed to fix the most
>> egregious documentation errors.
>>
>> Ideally we'd have a one-click OSX installer for dmd - a .dmg file. Is
>> someone able and willing to own this project? I think improving the
>> out-of-the-box experience is important and urgent.
>>
>>
>> Andrei
>>
>> P.S. My talk at Google went, I think, reasonably well. It could've gone
>> a whole lot better; I neglected to make a couple of points. The talk was
>> recorded and, I was told, the recording will be on YouTube some time
>> next week. My mentions of Python and Haskell will probably get me
>> mortified in certain circles.
>
> Have you guys completely forgot
> http://dsource.org/projects/dmd-installer/browser/trunk/osx ? It's been
> there for over a year.

Hi Jacob,

Apologies for the oversight. I take it it's okay if Walter uses your code to build the distribution automatically? If so, what are the similarities and the differences with Michel's approach?

Andrei
August 02, 2010
On 08/02/2010 06:55 AM, Michel Fortin wrote:
> On 2010-08-02 00:02:35 -0400, Andrei Alexandrescu
> <SeeWebsiteForEmail@erdani.org> said:
>
>> That sounds encouraging. Would you be willing to modify and contribute
>> your installer for dmd?
>
> Notice the installer is already open source, part of the D for Xcode
> project. You might want a change of license, but for the installer
> changing the license is not a problem.
>
> As for modifications, what do you have in mind? I guess you'll want DMD
> to be stored inside the package instead of downloaded during
> installation. Also, do you want to preserve the filesystem layout used
> by D for Xcode or you want to go with something different?

The only modifications I have in mind concern separation of dmd installation from anything XCode specific. Note that I haven't tried your code yet - I'm working off my Ubuntu machine nowadays.

Andrei
August 02, 2010
== Quote from Walter Bright (newshound2@digitalmars.com)'s article
> dsimcha wrote:
> > I absolutely despise using qualified names because they are both syntactic noise and extra typing.  D lets me just import tons of stuff and skip the qualified names in most cases.  Most of the time it does what I mean, and it complains if and only if there's ambiguity about what I mean.
> I am inordinately pleased with how the anti-hijacking design worked out. I think
> it is unique to D2.
> Consider, for example, what a botch C++ did with this (namespaces and Koenig
> lookup). C# requires lots of pointless qualifications.
> D2's design works so well most people don't even notice it. It just works.

Yeah, I always take this for granted when programming in D, and never mention it as a reason why I like D, but whenever I use something else I'm always astounded at how much of a PITA something as simple as getting modules right is.  One reason I hate programming in C is that people Greenspun namespaces that force you to **always** use fully qualified names.  C++ isn't much better since just doing "using namespace myNamespace" invokes so many here be dragons.

It just seems like common sense to me that a module system (and a language in general) should do what you mean as long as there's no ambiguity about what you mean (without forcing you to specify things redundantly, such as by using qualified names), but not guess what you mean when there is ambiguity.  Is there any other language that gets this right?
August 02, 2010
On 2010-08-02 09:18:37 -0400, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> said:

> On 08/02/2010 06:01 AM, Jacob Carlborg wrote:
>> Have you guys completely forgot
>> http://dsource.org/projects/dmd-installer/browser/trunk/osx ? It's been
>> there for over a year.
> 
> Hi Jacob,
> 
> Apologies for the oversight. I take it it's okay if Walter uses your code to build the distribution automatically? If so, what are the similarities and the differences with Michel's approach?

I think I can answer that.

* Jacob's installer includes DMD directly inside the installation package, which I believe is more practical for the user, but less for the maintainer as the installer needs to be rebuild for each new release. My installer downloads the latest version during the install. I do this so I can host the installer on my website with no licensing issue and update it only when releasing a new version of D for Xcode.

* Jacob's installer installs in /usr/share/dmd and creates symlinks in /usr/bin and /usr/share/man. D for Xocde installs DMD 1 in /Library/Compilers/dmd and DMD 2 in /Library/Compilers/dmd2 (user visible folders) and makes symlinks in /usr/local/{bin,lib,man}.

* Jacob's installer requires a modified dmd.conf file. Not with my installer. With mine, once the symlinks are in place you can just swap the dmd or dmd2 folder in /Library/Compilers with a newer one from Digital Mars, but you'll need to set the executable bits manually (because Walter's archives comes without the executable bit set).

* With Jacob's installer, DMD 1 and DMD 2 will overwrite each other (or so I believe). My installer is meant to have both dmd1 and dmd2 usable at the same time. Essentially the symlinks /usr/local/bin/* pointing to /Library/Compilers/{dmd,dmd2}/osx/bin/* are arranged to that you can call 'dmd1' and 'dmd2' from the command line to get either one or the other, and 'dmd' will call either dmd2 or dmd1, which you can change with the 'sudo setdmd 1' or 'sudo setdmd 2' command. This mimics somewhat how Apple bundles multiple versions of GCC in the Xcode package and allow changing the default version.

As a side note, my D plugin for Xcode expects DMD to be available at /usr/local/bin/{dmd,dmd1,dmd2} and the runtime libraries should be in /usr/local/lib. It won't work if the files can't be found there, although I might change that if an official distribution of DMD installs itself elsewhere.

-- 
Michel Fortin
michel.fortin@michelf.com
http://michelf.com/

August 02, 2010
On 2010-08-02 09:22:41 -0400, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> said:

> The only modifications I have in mind concern separation of dmd installation from anything XCode specific.

Well, they're already separated: the package contains two subpackage related to Xcode, and two subpackages to download and install DMD 1 and 2. You can select each separately if you do a custom install.

If what you mean is an installer package with the two Xcode-related subpackages removed, that's a rather trivial matter of dragging the subpackage out of the main package. Here they are (8 Kb each):

DMD 1: <http://michelf.com/docs/d/dmd1install.zip>
DMD 2: <http://michelf.com/docs/d/dmd2install.zip>

They lack the introduction text of the main package, but that'd be easy to fix.

-- 
Michel Fortin
michel.fortin@michelf.com
http://michelf.com/