Re: Shipping the DMD compiler with code

2013-11-04 Thread Colin Grogan
On Saturday, 2 November 2013 at 11:40:59 UTC, Jacob Carlborg 
wrote:

On 2013-11-01 16:47, Colin Grogan wrote:

I have a project I may need to write that is pretty performance
intensive, but also needs to be quite customiseable.

We previously had this done with Perl, and the customising 
came from

adding functions to a file and the main script would call those
functions as required.
Problem is, the Perl program is performing very slowly.

Im thinking of doing this with D, and using string mixins to 
add in
customised functions at compile time. All well and good I 
think.


However, I dont want to have the hassle of telling users to 
install a D

compiler on their systems.
Ideally, the user should be able to unzip this tool and run it 
with rdmd.


Is it possible to ship the D compiler with the code, and not 
have to

worry about any libs and config files being missing?


Due to license issue you're not allowed to distribute the DMD 
without permission from Walter, which he usually give. But 
perhaps you could tell the user to download the DMD zip 
themselves.


I'm specifically thinking about libphobos.a and dmd.conf, can 
they just
be in the same folder as the D compiler or do they need to be 
in

/usr/lib and /etc ?


The DMD from the zip will work out of the box. No need to 
install anything. Just download and unpack the zip.


You could also create a tool that downloads and unzip the 
compiler. Then you might want to take a look at DVM, which 
already does that:


https://github.com/jacob-carlborg/dvm


Looks very useful, I'll look into it!



Re: Shipping the DMD compiler with code

2013-11-02 Thread Jacob Carlborg

On 2013-11-01 16:47, Colin Grogan wrote:

I have a project I may need to write that is pretty performance
intensive, but also needs to be quite customiseable.

We previously had this done with Perl, and the customising came from
adding functions to a file and the main script would call those
functions as required.
Problem is, the Perl program is performing very slowly.

Im thinking of doing this with D, and using string mixins to add in
customised functions at compile time. All well and good I think.

However, I dont want to have the hassle of telling users to install a D
compiler on their systems.
Ideally, the user should be able to unzip this tool and run it with rdmd.

Is it possible to ship the D compiler with the code, and not have to
worry about any libs and config files being missing?


Due to license issue you're not allowed to distribute the DMD without 
permission from Walter, which he usually give. But perhaps you could 
tell the user to download the DMD zip themselves.



I'm specifically thinking about libphobos.a and dmd.conf, can they just
be in the same folder as the D compiler or do they need to be in
/usr/lib and /etc ?


The DMD from the zip will work out of the box. No need to install 
anything. Just download and unpack the zip.


You could also create a tool that downloads and unzip the compiler. Then 
you might want to take a look at DVM, which already does that:


https://github.com/jacob-carlborg/dvm

--
/Jacob Carlborg


Re: Shipping the DMD compiler with code

2013-11-01 Thread Colin Grogan

On Friday, 1 November 2013 at 17:07:48 UTC, John Colvin wrote:

On Friday, 1 November 2013 at 15:47:56 UTC, Colin Grogan wrote:
I have a project I may need to write that is pretty 
performance intensive, but also needs to be quite 
customiseable.


We previously had this done with Perl, and the customising 
came from adding functions to a file and the main script would 
call those functions as required.

Problem is, the Perl program is performing very slowly.

Im thinking of doing this with D, and using string mixins to 
add in customised functions at compile time. All well and good 
I think.


However, I dont want to have the hassle of telling users to 
install a D compiler on their systems.
Ideally, the user should be able to unzip this tool and run it 
with rdmd.


Is it possible to ship the D compiler with the code, and not 
have to worry about any libs and config files being missing?


I'm specifically thinking about libphobos.a and dmd.conf, can 
they just be in the same folder as the D compiler or do they 
need to be in /usr/lib and /etc ?


Thanks folks!


