www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - How is the D programming language financed?

reply Thomas Mader <thomas.mader gmail.com> writes:
I would be interested in how the D programming language is financed as a 
project?
As it seems the core projects at the moment are dmd, druntime and phobos.
All of these are in a very active state with multiple contributors when 
judging the revision logs.

I guess many of these contributors are volunteers but are there also 
people who get somehow money for their work?

It's conceivable that Andrei, Walter and others get money for talks they 
give but is there anybody who can work on D fulltime without the need to 
do a daytime job beside it?

I know that Andrei works as a research scientist for Facebook but how do 
other main contributors get their money?

I wonder how people can manage to work on a fulltime job and on D.

Who pays the needed infrastructure?

Thomas
Dec 23 2010
next sibling parent reply Justin Johansson <noreply jj.com> writes:
On 23/12/10 22:06, Thomas Mader wrote:
 I would be interested in how the D programming language is financed as a
 project?
 As it seems the core projects at the moment are dmd, druntime and phobos.
 All of these are in a very active state with multiple contributors when
 judging the revision logs.

 I guess many of these contributors are volunteers but are there also
 people who get somehow money for their work?

 It's conceivable that Andrei, Walter and others get money for talks they
 give but is there anybody who can work on D fulltime without the need to
 do a daytime job beside it?

 I know that Andrei works as a research scientist for Facebook but how do
 other main contributors get their money?

 I wonder how people can manage to work on a fulltime job and on D.

 Who pays the needed infrastructure?

 Thomas
Hi Thomas, You could give some credence to your post that you are simply not trolling by first posting a reasonable D language question on D.learn. Cheers Justin
Dec 23 2010
next sibling parent reply Thomas Mader <thomas.mader gmail.com> writes:
Am 2010-12-23 13:57, schrieb Justin Johansson:
 On 23/12/10 22:06, Thomas Mader wrote:
 I would be interested in how the D programming language is financed as a
 project?
 As it seems the core projects at the moment are dmd, druntime and phobos.
 All of these are in a very active state with multiple contributors when
 judging the revision logs.

 I guess many of these contributors are volunteers but are there also
 people who get somehow money for their work?

 It's conceivable that Andrei, Walter and others get money for talks they
 give but is there anybody who can work on D fulltime without the need to
 do a daytime job beside it?

 I know that Andrei works as a research scientist for Facebook but how do
 other main contributors get their money?

 I wonder how people can manage to work on a fulltime job and on D.

 Who pays the needed infrastructure?

 Thomas
Hi Thomas, You could give some credence to your post that you are simply not trolling by first posting a reasonable D language question on D.learn. Cheers Justin
Well after reading through my post again I must admit that it can be misunderstood in that direction. But trolling is clearly not my intention. Maybe it helps if I write more about my background with D. I wrote two apps with D 1 (Sudoku with GtkD and a ping utility for pinging thousands of randomly generated IPs). After that I lost D out of my focus because everything seemed to be dead or dying. This summer I got interested in D again because of "The D Programming language" book and realized that the development of the core D projects occur in a much more open way and afaik more people working on it than before. This was a major improvement over the days were I lost my focus and it was also one of the biggest complaints about the future for D discussions. As it is now I still think that D is a very nice language and the project took many important hurdles over the time. But I tracked many open source projects over the years and realized that projects without paid developers are unstable and can easily die. Since this stability is a major decision criterion for choosing a programming language for everybody and even more important for companies I would be very interested in it. I think it's very important for D to step into the corporate world to get more stability, a bigger community and therefore a stronger toolchain. For this to happen companies need trust in the future of the project and the future are the people and the infrastructure behind D. If that is all on a solid foundation and communicate this foundation to the community it will be a big win. Thomas
Dec 23 2010
parent reply spir <denis.spir gmail.com> writes:
On Thu, 23 Dec 2010 17:41:06 +0100
Thomas Mader <thomas.mader gmail.com> wrote:

 I think it's very important for D to step into the corporate world to=20
 get more stability, a bigger community and therefore a stronger toolchain.
 For this to happen companies need trust in the future of the project and=
=20
 the future are the people and the infrastructure behind D.
This is true, but having important corporate investment would also strongly= freeze the language in a premature state. It's too early (for D2). Denis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 spir.wikidot.com
Dec 23 2010
parent reply Thomas Mader <thomas.mader gmail.com> writes:
Am 2010-12-23 21:01, schrieb spir:
 On Thu, 23 Dec 2010 17:41:06 +0100
 Thomas Mader<thomas.mader gmail.com>  wrote:

 I think it's very important for D to step into the corporate world to
 get more stability, a bigger community and therefore a stronger toolchain.
 For this to happen companies need trust in the future of the project and
 the future are the people and the infrastructure behind D.
