Mac OSX installer for dmd

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Aug 1 17:58:58 PDT 2010


On 08/01/2010 07:22 PM, Ryan W Sims wrote:
> On 8/1/10 5:07 PM, Andrei Alexandrescu wrote:
>> 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)

You're already way ahead of me. When I said .dmg, I'd already expounded 
90% of my knowledge of OSX installers.

> 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.

Thanks, that would be terrific. To frame the problem more precisely, I 
think a shell script that takes a .zip file containing the installation 
and doing what it takes to build a .mpkg would be perfect.

>> 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?

Thanks for being there! I had this example in my slides (repro from memory):

import std.exception, std.file;
void main(string[] args) {
    enforce(args.length == 3, "Usage: tcopy file1 file2");
    auto tmp = args[2] ~ ".messedup";
    scope(failure) if exists(tmp) remove(tmp);
    copy(args[1], tmp);
    rename(tmp, args[2]);
}

It's a simple transactional copy program that never leaves the fragment 
of its target on the disk (rename is atomic on all Unixen and most 
likely Windows too). It's a very annoying problem with large files 
copied via network connections, I've been using such an idiom for years.

A couple of people got rightly worried that the script uses names such 
as copy, rename, and remove. Such names are highly susceptible to be 
ambiguous when more imports are used. I explained how D works (which I 
think is a very solid design, probably the best I've seen), but the 
nagging issue remained that changes to a library could make a call 
ambiguous to a function in another. I personally think that's all well 
but it's a matter in which reasonable people may disagree.

What I forgot to mention is static import, which would have quenched 
that question perfectly.


Andrei


More information about the Digitalmars-d mailing list