dmd.conf can be in the same folder as the dmd executable. All 
the rest of the linking etc. is specified in dmd.conf so you 
just need to set that up appropriately.


The legal side of things is a different matter. I quote from 
src/backendlicense.txt : "The Software is copyrighted and comes 
with a single user license, and may not be redistributed. If 
you wish to obtain a redistribution license, please contact 
Digital Mars."


Walter may be able to grant redistribution rights if you ask 
him, IIRC this has happened before?? If not, you could just add 
a tiny downloader that grabs the zip file on the clients 
machine, which contains everything you need with no 
installation necessary.


Yeah, I guess I can put this in a script that will check 
everytime the program is run if dmd (or gdc etc) exists, and if 
not go and download it.


Thanks for the info folks!



Re: Shipping the DMD compiler with code

2013-11-01 Thread Colin Grogan
On Friday, 1 November 2013 at 16:12:10 UTC, Joseph Rushton 
Wakeling wrote:

On 01/11/13 17:01, bearophile wrote:
I think you are not allowed to redistribute the DMD compiler. 
So you have to use

GDC or LDC (where LDC = LDC2).


Many things are possible if you get permission from the right 
person ... :-)


Depending on the use-case it may be preferable to ship GDC or 
LDC anyway, but if DMD is desired, ask Walter directly.  The 
worst that can happen is he says no (and if he does, it'll most 
likely be because his hands are tied).


Theres should be no issue in using gdc, and I wouldn't like to 
hassle Walter with that. He should be busy making fixing bugs in 
the new dmd release anyway! ;)


Re: Shipping the DMD compiler with code

2013-11-01 Thread John Colvin

On Friday, 1 November 2013 at 15:47:56 UTC, Colin Grogan wrote:
I have a project I may need to write that is pretty performance 
intensive, but also needs to be quite customiseable.


We previously had this done with Perl, and the customising came 
from adding functions to a file and the main script would call 
those functions as required.

Problem is, the Perl program is performing very slowly.

Im thinking of doing this with D, and using string mixins to 
add in customised functions at compile time. All well and good 
I think.


However, I dont want to have the hassle of telling users to 
install a D compiler on their systems.
Ideally, the user should be able to unzip this tool and run it 
with rdmd.


Is it possible to ship the D compiler with the code, and not 
have to worry about any libs and config files being missing?


I'm specifically thinking about libphobos.a and dmd.conf, can 
they just be in the same folder as the D compiler or do they 
need to be in /usr/lib and /etc ?


Thanks folks!


dmd.conf can be in the same folder as the dmd executable. All the 
rest of the linking etc. is specified in dmd.conf so you just 
need to set that up appropriately.


The legal side of things is a different matter. I quote from 
src/backendlicense.txt : "The Software is copyrighted and comes 
with a single user license, and may not be redistributed. If you 
wish to obtain a redistribution license, please contact Digital 
Mars."


Walter may be able to grant redistribution rights if you ask him, 
IIRC this has happened before?? If not, you could just add a tiny 
downloader that grabs the zip file on the clients machine, which 
contains everything you need with no installation necessary.


Re: Shipping the DMD compiler with code

2013-11-01 Thread Joseph Rushton Wakeling

On 01/11/13 17:01, bearophile wrote:

I think you are not allowed to redistribute the DMD compiler. So you have to use
GDC or LDC (where LDC = LDC2).


Many things are possible if you get permission from the right person ... :-)

Depending on the use-case it may be preferable to ship GDC or LDC anyway, but if 
DMD is desired, ask Walter directly.  The worst that can happen is he says no 
(and if he does, it'll most likely be because his hands are tied).


Re: Shipping the DMD compiler with code

2013-11-01 Thread bearophile

Colin Grogan:

Is it possible to ship the D compiler with the code, and not 
have to worry about any libs and config files being missing?


I think you are not allowed to redistribute the DMD compiler. So 
you have to use GDC or LDC (where LDC = LDC2).


Bye,
bearophile