This is true, but having important corporate investment would also strongly freeze the language in a premature state. It's too early (for D2). Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.com
I agree but I must confess that I'm confused about the state of D2. It's said that for new projects someone should use D2 but I often recognize that it is not considered ready/finished yet. On the other hand I also read somewhere that with the release of the book "The D programming language" D2 is finalized? Can somebody please enlighten me on this? Thomas
Dec 23 2010
next sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Thursday 23 December 2010 12:43:11 Thomas Mader wrote:
 Am 2010-12-23 21:01, schrieb spir:
 On Thu, 23 Dec 2010 17:41:06 +0100
=20
 Thomas Mader<thomas.mader gmail.com>  wrote:
 I think it's very important for D to step into the corporate world to
 get more stability, a bigger community and therefore a stronger
 toolchain. For this to happen companies need trust in the future of the
 project and the future are the people and the infrastructure behind D.
=20 This is true, but having important corporate investment would also strongly freeze the language in a premature state. It's too early (for D2). =20 Denis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 =20 spir.wikidot.com
=20 I agree but I must confess that I'm confused about the state of D2. It's said that for new projects someone should use D2 but I often recognize that it is not considered ready/finished yet. On the other hand I also read somewhere that with the release of the book "The D programming language" D2 is finalized? =20 Can somebody please enlighten me on this?
With the release of TDPL, the D spec is no longer undergoing massive change= s=20 with each release. It is mostly finalized. However, there have been some is= sues=20 that have come up or which were not 100% sorted out prior to TDPL being=20 released, so some changes to the spec may be made. They will, however, only= be=20 made as necessary, and there shouldn't be very many of them. Also, they'd m= ostly=20 deal with fancier features such as inout or alias this. That being said, regardless of the state of the spec, there's the state of = the=20 compiler and the standard libraries. The compiler continues to progress, bu= t it=20 has plenty of bugs in it still, and it has yet to implement everything in T= DPL=20 (e.g. you can currently only have one alias this per class or struct instea= d of=20 multiple like TDPL says), though it has implemented almost all of it. The=20 compiler is stable enough that you should be able to write code in it - eve= n for=20 larger projects - just fine. But you will run into bugs. So, if you want ro= ck- solid stability, then it's not up-to-snuff yet. But it works quite well ove= rall,=20 and many consider the benefits to far outweigh the problems. And the compil= er=20 continues to improve with each release, so the number of problems is=20 diminishing. Phobos, however, continues to be in flux and is definitely not finalized. M= uch of=20 it is pretty fixed and won't be undergoing major changes, but other parts w= ill=20 continue to change as development continues. Some modules will be removed=20 (though not many) and others will be added. The release of TDPL did not ind= icate=20 the finalization of Phobos at all. Phobos is very much still a work in prog= ress.=20 So, while you can mostly rely on it not changing enough to force you to cha= nge=20 code with a new compiler release, it definitely does happen at least some o= f the=20 time. So, D2 is definitely ready for use, but it's still rough around the edges.= =20 Whether it's appropriate or not far a particular project likely depends on = how=20 mission critical the project is. =2D Jonathan M Davis
Dec 23 2010
prev sibling next sibling parent reply "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Thu, 23 Dec 2010 15:43:11 -0500, Thomas Mader <thomas.mader gmail.com>  
wrote:

 Am 2010-12-23 21:01, schrieb spir:
 On Thu, 23 Dec 2010 17:41:06 +0100
 Thomas Mader<thomas.mader gmail.com>  wrote:

 I think it's very important for D to step into the corporate world to
 get more stability, a bigger community and therefore a stronger  
 toolchain.
 For this to happen companies need trust in the future of the project  
 and
 the future are the people and the infrastructure behind D.
This is true, but having important corporate investment would also strongly freeze the language in a premature state. It's too early (for D2). Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.com
I agree but I must confess that I'm confused about the state of D2. It's said that for new projects someone should use D2 but I often recognize that it is not considered ready/finished yet. On the other hand I also read somewhere that with the release of the book "The D programming language" D2 is finalized?
The book describes the concepts that D2 will implement. In that respect, TDPL's word is final (mostly). It does not mean the reference compiler properly implements those concepts. There are still several concepts (alias this and inout come to mind) which are not implemented well at all. In particular, the book makes very little mention of Phobos, which is still being changed profusely. I'd say D2 is good enough for toy projects, and if you find bugs, they can help us make it better. But if you want to make a serious large project and don't want to deal with instability, I'd recommend using D1, but you may find D1 Phobos quite lacking. I can't really recommend Tango due to possible taint issues, but you may find that an acceptable alternative. -Steve
Dec 23 2010
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/23/10 3:21 PM, Steven Schveighoffer wrote:
 On Thu, 23 Dec 2010 15:43:11 -0500, Thomas Mader
 <thomas.mader gmail.com> wrote:

 Am 2010-12-23 21:01, schrieb spir:
 On Thu, 23 Dec 2010 17:41:06 +0100
 Thomas Mader<thomas.mader gmail.com> wrote:

 I think it's very important for D to step into the corporate world to
 get more stability, a bigger community and therefore a stronger
 toolchain.
 For this to happen companies need trust in the future of the project
 and
 the future are the people and the infrastructure behind D.
