Errors compiling DSSS

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Nov 29 13:45:16 PST 2012


On 11/29/12 3:39 PM, Jacob Carlborg wrote:
> On 2012-11-29 15:28, Andrei Alexandrescu wrote:
>
>> Since you think (as opposed to believe), then there are reasons. What
>> are those reasons, and what steps can we take to obviate them from the D
>> side?
>
> Some features Ruby has that makes it less verbose to use:
>
> * No semicolons
> * Calling a method without parentheses
> * Code can be executed basically every where. Global scope, module scope
> , class scope, method scope and function scope
> * Blocks
> * Easy to integrate into an application
> * Relaxed syntax for associative array literals
> * Dynamic typing can probably help as well

That's a good list. Some don't really affect small scripts, but some are 
important to address (e.g. running code everywhere). The way I've seen 
this done in frameworks is by using a declarative approach in 
conjunction with the Hollywood principle.

> Actually, I'm a bit concerned about how I would do the actual
> integration if the build script was written in D. In Ruby it's easy,
> just do something like (written in D using libruby) :
>
> # Build script in Ruby
>
> target :foo do
> end

You should picture that this doesn't make any sense to someone not 
knowing Ruby (beyond a possible misspelling of "voodoo").

> // Handling the build script in D
>
> string content = read(buildScript);
> BuildScriptContext context = new BuildScriptContext;
> context.instance_eval(content);
>
> // access what's needed from "context"
> string target = context.target;
>
> writeln(target); // prints "foo"

I don't understand how this comparison works (but maybe that's not 
important).

>> Then why not work on it? A tool using D is much more likely to be
>> accepted by the community than one using Ruby, and the latter will
>> probably never be part of the official distro.
>
> That's not fair. I'm doing the best I can. I'm working on several D
> relate projects (including a build tool) and I don't have much time to
> work at D at all. I would really like to be able to work on these
> projects full time. But I don't know how to make money on that.

Money has nothing to do with it. It's your time. Why work on something 
that may be successful instead of something that will definitely not be? 
You have been pushing for Ruby ever since build and distro tools came 
about. Drop Ruby. I know you like it. But it's not going to work here. 
Just drop it.

>> I plan to change your
>> Ruby installer creation scripts into shell scripts as soon as I'll have
>> a minute.
>
> How is that any better?

It is better because it's only requiring the shell and understanding of 
shell scripting instead of yet another language. Everyone building stuff 
on Unix would know the shell.

Just so it's clear what we're talking about:

https://github.com/D-Programming-Language/installer/blob/master/osx/make.rb

This is a good example of gratuitous use of Ruby in a framework that 
ALREADY uses a makefile AND a shell script. I actually have the rewrite 
of this to a shell script somewhere, I found it so needless that I sat 
down and figured whether there's any advantage to not using the shell there.

> Yeah I do know that you prefer shell scripts
> over Ruby.

It's not me, it's you. You prefer Ruby over the more sensible shell 
scripting for this case.

> But you're arguing that I should use D instead of Ruby and
> then you're going to use shell script.

Drop Ruby.


Andrei


More information about the Digitalmars-d mailing list