This is true, but having important corporate investment would also strongly freeze the language in a premature state. It's too early (for D2). Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.com
I agree but I must confess that I'm confused about the state of D2. It's said that for new projects someone should use D2 but I often recognize that it is not considered ready/finished yet. On the other hand I also read somewhere that with the release of the book "The D programming language" D2 is finalized?
The book describes the concepts that D2 will implement. In that respect, TDPL's word is final (mostly). It does not mean the reference compiler properly implements those concepts. There are still several concepts (alias this and inout come to mind) which are not implemented well at all. In particular, the book makes very little mention of Phobos, which is still being changed profusely. I'd say D2 is good enough for toy projects, and if you find bugs, they can help us make it better. But if you want to make a serious large project and don't want to deal with instability, I'd recommend using D1, but you may find D1 Phobos quite lacking. I can't really recommend Tango due to possible taint issues, but you may find that an acceptable alternative.
I wonder how stable D2 is when used as a "better D1", i.e. making conservative use of new features. I think the bread and butter support is as rock solid in both languages. Andrei
Dec 23 2010
next sibling parent reply Adam D. Ruppe <destructionator gmail.com> writes:
Andrei Alexandrescu wrote:
 I think the bread and butter support
 is as rock solid in both languages.
I agree. For my day to day work, I'm pretty conservative in the use of the language; 90% of my code is probably best characterized as "a better C". Interestingly though, I use a template of some sort about once every five lines... Variant.get, std.conv.to, my own mysql.query, and several other little ones get heavy, but discreet use.) Anyway, I very rarely encounter D bugs in any of the code, and virtually never in that simpler bulk of it. The edges may be rough, but the core kicks ass. I've spent less time fighting bugs in the last year of D than I did reading php.net/strpos and php.net/str_replace in the previous year of PHP!
Dec 23 2010
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/23/10 4:49 PM, Adam D. Ruppe wrote:
 Andrei Alexandrescu wrote:
 I think the bread and butter support
 is as rock solid in both languages.
I agree. For my day to day work, I'm pretty conservative in the use of the language; 90% of my code is probably best characterized as "a better C". Interestingly though, I use a template of some sort about once every five lines... Variant.get, std.conv.to, my own mysql.query, and several other little ones get heavy, but discreet use.) Anyway, I very rarely encounter D bugs in any of the code, and virtually never in that simpler bulk of it. The edges may be rough, but the core kicks ass. I've spent less time fighting bugs in the last year of D than I did reading php.net/strpos and php.net/str_replace in the previous year of PHP!
This post is a breath of fresh air (as is the subsequent expanded one). There's a risk on this newsgroup to get stuck in a sort of limbo mode, in which the analysis of increasingly narrow corner cases loses focus on a few larger issues. Granted, we _must_ leave no nooks and crannies unexplored, but we also shouldn't spend disproportionate amounts of time on those at the expense of getting work done in D. D is a great language to work in /right now/. It has amazing capabilities, allows defining complex designs with ease, and it's a pleasure to code in overall. We need a fair amount of more good quality libraries, most of which can be written with the current implementation of the language. We could also use success stories of use of language for writing compelling programs. All of these are possible _today_ even if e.g. lazily updated (memoized) members in otherwise const structs and classes are not yet available. Spending inordinate time worrying about fractal details may take one to the point where all work is paralyzed by endless dwell in the "design study" land. As inevitably most design decisions involve tradeoffs, the one way to see if it all works is to get work done in the language. Andrei
Dec 27 2010
parent reply Jeff Nowakowski <jeff dilacero.org> writes:
On 12/27/2010 02:16 PM, Andrei Alexandrescu wrote:
 There's a risk on this newsgroup to get stuck in a sort of limbo mode,
 in which the analysis of increasingly narrow corner cases loses focus on
 a few larger issues. Granted, we _must_ leave no nooks and crannies
 unexplored, but we also shouldn't spend disproportionate amounts of time
 on those at the expense of getting work done in D.
Funny, I thought the people trying to write const correct libraries and multithreaded programs were trying to get work done in D. Immutability was supposed to be the crown jewel of D2. Given your past statements, and the recent statements backing down on immutability, especially as it is used in Phobos, a thought occurred to me: Rename D2 to Icarus, backport the "amazing", working parts of D2 to D1, and rename that to C++0x. Everybody wins. Sorry to pick on you, Andrei, but with leadership comes responsibility. I also believe in truth in advertising. Walter can't tout immutability as a bullet point if it isn't working, has unresolved design issues, and you yourself have backed away from it.
Dec 27 2010
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/27/10 2:48 PM, Jeff Nowakowski wrote:
 On 12/27/2010 02:16 PM, Andrei Alexandrescu wrote:
 There's a risk on this newsgroup to get stuck in a sort of limbo mode,
 in which the analysis of increasingly narrow corner cases loses focus on
 a few larger issues. Granted, we _must_ leave no nooks and crannies
 unexplored, but we also shouldn't spend disproportionate amounts of time
 on those at the expense of getting work done in D.
Funny, I thought the people trying to write const correct libraries and multithreaded programs were trying to get work done in D. Immutability was supposed to be the crown jewel of D2. Given your past statements, and the recent statements backing down on immutability, especially as it is used in Phobos, a thought occurred to me: Rename D2 to Icarus, backport the "amazing", working parts of D2 to D1, and rename that to C++0x. Everybody wins. Sorry to pick on you, Andrei, but with leadership comes responsibility. I also believe in truth in advertising. Walter can't tout immutability as a bullet point if it isn't working, has unresolved design issues, and you yourself have backed away from it.
I don't feel you're picking on me but I confess it's difficult to distinguish the good signal in your posts from attempts at irony. There are also a number of unstated assumptions that are plain wrong. First, to the best of my knowledge immutability has only implementation, not design, issues. As both Walter and I mentioned, those issues are slated to be solved after the 64-bit version is out. Second, I find it difficult to reconcile my past actions with the notion of irresponsibility. Third, immutability is not the central feature of D2 as much as aftermath of no default sharing. Fourth, my "backing away" on immutability is a disingenuous reframing of the simple fact I mentioned: immutability and const offer stronger guarantees than C++'s const and as a direct consequence it will be used less than it. This was in response to people's attempts to directly carry C++'s const-based idioms to D. I'd be glad to continue this dialog if we could focus on productive topics that are likely to push things towards the better. Thanks. Andrei
Dec 27 2010
prev sibling parent Daniel Gibson <metalcaedes gmail.com> writes:
Am 23.12.2010 23:18, schrieb Andrei Alexandrescu:
 I wonder how stable D2 is when used as a "better D1", i.e. making
 conservative use of new features. I think the bread and butter support
 is as rock solid in both languages.
Depends on what parts of Phobos you use, I guess. For example the streams and sockets are as suboptimal[1] as in D1/Phobos1, so one may prefer D1/Tango for that. Cheers, - Daniel
Dec 23 2010
prev sibling next sibling parent reply Caligo <iteronvexor gmail.com> writes:
You got me excited, so I decided to give GDC another try.  I cloned the
repo, and using GCC 4.4.5, it compiled without errors.
I started following the examples in TDPL, but the Stat program on page 22
gives the following errors:

t1.d:33: Error: void has no value
t1.d:33: Error: incompatible types for ((readf(" %s ",& x)) =3D=3D (1)): 'v=
oid'
and 'int'

is there a typo in the code, or is this some kind of bug in GDC?

On Thu, Dec 23, 2010 at 3:16 PM, Jonathan M Davis <jmdavisProg gmx.com>wrot=
e:

 On Thursday 23 December 2010 12:43:11 Thomas Mader wrote:
 Am 2010-12-23 21:01, schrieb spir:
 On Thu, 23 Dec 2010 17:41:06 +0100

 Thomas Mader<thomas.mader gmail.com>  wrote:
 I think it's very important for D to step into the corporate world t=
o
 get more stability, a bigger community and therefore a stronger
 toolchain. For this to happen companies need trust in the future of
the
 project and the future are the people and the infrastructure behind =
D.
 This is true, but having important corporate investment would also
 strongly freeze the language in a premature state. It's too early (fo=
r
 D2).

 Denis
 -- -- -- -- -- -- --
 vit esse estrany =E2=98=A3

 spir.wikidot.com
I agree but I must confess that I'm confused about the state of D2. It's said that for new projects someone should use D2 but I often recognize that it is not considered ready/finished yet. On the other hand I also read somewhere that with the release of the book "The D programming language" D2 is finalized? Can somebody please enlighten me on this?
With the release of TDPL, the D spec is no longer undergoing massive changes with each release. It is mostly finalized. However, there have been some issues that have come up or which were not 100% sorted out prior to TDPL being released, so some changes to the spec may be made. They will, however, on=
ly
 be
 made as necessary, and there shouldn't be very many of them. Also, they'd
 mostly
 deal with fancier features such as inout or alias this.

 That being said, regardless of the state of the spec, there's the state o=
f
 the
 compiler and the standard libraries. The compiler continues to progress,
 but it
 has plenty of bugs in it still, and it has yet to implement everything in
 TDPL
 (e.g. you can currently only have one alias this per class or struct
 instead of
 multiple like TDPL says), though it has implemented almost all of it. The
 compiler is stable enough that you should be able to write code in it -
 even for
 larger projects - just fine. But you will run into bugs. So, if you want
 rock-
 solid stability, then it's not up-to-snuff yet. But it works quite well
 overall,
 and many consider the benefits to far outweigh the problems. And the
 compiler
 continues to improve with each release, so the number of problems is
 diminishing.

 Phobos, however, continues to be in flux and is definitely not finalized.
 Much of
 it is pretty fixed and won't be undergoing major changes, but other parts
 will
 continue to change as development continues. Some modules will be removed
 (though not many) and others will be added. The release of TDPL did not
 indicate
 the finalization of Phobos at all. Phobos is very much still a work in
 progress.
 So, while you can mostly rely on it not changing enough to force you to
 change
 code with a new compiler release, it definitely does happen at least some
 of the
 time.

 So, D2 is definitely ready for use, but it's still rough around the edges=
.
 Whether it's appropriate or not far a particular project likely depends o=
n
 how
 mission critical the project is.

 - Jonathan M Davis
Dec 23 2010
parent reply Iain Buclaw <ibuclaw ubuntu.com> writes:
== Quote from Caligo (iteronvexor gmail.com)'s article
 --001636e0a9cc00219904981c2ad9
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: quoted-printable
 You got me excited, so I decided to give GDC another try.  I cloned the
 repo, and using GCC 4.4.5, it compiled without errors.
 I started following the examples in TDPL, but the Stat program on page 22
 gives the following errors:
 t1.d:33: Error: void has no value
 t1.d:33: Error: incompatible types for ((readf(" %s ",& x)) =3D=3D (1)): 'v=
 oid'
 and 'int'
 is there a typo in the code, or is this some kind of bug in GDC?
Hard to say without the code example, however, what I can say is that the error is emitted from the DMD frontend, and not the GDC glue/GCC backend. Regards
Dec 23 2010
parent Iain Buclaw <ibuclaw ubuntu.com> writes:
== Quote from Iain Buclaw (ibuclaw ubuntu.com)'s article
 == Quote from Caligo (iteronvexor gmail.com)'s article
 --001636e0a9cc00219904981c2ad9
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: quoted-printable
 You got me excited, so I decided to give GDC another try.  I cloned the
 repo, and using GCC 4.4.5, it compiled without errors.
 I started following the examples in TDPL, but the Stat program on page 22
 gives the following errors:
 t1.d:33: Error: void has no value
 t1.d:33: Error: incompatible types for ((readf(" %s ",& x)) =3D=3D (1)): 'v=
 oid'
 and 'int'
 is there a typo in the code, or is this some kind of bug in GDC?
Hard to say without the code example, however, what I can say is that the error is emitted from the DMD frontend, and not the GDC glue/GCC backend. Regards
Looking at phobos, I see this: void readf(A...)(in char[] format, A args) Regards
Dec 23 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 12/24/10, Caligo <iteronvexor gmail.com> wrote:
 You got me excited, so I decided to give GDC another try.  I cloned the
 repo, and using GCC 4.4.5, it compiled without errors.
 I started following the examples in TDPL, but the Stat program on page 22
 gives the following errors:

 t1.d:33: Error: void has no value
 t1.d:33: Error: incompatible types for ((readf(" %s ",& x)) == (1)): 'void'
 and 'int'

 is there a typo in the code, or is this some kind of bug in GDC?
Use stdin.readf: import std.exception, std.stdio; void main(string[] args) { for (double x; stdin.readf(" %s ", &x) == 1; ) { } } The TDPL errata is here btw, that bug is listed: http://erdani.com/tdpl/errata/index.php?title=Main_Page
Dec 23 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 12/24/10, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:
 Use stdin.readf:
And don't forget to catch those exceptions! import std.exception, std.stdio, std.conv; void main(string[] args) { try { for (double x; stdin.readf(" %s ", &x) == 1;) { writeln(x); // or was it stat.postprocess? :) } } catch (ConvException) { } } That should do it.
Dec 23 2010
prev sibling parent reply Caligo <iteronvexor gmail.com> writes:
On Thu, Dec 23, 2010 at 5:38 PM, Andrej Mitrovic <andrej.mitrovich gmail.com
 wrote:
 On 12/24/10, Caligo <iteronvexor gmail.com> wrote:
 You got me excited, so I decided to give GDC another try.  I cloned the
 repo, and using GCC 4.4.5, it compiled without errors.
 I started following the examples in TDPL, but the Stat program on page 22
 gives the following errors:

 t1.d:33: Error: void has no value
 t1.d:33: Error: incompatible types for ((readf(" %s ",& x)) == (1)):
'void'
 and 'int'

 is there a typo in the code, or is this some kind of bug in GDC?
Use stdin.readf: import std.exception, std.stdio; void main(string[] args) { for (double x; stdin.readf(" %s ", &x) == 1; ) { } } The TDPL errata is here btw, that bug is listed: http://erdani.com/tdpl/errata/index.php?title=Main_Page
great, that fixed the problem. I was actually trying to find the errata too, so thanks for that. The example compiles but it throws an exception:
 echo 3 4 6.6 7.7 33.4 | ./t1 Min Max Average
object.Exception 3030object.Exception 30
Dec 23 2010
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/23/10 5:50 PM, Caligo wrote:
 On Thu, Dec 23, 2010 at 5:38 PM, Andrej Mitrovic
 <andrej.mitrovich gmail.com <mailto:andrej.mitrovich gmail.com>> wrote:

     On 12/24/10, Caligo <iteronvexor gmail.com
     <mailto:iteronvexor gmail.com>> wrote:
      > You got me excited, so I decided to give GDC another try.  I
     cloned the
      > repo, and using GCC 4.4.5, it compiled without errors.
      > I started following the examples in TDPL, but the Stat program on
     page 22
      > gives the following errors:
      >
      > t1.d:33: Error: void has no value
      > t1.d:33: Error: incompatible types for ((readf(" %s ",& x)) ==
     (1)): 'void'
      > and 'int'
      >
      > is there a typo in the code, or is this some kind of bug in GDC?

     Use stdin.readf:

     import std.exception, std.stdio;
     void main(string[] args) {
       for (double x; stdin.readf(" %s ", &x) == 1; ) {
       }
     }

     The TDPL errata is here btw, that bug is listed:
     http://erdani.com/tdpl/errata/index.php?title=Main_Page



 great, that fixed the problem.  I was actually trying to find the errata
 too, so thanks for that.

 The example compiles but it throws an exception:

  >> echo 3 4 6.6 7.7 33.4 | ./t1 Min Max Average
 object.Exception 3030object.Exception 30
Would you mind posting the entire code? Thanks. Andrei
Dec 23 2010
parent reply Caligo <iteronvexor gmail.com> writes:
I hope I didn't miss anything; I copied it from the book.

import std.stdio, std.exception;

interface Stat{
    void accumulate(double x);
    void postprocess();
    double result();
}

class Min : Stat{
    private double min = double.max;
    void accumulate(double x){
        if( x < min ){
        min = x;
        }
    }

    void postprocess(){ }
    double result(){
        return min;
    }
}

void main(string[] args){

     Stat[] stats;
     foreach(arg; args[1 .. $]){
               auto newStat = cast(Stat) Object.factory("stats." ~ arg);
          enforce(newStat, "Invalid statistics function: " ~ arg);
          stats ~= newStat;
      }
      for(double x; stdin.readf(" %s ", &x) == 1; ){
               foreach(s; stats){
                 s.accumulate(x);
        }
       }
      foreach(s; stats){
               s.postprocess();
         writeln(s.result());
      }
}


On Thu, Dec 23, 2010 at 6:04 PM, Andrei Alexandrescu <
SeeWebsiteForEmail erdani.org> wrote:

 On 12/23/10 5:50 PM, Caligo wrote:

 On Thu, Dec 23, 2010 at 5:38 PM, Andrej Mitrovic
 <andrej.mitrovich gmail.com <mailto:andrej.mitrovich gmail.com>> wrote:

    On 12/24/10, Caligo <iteronvexor gmail.com
    <mailto:iteronvexor gmail.com>> wrote:
     > You got me excited, so I decided to give GDC another try.  I
    cloned the
     > repo, and using GCC 4.4.5, it compiled without errors.
     > I started following the examples in TDPL, but the Stat program on
    page 22
     > gives the following errors:
     >
     > t1.d:33: Error: void has no value
     > t1.d:33: Error: incompatible types for ((readf(" %s ",& x)) ==
    (1)): 'void'
     > and 'int'
     >
     > is there a typo in the code, or is this some kind of bug in GDC?

    Use stdin.readf:

    import std.exception, std.stdio;
    void main(string[] args) {
      for (double x; stdin.readf(" %s ", &x) == 1; ) {
      }
    }

    The TDPL errata is here btw, that bug is listed:
    http://erdani.com/tdpl/errata/index.php?title=Main_Page



 great, that fixed the problem.  I was actually trying to find the errata

 too, so thanks for that.

 The example compiles but it throws an exception:

  >> echo 3 4 6.6 7.7 33.4 | ./t1 Min Max Average
 object.Exception 3030object.Exception 30
Would you mind posting the entire code? Thanks. Andrei
Dec 23 2010
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/23/10 6:11 PM, Caligo wrote:
 I hope I didn't miss anything; I copied it from the book.
Looking good, I reproduced the exception as a miscommunication between readf and parse. Give me a little time to look into this. Andrei
Dec 23 2010
prev sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/23/10 6:11 PM, Caligo wrote:
 I hope I didn't miss anything; I copied it from the book.
[snip] http://www.dsource.org/projects/phobos/changeset/2233 Don't forget to call your program stats.d or put a module stats declaration at its top. Andrei
Dec 23 2010
next sibling parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 12/24/10, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:
 Don't forget to call your program stats.d or put a module stats
 declaration at its top.

 Andrei
Hardcoding module names in our code?! I beg to differ, sir! module testmodule; import std.string : split; import std.stdio : writeln; string modulename = split(.stringof)[1]; void main() { writeln(modulename); }
Dec 23 2010
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/23/10 9:35 PM, Andrej Mitrovic wrote:
 module testmodule;

 import std.string : split;
 import std.stdio : writeln;

 string modulename = split(.stringof)[1];

 void main()
 {
      writeln(modulename);
 }
What the... I didn't know you can do that. Thanks for the tip! Andrei
Dec 23 2010
next sibling parent reply spir <denis.spir gmail.com> writes:
On Thu, 23 Dec 2010 23:18:06 -0600
Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:

 module testmodule;

 import std.string : split;
 import std.stdio : writeln;

 string modulename =3D split(.stringof)[1];

 void main()
 {
      writeln(modulename);
 } =20
=20 What the... I didn't know you can do that. Thanks for the tip!
What is this syntactic form (".something")? Is there an explicit alternativ= e, with a prefix? Denis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 spir.wikidot.com
Dec 24 2010
parent Mafi <mafi example.org> writes:
Am 24.12.2010 10:41, schrieb spir:
 On Thu, 23 Dec 2010 23:18:06 -0600
 Andrei Alexandrescu<SeeWebsiteForEmail erdani.org>  wrote:

 module testmodule;

 import std.string : split;
 import std.stdio : writeln;

 string modulename = split(.stringof)[1];

 void main()
 {
       writeln(modulename);
 }
What the... I didn't know you can do that. Thanks for the tip!
What is this syntactic form (".something")? Is there an explicit alternative, with a prefix? Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.com
A leading dot means looking up at the module's scope. An explicit prefix would be the module name but then you're back at hardcoding the modulename. And stringof is a special property of everything (I think) which gives you a compile-time string out of it. Mafi
Dec 24 2010
prev sibling parent Max Samukha <spambox d-coding.com> writes:
On 12/24/2010 07:18 AM, Andrei Alexandrescu wrote:
 What the... I didn't know you can do that. Thanks for the tip!

 Andrei
It's great we can do that. Though it doesn't make D's compile-time introspection much easier to work with. For example, look how we get overloads of a function in the current module: void foo(int) {} void foo(int, int) {} template Alias(A...) { alias A Alias; } template Overloads(alias parent, string name) { alias Alias!(__traits(getOverloads, parent, name)) Overloads; } mixin("alias Overloads!(" ~ .stringof[7..$] ~ ", \"foo\") foos;"); For a simple use case like that, we have to exploit two hacks: 1. The Alias template is required since __traits cannot be used directly in the alias declaration. I believe this is a compiler bug. 2. We have to mixin the module identifier extracted from stringof instead of referencing the current module symbolically. With the special 'meta' namespace Don proposed long ago, the above example could probably be as simple as: alias meta.overloadsOf(meta.currentModule, "foo") foos;
Dec 24 2010
prev sibling next sibling parent Caligo <iteronvexor gmail.com> writes:
Thanks, Andrei. You're the best.

On Thu, Dec 23, 2010 at 9:14 PM, Andrei Alexandrescu <
SeeWebsiteForEmail erdani.org> wrote:

 On 12/23/10 6:11 PM, Caligo wrote:

 I hope I didn't miss anything; I copied it from the book.
[snip] http://www.dsource.org/projects/phobos/changeset/2233 Don't forget to call your program stats.d or put a module stats declaration at its top. Andrei
Dec 23 2010
prev sibling parent Caligo <iteronvexor gmail.com> writes:
I don't get it.  How is it able to get the name of the module like that?

On Thu, Dec 23, 2010 at 9:35 PM, Andrej Mitrovic <andrej.mitrovich gmail.com
 wrote:
 On 12/24/10, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:
 Don't forget to call your program stats.d or put a module stats
 declaration at its top.

 Andrei
Hardcoding module names in our code?! I beg to differ, sir! module testmodule; import std.string : split; import std.stdio : writeln; string modulename = split(.stringof)[1]; void main() { writeln(modulename); }
Dec 23 2010
prev sibling parent Eric Poggel <dnewsgroup2 yage3d.net> writes:
On 12/23/2010 7:57 AM, Justin Johansson wrote:
 On 23/12/10 22:06, Thomas Mader wrote:
 I would be interested in how the D programming language is financed as a
 project?
 As it seems the core projects at the moment are dmd, druntime and phobos.
 All of these are in a very active state with multiple contributors when
 judging the revision logs.

 I guess many of these contributors are volunteers but are there also
 people who get somehow money for their work?

 It's conceivable that Andrei, Walter and others get money for talks they
 give but is there anybody who can work on D fulltime without the need to
 do a daytime job beside it?

 I know that Andrei works as a research scientist for Facebook but how do
 other main contributors get their money?

 I wonder how people can manage to work on a fulltime job and on D.

 Who pays the needed infrastructure?

 Thomas
Hi Thomas, You could give some credence to your post that you are simply not trolling by first posting a reasonable D language question on D.learn. Cheers Justin
I thought his tone seemed genuine enough.
Dec 23 2010
prev sibling parent reply Adam D. Ruppe <destructionator gmail.com> writes:
Thomas Mader wrote:
 I guess many of these contributors are volunteers but
 are there also people who get somehow money for their work?
Yup. I use D almost exclusively in my professional work, and if something bugs me in the course of that, I fix it, and if applicable, submit the fix back upstream. Failing that, I put generally useful files on my server for public download. There's a variety of other little things that follow this same pattern: they are useful to my business, so I do them for personal profit, but they are useful to other people too so I make it public.
Dec 23 2010
parent reply Trass3r <un known.com> writes:
 Yup. I use D almost exclusively in my professional work
Wow how did you do that? People around here don't even know D exists.
Dec 24 2010
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
Trass3r wrote:
 Yup. I use D almost exclusively in my professional work
Wow how did you do that? People around here don't even know D exists.
One thing that helps me a lot is I'm an independent contractor, so as long as I give results, I have quite a bit of freedom in the specifics. Nevertheless, some clients still are reluctant to try something new. (Thankfully, the big one I've worked with for a year and a half was a fairly easy sell! I think the biggest help was his existing codebase was written by monkeys so ditching almost all of it was a good decision no matter what language we used) Anyway, here's how I do it: 1) Be willing to spend my own time on it if something goes wrong. I spent quite a few weekends doing prepwork before introducing the big guy to D: I had to make sure it could replace PHP for the bulk of the project while still being able to talk to PHP to fill the gaps of what it couldn't do. 2) Write D in a conservative style. Not only does it reduce the likelyhood of hitting a bug, it also reassures them that any decent programmer can follow along if you leave. If they look at it and say "oh looks like a better Java" or "cool, better C", you're on solid ground - odds are Java and C programmers can follow along with minimal training, which means finding a replacement to maintain the code is easy. But if they look at it and say "WTF" you're out. Ease into the new features of D. Even being very conservative, you'll see big boosts over straight up old language so it is still a huge plus to use D. I've also found that a surprising number of people have actually heard of D. I've had three different clients, when I approached them on D, ask their programmers and get a positive feeling about it. "My guy said he's heard of it and been wanting to try it..." here's your chance! 3) Don't be afraid to call C libraries! extern(C) is one of your best friends. It proves that you can access a great deal of existing code with ease, putting the library worries away, and you can write using pretty familiar APIs, so their team is right at home. 4) Emphasize D's strengths as you talk. Even if it is little, draw some attention to it. Make sure they know the move to D provided direct benefits. (And no need to mention D bugs if you do encounter them, just work around it, but they really are rare and easy to work around in conservative code.) An example of this, I point out compile errors in chats. "Thanks to D's static assert, we can deploy to a new customer with confidence that all needed configuration values are set before testing." In short, ease them into it and reassure them that it is a low risk, beneficial change. Start small, with something like helper scripts before trying to introduce it into a bigger project, so they know it can and has done real work for them before.
Dec 24 2010
parent Walter Bright <newshound2 digitalmars.com> writes:
Adam D. Ruppe wrote:
 In short, ease them into it and reassure them that it is a low risk,
 beneficial change. Start small, with something like helper scripts
 before trying to introduce it into a bigger project, so they know
 it can and has done real work for them before.
Thanks for letting us know about this. Good stuff!
Dec 24 2010