Re: Why Ruby?

2010-12-17 Thread Caligo
People have indeed designed and implemented very big software systems using
"one of those so called not so complex languages".
What people have not done is write anything meaningful of any size in D.
The main reason for that is that, after so many years, there is still no
decent D compiler, nothing near GCC quality, to be found.  For such a
complex language as D, there are sure too many compilers and "standard"
libraries, none of which are stable, up-to-date, or usable enough.  GCC is
the gold standard (for openness, quality, and user-base), and it seems D
won't make it in till 2012.  So, we're still years away from the "big D
software".  According to Ohloh, there is currently a total of 16 million
lines of code written in D.  Compare that to 70 million for Ruby, and 160
million for Python.  And that's only for open source projects that Ohloh
keeps track of.  The count is in billions for C/C++.

What I don't understand is this: how is it that Walter was able to implement
C++ all on his own from scratch, and yet D is having so many issues?  How
complex is D really?

2010/12/17 so 

> Please, please, please, look back at what you've done and think hard if it
>> is
>> really the right way to go. Everything seems overly complex by now.
>>
>> 
>>
>
> Can you name a single language as powerful and as expressive as D and
> doesn't have complexity?
> Just name one, Walter and Andrei would be the first one to migrate that
> language i am sure.
> Everyone on this thread must read the D overview on the main page.
>
> People use this word "complexity" quite often. I don't think i get what
> they mean with that really.
> Go write a big software using one of those so called "not so complex"
> languages and lets talk about this word complexity again.
>
> Thank you.
>
> --
> Using Opera's revolutionary email client: http://www.opera.com/mail/
>


Re: Why Ruby?

2010-12-17 Thread Caligo
this, and that is why, no matter how formal, your writings are almost always
open for interpretation.  Interesting enough, if you notice when you are
talking to someone you're not actually talking to them, but, rather, at
them.  That's probably why scientists use mathematics to communicate.  I
haven't touched Ruby in over a year now, and I've been learning Python in my
free time.

Peace!



2010/12/17 so 

> On Sat, 18 Dec 2010 02:51:28 +0200, Caligo  wrote:
>
>  People have indeed designed and implemented very big software systems
>> using
>> "one of those so called not so complex languages".
>>
>
> Why don't you name one?
> I obviously wasn't clear enough with "big software".
> I don't know of any serious OS, game, 
> written in anything except C/C++ (both complex languages).
>
>
>  What people have not done is write anything meaningful of any size in D.
>> The main reason for that is that, after so many years, there is still no
>> decent D compiler, nothing near GCC quality, to be found.  For such a
>> complex language as D, there are sure too many compilers and "standard"
>> libraries, none of which are stable, up-to-date, or usable enough.  GCC is
>> the gold standard (for openness, quality, and user-base), and it seems D
>> won't make it in till 2012.  So, we're still years away from the "big D
>> software".  According to Ohloh, there is currently a total of 16 million
>> lines of code written in D.  Compare that to 70 million for Ruby, and 160
>> million for Python.  And that's only for open source projects that Ohloh
>> keeps track of.  The count is in billions for C/C++.
>>
>> What I don't understand is this: how is it that Walter was able to
>> implement
>> C++ all on his own from scratch, and yet D is having so many issues?  How
>> complex is D really?
>>
>
> I completely agree with you, Walter is a superman.
> But i guess he is not super enough, he couldn't even singlehandedly solve
> every programming issue known to man for last 50 years.
>
>
> --
> Using Opera's revolutionary email client: http://www.opera.com/mail/
>


Re: is it possible to learn D(2)?

2010-12-18 Thread Caligo
If there is going to be a D3, will it be backwards compatible with D2?

And why is work still being done on the D1 compiler?  Shouldn't it be marked
deprecated so people stop using it and move to D2?

Also, do you know if there are any plans to standardize the language?  Is
the specification complete?


On Sat, Dec 18, 2010 at 3:36 AM, Jonathan M Davis wrote:

> On Saturday 18 December 2010 01:14:19 Gour wrote:
> > Hello,
> >
> > Seeing all the threads here about improving D(2) syntax for different
> > features of the language, I just wonder if it's possible to learn D(2)
> > language which is so much in flux by using TDPL as reference?
> >
> > Now I may have some time to learn D(2), but wonder when will the
> > language become more stable or the proposals/improvements discussed
> > here (I skip over majority of such threads) are not major changes?
>
> TDPL is mostly correct. There are a few features that it discusses that
> either
> quite buggy or outright unimplemented (e.g. neither inout and alias this is
> completely implemented and some of what is implemented is rather buggy).
> There
> are also some features which may change. However, at this point, stuff is
> only
> going to change with a really good reason, and most of such changes are
> likely
> to be additive and wouldn't break much - if anything. For instance, weak
> purity
> is essentially an additive change. It makes it so that more functions can
> be
> marked as pure, but it doesn't make more functions optimizable due to
> purity,
> and it doesn't break any code.
>
> Prior to the release of TDPL, there were at times major changes between
> releases
> of dmd which broke a lot of code. That doesn't really happen anymore.
>
> For the most part, if you follow TDPL, you will be fine. Some stuff in TDPL
> won't
> work yet in practice, and it is possible that a few changes will be made to
> the
> language at some point which break current code and/or contradict TDPL. But
> no
> such changes have yet been made, I don't believe, and there are none which
> have
> been decided upon. None will be made without a definite, compelling reason,
> precisely because TDPL is supposed to be valid. D2 is not entirely stable,
> but
> it the spec is no longer in constant flux either.
>
> Some changes likely will happen, but only as necessary, and they're going
> to be
> rare. And as time passes, they will become even rarer.
>
> Some folks will continue to discuss possible features for D which will
> never
> make it into D2. If there is ever a D3, they may be included then, but
> stuff like
> non-nullable references is not going to make it into the language in D2
> (though
> there may be a library solution for it).
>
> Now, Phobos is certainly in flux. Parts of it are quite stable and won't be
> changing particularly, but there's plenty of it which will continue to
> evolve,
> and there will certainly be more stuff being added. Phobos is still very
> much a
> work in progress.
>
> Really, the biggest obstacle to D development at this point is likely
> simply
> bugs - be they in the compiler or in Phobos. The situation continues to
> improve,
> but there are bugs which pop up from time to time which can cause major
> headaches (like inout being totally broken at the moment). The language
> spec is
> essentially stable, but not necessarily set in stone. In almost all cases,
> you
> can rely on TDPL being correct. So, I wouldn't worry too much about that.
> Compiler bugs are far more likely to trip you up than any language changes.
> If
> and when they happen, they'll probably remove certain types of problems
> rather
> than causing much in the way of new ones anyway.
>
> - Jonathan M Davis
>


Re: Game development is worthless? WTF? (Was: Why Ruby?)

2010-12-19 Thread Caligo
You are absolutely right; life sucks for many people, and that's why some of
them choose to play video games.  It gives them a chance to escape reality,
and game companies exploit this to make money.  Game companies use all kinds
of psychology in their games to keep you playing as long as possible.  That
is why to me there is no honor in game development.  Also, I never said it's
worthless; they make tons of money, and that's almost always at the expense
of people like you.

If it helps any, I'm not one of those baby boomers.  I'm actually in my
early twenties.  So if you are going to insult me at least do it properly.

You sound way too angry and unhappy.  Instead of playing video games, you
should definitely pick up Ruby if you haven't already.  I hear it's
"designed to make programmers happy."



On Sat, Dec 18, 2010 at 2:03 PM, Nick Sabalausky  wrote:

> "Caligo"  wrote in message
> news:mailman.5.1292651710.4588.digitalmar...@puremagic.com...
> >
> > IMO there is no honor in game development as it contributes nothing to
> > society.  I've rarely played any,
>
> I gotta jump on this as being a giant load of pretentous bullshit. First of
> all, there's the patently obvious "how in the world would you know?"
> considering the "I've rarely played any".
>
> But more importantly, games make life suck less - I can't even imagine any
> more significant contribution to society than that. Even all of the
> endevors
> generally considered to be the biggest contributions to society are *only*
> significant contributions *because* that's exactly what they do: they make
> life suck less, and are therefore well-regarded.
>
> Seriously, what up with all those presumptuous assholes out there (mostly
> baby boomer dinos and their even more anachronistic parents, interestingly
> enough) who have barely ever touched a videogame and yet figure they
> actually have reason to believe such absurd pretentous crap? Fuck, they all
> remind me of that pompous Roger Ebert douchebag. (Speaking of ways to
> benefit society, when's he finally gonna keel over? Isn't it about time by
> now? And speaking of "contributions to society" what the fuck's he ever
> done? Collect a salary just to spout off opinions? Fucking useless wanker.)
>
>
>


Re: is it possible to learn D(2)?

2010-12-19 Thread Caligo
On Sun, Dec 19, 2010 at 10:16 AM, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:

> On 12/19/10 9:57 AM, Andrej Mitrovic wrote:
>
>> On 12/19/10, lurker  wrote:
>>
>>> Does this mean that Facebook is not paying you that well, after all? I
>>> could
>>>
>>> donate like $82 to you to give away three more books. No need to mention
>>> my
>>> name, after all I'm just helping the poor.
>>>
>>>
>> I'm pretty sure it means he got a couple of free books from the
>> publisher to give away for free. ;)
>>
>
> The main issue is perceived value. Books are not T-shirts as significant
> time would have to be spent on reading them. Say I had 40 people in the
> audience and 40 books. Then it would have been like passing around marketing
> samples of no perceived value.
>
>
> Andrei
>

That's almost like saying all documentations, books, and reference materials
licensed under GNU FDL are worthless because you don't have to pay for
them.  There are actually people who think that about FOSS; "eh, if it was
worth anything they wouldn't let you download the source code for free."

I actually think your book would have been worth more if you had released it
under GNU FDL or a similar license.


Re: Why Ruby?

2010-12-19 Thread Caligo
>
> Your only argument was that it's more difficult because it's more difficult
> and even the great lisp gods won't do that. Listen, we see through your
> bluff. Do I need to list you the names of 10 functional language compilers
> that actually do this optimization. It might even be the case that LDC
> optimizes this unlike DMD.
>


"Talk is cheap. Show me the code." --Linus Torvald


Re: How is the D programming language financed?

2010-12-23 Thread Caligo
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?

On Thu, Dec 23, 2010 at 3:16 PM, Jonathan M Davis wrote:

> 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  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?
>
> 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, only
> 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 of
> 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 on
> how
> mission critical the project is.
>
> - Jonathan M Davis
>


Re: How is the D programming language financed?

2010-12-23 Thread Caligo
On Thu, Dec 23, 2010 at 5:38 PM, Andrej Mitrovic  wrote:

> On 12/24/10, Caligo  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.except...@3030object.exception@30


Re: How is the D programming language financed?

2010-12-23 Thread Caligo
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 <
seewebsiteforem...@erdani.org> wrote:

> On 12/23/10 5:50 PM, Caligo wrote:
>
>>
>>
>> On Thu, Dec 23, 2010 at 5:38 PM, Andrej Mitrovic
>> mailto:andrej.mitrov...@gmail.com>> wrote:
>>
>>On 12/24/10, Caligo ><mailto:iteronve...@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.except...@3030object.exception@30
>>
>
> Would you mind posting the entire code? Thanks.
>
> Andrei
>


Re: How is the D programming language financed?

2010-12-23 Thread Caligo
Thanks, Andrei. You're the best.

On Thu, Dec 23, 2010 at 9:14 PM, Andrei Alexandrescu <
seewebsiteforem...@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
>


Re: How is the D programming language financed?

2010-12-23 Thread Caligo
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  wrote:

> On 12/24/10, Andrei Alexandrescu  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);
> }
>


TDPL dictionary example - ERROR with dmd and gdc

2010-12-24 Thread Caligo
I've been following the examples in the book and on page 8 we have this:

import std.stdio;
import std.string;

void main(){

 size_t[string] dictionary;
foreach(line; stdin.byLine()){
  foreach(word; splitter(strip(line))){
  if(word in dictionary) continue;
auto newID = dictionary.length;
  dictionary[word] = newID;
writeln(newID, '\t', word);
}
}
}

With the latest GDC, which I think uses the latest 2.051, I get this error:
dictionary.d:12: Error: associative arrays can only be assigned values with
immutable keys, not char[]

Someone told me on digitalmars-d.learn that it works with DMD, but I just
downloaded the latest DMD that was just released and I still get the same
error.

Is there a workaround to this? and why the error?


Re: TDPL dictionary example - ERROR with dmd and gdc

2010-12-24 Thread Caligo
ok, thanks.  And just a reminder that there is nothing about this on the
errata.



On Fri, Dec 24, 2010 at 11:51 AM, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:

> On 12/24/2010 11:35 AM, Caligo wrote:
>
>> I've been following the examples in the book and on page 8 we have this:
>>
>> import std.stdio;
>> import std.string;
>>
>> void main(){
>>
>>  size_t[string] dictionary;
>> foreach(line; stdin.byLine()){
>>   foreach(word; splitter(strip(line))){
>>   if(word in dictionary) continue;
>> auto newID = dictionary.length;
>>   dictionary[word] = newID;
>> writeln(newID, '\t', word);
>> }
>> }
>> }
>>
>> With the latest GDC, which I think uses the latest 2.051, I get this
>> error:
>> dictionary.d:12: Error: associative arrays can only be assigned values
>> with immutable keys, not char[]
>>
>> Someone told me on digitalmars-d.learn that it works with DMD, but I
>> just downloaded the latest DMD that was just released and I still get
>> the same error.
>>
>> Is there a workaround to this? and why the error?
>>
>
> Yah, this has been a long-standing issue. dmd has accepted for a while the
> code but produced incorrect results. Since then the bug has been fixed to
> refuse compilation.
>
> The problem is, line has type char[] and the map's key type is string, i.s.
> array of immutable char. To convert x to string you need to say either
> x.idup or to!string(x). In theory the compiler/library would be clever
> enough to do that automatically when necessary, but we decided against it
> for now.
>
> So: replace dictionary[word] with either dictionary[word.idup] or
> dictionary[to!string(word)]. A future printing will correct this mistake.
>
>
> Andrei
>


D vs C++

2010-12-24 Thread Caligo
This is the page that would require your attention:
http://unthought.net/c++/c_vs_c++.html

I'm going to ignore the C version because it's ugly and uses a hash.  I'm
also going to ignore the fastest C++ version because it uses a digital trie
(it's very fast but extremely memory hungry; the complexity is constant over
the size of the input and linear over the length of the word being searched
for).  I just wanted to focus on the language and the std library and not
have to implement a data structure.

Here is the C++ code:

#include 
#include 
#include 
#include 

int main(int argc, char* argv[]){

  using namespace std;
  char buf[8192];
  string word;
  unordered_set wordcount;
  while( scanf("%s", buf) != EOF ) wordcount.insert(buf);
  cout << "Words: " << wordcount.size() << endl;

  return 0;
}

For D I pretty much used the example from TDPL.  As far as I can tell, the
associate array used is closer to std::map (or maybe std::unordered_map ?)
than std::unordered_set, but I don't know of any other data structures in D
for this (I'm still learning).
Here is the D code:

import std.stdio;
import std.string;

void main(){

  size_t[string] dictionary;
  foreach(line; stdin.byLine()){
foreach(word; splitter(strip(line))){
  if(word in dictionary) continue;
  dictionary[word.idup] = 1;
}
  }
  writeln("Words: ", dictionary.length);
}

Here are the measurements (average of 3 runs):

C++
===
Data size: 990K with 23K unique words
real0m0.055s
user   0m0.046s
sys 0m0.000

Data size: 9.7M with 23K unique words
real0m0.492s
user   0m0.470s
sys0m0.013

Data size: 5.1M with 65K unique words
real0m0.298s
user   0m0.277s
sys0m0.013

Data size: 51M with 65K unique words
real0m2.589s
user   0m2.533s
sys0m0.070


DMD D 2.051
===
Data size: 990K with 23K unique words
real0m0.064s
user   0m0.053s
sys 0m0.006

Data size: 9.7M with 23K unique words
real0m0.513s
user   0m0.487s
sys0m0.013

Data size: 5.1M with 65K unique words
real0m0.305s
user   0m0.287s
sys0m0.007

Data size: 51M with 65K unique words
real0m2.683s
user   0m2.590s
sys0m0.103


GDC D 2.051
===
Data size: 990K with 23K unique words
real0m0.146s
user   0m0.140s
sys 0m0.000

Data size: 9.7M with 23K unique words
Segmentation fault

Data size: 5.1M with 65K unique words
Segmentation fault

Data size: 51M with 65K unique words
Segmentation fault


GDC fails for some reason with large number of unique words and/or large
data.  Also, GDC doesn't always give correct results; the word count is
usually off by a few hundred.

D and C++ are very close.  Without scanf() C++ is almost twice as slow.
Also, using std::unordered_set, the performance almost doubles.

I'm interested to see a better D version than the one I posted.

P.S.
No flame wars please.


Re: D vs C++

2010-12-24 Thread Caligo
If there are, say, 14 unique words then the executable compiled with GDC
doesn't always output the correct result and sometimes it gives segmentation
fault. 14 in this case would be the correct result, and 32 would not.  It
seems to work fine with very small data sets, but things start to go wrong
with larger ones.

As for the system, it's a 64-bit GNU/Linux, no multilib.  What else do you
need?

For GDC I've used gcc-4.4.5 and the following compiler flags:
'gdc -O2 -o count_d count.d'

I can't post the data because it's too large, but it shouldn't be too
difficult to generate it. 1MB of text file should work.

On Fri, Dec 24, 2010 at 6:49 PM, Iain Buclaw  wrote:

> == Quote from Caligo (iteronve...@gmail.com)'s article
> > --000e0cd215b8b968a004982e3775
> > Content-Type: text/plain; charset=ISO-8859-1
> > This is the page that would require your attention:
> > http://unthought.net/c++/c_vs_c++.html
> > I'm going to ignore the C version because it's ugly and uses a hash.  I'm
> > also going to ignore the fastest C++ version because it uses a digital
> trie
> > (it's very fast but extremely memory hungry; the complexity is constant
> over
> > the size of the input and linear over the length of the word being
> searched
> > for).  I just wanted to focus on the language and the std library and not
> > have to implement a data structure.
> > Here is the C++ code:
> > #include 
> > #include 
> > #include 
> > #include 
> > int main(int argc, char* argv[]){
> >   using namespace std;
> >   char buf[8192];
> >   string word;
> >   unordered_set wordcount;
> >   while( scanf("%s", buf) != EOF ) wordcount.insert(buf);
> >   cout << "Words: " << wordcount.size() << endl;
> >   return 0;
> > }
> > For D I pretty much used the example from TDPL.  As far as I can tell,
> the
> > associate array used is closer to std::map (or maybe std::unordered_map
> ?)
> > than std::unordered_set, but I don't know of any other data structures in
> D
> > for this (I'm still learning).
> > Here is the D code:
> > import std.stdio;
> > import std.string;
> > void main(){
> >   size_t[string] dictionary;
> >   foreach(line; stdin.byLine()){
> > foreach(word; splitter(strip(line))){
> >   if(word in dictionary) continue;
> >   dictionary[word.idup] = 1;
> > }
> >   }
> >   writeln("Words: ", dictionary.length);
> > }
> > Here are the measurements (average of 3 runs):
> > C++
> > ===
> > Data size: 990K with 23K unique words
> > real0m0.055s
> > user   0m0.046s
> > sys 0m0.000
> > Data size: 9.7M with 23K unique words
> > real0m0.492s
> > user   0m0.470s
> > sys0m0.013
> > Data size: 5.1M with 65K unique words
> > real0m0.298s
> > user   0m0.277s
> > sys0m0.013
> > Data size: 51M with 65K unique words
> > real0m2.589s
> > user   0m2.533s
> > sys0m0.070
> > DMD D 2.051
> > ===
> > Data size: 990K with 23K unique words
> > real0m0.064s
> > user   0m0.053s
> > sys 0m0.006
> > Data size: 9.7M with 23K unique words
> > real0m0.513s
> > user   0m0.487s
> > sys0m0.013
> > Data size: 5.1M with 65K unique words
> > real0m0.305s
> > user   0m0.287s
> > sys0m0.007
> > Data size: 51M with 65K unique words
> > real0m2.683s
> > user   0m2.590s
> > sys0m0.103
> > GDC D 2.051
> > ===
> > Data size: 990K with 23K unique words
> > real0m0.146s
> > user   0m0.140s
> > sys 0m0.000
> > Data size: 9.7M with 23K unique words
> > Segmentation fault
> > Data size: 5.1M with 65K unique words
> > Segmentation fault
> > Data size: 51M with 65K unique words
> > Segmentation fault
> > GDC fails for some reason with large number of unique words and/or large
> > data.  Also, GDC doesn't always give correct results; the word count is
> > usually off by a few hundred.
> > D and C++ are very close.  Without scanf() C++ is almost twice as slow.
> > Also, using std::unordered_set, the performance almost doubles.
> > I'm interested to see a better D version than the one I posted.
> > P.S.
> > No flame wars please.
>
> System details, compiler flags and the test data you used would be helpful.
> Else
> can't be sure what you mean by "doesn't always give correct results". :~)
>


Re: D vs C++

2010-12-24 Thread Caligo
On Sat, Dec 25, 2010 at 12:21 AM, bearophile wrote:

> Caligo:
>
>
> > Here are the measurements (average of 3 runs):
>
> Your timings lack information about the CPU, compilation switches used, and
> C++ compiler version used.
> Are those really averages?
>
>
> I used gcc version 4.4.4 to compile my C++ code.  The only switch to
optimize that I used is '-O2'.  Same for GDC, but GDC was compiled with gcc
4.4.5. And yes, those are averages. For DMD I used 'dmd -release count.d' to
compile.

And here is my CPU info:
processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 15
model   : 67
model name  : AMD Athlon(tm) 64 X2 Dual Core Processor 6400+
stepping: 3
cpu MHz : 3214.495
cache size  : 1024 KB
physical id : 0
siblings: 2
core id : 0
cpu cores   : 2
apicid  : 0
initial apicid  : 0
fpu : yes
fpu_exception   : yes
cpuid level : 1
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
rdtscp lm 3dnowext 3dnow rep_good extd_apicid pni cx16 lahf_lm cmp_legacy
svm extapic cr8_legacy
bogomips: 6428.99
TLB size: 1024 4K
pages

clflush size:
64

cache_alignment :
64

address sizes   : 40 bits physical, 48 bits
virtual

power management: ts fid vid ttp tm
stc



processor   :
1

vendor_id   :
AuthenticAMD

cpu family  :
15

model   :
67

model name  : AMD Athlon(tm) 64 X2 Dual Core Processor 6400+
stepping: 3
cpu MHz : 3214.495
cache size  : 1024 KB
physical id : 0
siblings: 2
core id : 1
cpu cores   : 2
apicid  : 1
initial apicid  : 1
fpu : yes
fpu_exception   : yes
cpuid level : 1
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
rdtscp lm 3dnowext 3dnow rep_good extd_apicid pni cx16 lahf_lm cmp_legacy
svm extapic cr8_legacy
bogomips: 6429.30
TLB size: 1024 4K pages
clflush size: 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc


Re: D vs C++

2010-12-27 Thread Caligo
On Mon, Dec 27, 2010 at 7:20 AM, Jonathan M Davis wrote:

> On Monday 27 December 2010 04:41:37 spir wrote:
> > On Sun, 26 Dec 2010 12:06:04 -0800
> >
> > Walter Bright  wrote:
> > > 11. generative programming
> >
> > Does someone have a pointer to any kind of doc about this? (in D)
>
> Anything on templates, template mixins, and string mixins. All of them
> generate
> code. And some people have done some pretty crazy stuff with them
> (especially
> string mixins).
>
> - Jonathan M Davis
>

So is it like template metaprogramming in C++?  a small D example would be
helpful.  There doesn't seem to be anything about it in TDPL.

As for CTFE, does this mean I could call 'writeln()' at compile time and
have it print a message to stdout while compiling?


Re: "The D Programming Language" : Still valid?

2010-12-27 Thread Caligo
On Mon, Dec 27, 2010 at 9:12 AM, Klaim  wrote:

> Hi!
>
> I'm a C++ and game developpement enthousiast and I'm insterested in D as a
> potential language to use for my game developpements.
>
> I bought the book "The D Programming Language" on Amazon as pre-command and
> got one of the early no-author-name-on-front edition.
>
> I started to read the chapter quickly introducing a lot of language
> features and got through the basic language structures chapters. After that
> I needed to read another book for work and paused reading this one.
> When I started to read, I registered to this mailing list to have an idea
> of where things are going with this language - as it had/have? a reputation
> of having a splitted community that was a problem.
>
> I've read interesting topics around here. But I remarked that there seem to
> be some languages changes that are still going on and I'm not sure if there
> is a roadmap (for a 3.0 version?), and if there is a list of features that
> will be added or removed from the version from the book.
>
> So my question is simply : how much is the book outdated now? (it's still
> pretty young so I was surprised of talkings about a lot of changes and
> addition)
> Will I still benefit a lot from reading all the book? Wich part should I
> know will/have change/d? Is there a place somewhere where there is a delta
> of differences between the version described in the book and the current
> stable one?
>
> Thanks for your attention.
>
> A. Joel Lamotte - klaim
>

I'm new as well :-)

When reading TDPL, if an example code doesn't compile, first check the
errata:  http://erdani.com/tdpl/errata/index.php?title=Main_Page

I don't know about a roadmap, but I kind of which that there was some kind
of release schedule posted on the main site.  Currently I think there is
about one new release every month.


Re: D vs C++

2010-12-28 Thread Caligo
On Mon, Dec 27, 2010 at 6:41 AM, spir  wrote:

> On Sun, 26 Dec 2010 12:06:04 -0800
> Walter Bright  wrote:
>
> > 11. generative programming
>
> Does someone have a pointer to any kind of doc about this? (in D)
>
> Denis
> -- -- -- -- -- -- --
> vit esse estrany ☣
>
> spir.wikidot.com
>
>
I just read the section on mixins in chapter 3 and my jaw hit the floor.


Re: D Language Custom Google Search

2010-12-28 Thread Caligo
On Tue, Dec 28, 2010 at 9:16 AM, Chris Dahl  wrote:

> Hi.  I am new here (and new to D) and just wanted to share the URL for a
> page that I put together for myself to use as I am learning the language.
>
> http://d.nuverde.com/
>
> This page is just a custom Google search of some of the more common D
> related web pages that I have found.  My purpose is to have an easy way to
> search without a lot of the non-D results that I typically get.  Is there
> already something like this out there?
>
> Here are the sites that I have included right now.  Are there any other
> good D sites that you would add?
>
>  - digitalmars.com/d/
>  - dsource.org
>  - d-programming-language.org
>  - prowiki.org/wiki4d/
>  - bitbucket.org/goshawk/gdc/wiki/Home
>  - dprogramming.com
>  - quit-clan.de/docwiki/
>  - 
> en.wikipedia.org/wiki/D_(programming_language)
>
> Thanks!
> --Chris
>

http://stackoverflow.com/questions/tagged/d


Re: Please comment on http://d-programming-language.org/

2010-12-31 Thread Caligo
The main page has a quote from Michael.  Who the hell is Michael? The
Michael? The archangel?

On Fri, Dec 31, 2010 at 3:45 AM, Thomas Mader wrote:

> Am 2010-09-02 14:46, schrieb retard:
>
>> Thu, 02 Sep 2010 13:31:03 +0100, Gareth Charnock wrote:
>>
>>  PS: Google Chrome on a 1680x1050 resolution display.
>>>
 I'm afraid I really like the red flare; it makes the website look more
 visually appealing. A solid background colour would just look blander.

 However, I agree with the comments about the c1.gif and d3.gif images.
 They don't really fit with the more professional looking new design.

>>>
>> We need a more professional looking SVG version of the D man then!
>>
>
> How about a new logo for D in general? Are there any plans to make a
> contest or something similar to create a new D logo which has a modern
> looking design?
>
> I also think that making the site valid is a very important thing, so are
> there any plans to do so? If nobody wants it to do I could help.
>


Re: Less commas

2010-12-31 Thread Caligo
On Fri, Dec 31, 2010 at 2:09 AM, bearophile wrote:

> I'd like to restrict a bit the usage of the comma operator in D2,
> disallowing at compile-time some currently usages that some C style guides
> already suggest to avoid.
>
> If I see production code like the two examples below in production code, I
> change the code, and remove the commas. I think they are confusing, and may
> hide bugs. Do you know other situations where you like to disallow the comma
> operator in D2? Later I will probably write an enhancement request on this.
>
> 
>
> Is x the result of foo() or bar()?
>
> int foo() { return 10; }
> int bar() { return 20; }
> void main() {
>int x;
>x = foo(), bar();
> }
>
> 
>
> The comma could be mistaken for a semicolon:
>
> void main() {
>int x;
>if (x > 0) x = 0,
>   x = 1;
> }
>
> Bye,
> bearophile
>

What font are you using?


Re: Less commas

2010-12-31 Thread Caligo
On Fri, Dec 31, 2010 at 4:17 AM, bearophile wrote:

> Caligo:
>
> > > What font are you using?
>
> Inconsolata-g, a very good non-proportional font designed to be used with
> anti-aliasing. Its main fault is that it doesn't have bold yet.
>
> One of its features is to tell apart commas and semicolons better, by the
> way. In it the lower-case L and the 1 glyphs are easy to tell apart. Yet,
> the D choice to deprecate number literals like 1l was the right one.
>
> Bye,
> bearophile
>

I use Anonymous Pro and I think it does a better job in case of commas and
semicolons.


Re: Who here actually uses D?

2011-01-01 Thread Caligo
On Sat, Jan 1, 2011 at 6:14 PM, Robert Clipsham
wrote:

> On 01/01/11 22:48, Andrei Alexandrescu wrote:
>
>> I've done my doctoral work in D, which was a pretty large project for
>> one person (I guess a few tens of KLOC).
>>
>> I've also hit unpleasant bugs on occasion as those you mention - it's
>> very jarring. I wonder how we could improve the process to give special
>> priority to issues that (a) waste a lot of time tracking down, and (b)
>> have no or difficult workarounds.
>>
>
> Unfortunately, it's impossible to create such a system without people being
> paid to work on dmd and the runtime - people will fix the bugs they want to,
> you can't make them fix anything. Obviously you can influence what gets
> fixed, not to a huge extent though. Ideally the voting system would outline
> what needs the most effort, but people don't idle on bugzilla enough for it
> to work so well. I wonder if changing the 'vote' button to a 'like' button
> would make any difference, if facebook's any indication, people like to like
> things ;p
>
>  Andrei
>>
>
> I guess I should probably apologise if I sounded hot-headed at all in my
> post too - just had a rather stressful evening battling with compiler bugs -
> one of those ones that seems to morph into about 3 or 4 other bugs as you
> narrow it down, and each compiler you try yields a completely different
> result at the end of it. I decided to give up, rant, relax, and leave it for
> another day!
>
> --
> Robert
> http://octarineparrot.com/
>

I don't understand why so much time and effort as been spent, perhaps
wasted, on multiple compilers and standard libraries.  I also don't
understand why Walter insists on having his own compiler when D has finally
been declared an open source project.  LLVM and GCC are very mature projects
and they could have been used for the reference implementation.  If Walter
was in charge of the GDC or LDC project, then we would have had a better
compiler than what we have today.  That way I think D as a new modern
programming language could have been in a much better position.  You also
don't need to pay people to fix bugs or do whatever that is needed to be
done so long as you have a healthy and growing open source community.  I
don't think we have that yet, and perhaps the fact that Walter comes from
the closed-source proprietary world is part of the reason.

I highly recommend The Cathedral and the Bazaar by Eric Raymond:
http://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar

That's just me and I could be wrong.


Re: Who here actually uses D?

2011-01-01 Thread Caligo
On Sat, Jan 1, 2011 at 8:01 PM, Walter Bright wrote:

> Caligo wrote:
>
>> I don't understand why so much time and effort as been spent, perhaps
>> wasted, on multiple compilers and standard libraries.  I also don't
>> understand why Walter insists on having his own compiler when D has finally
>> been declared an open source project.  LLVM and GCC are very mature projects
>> and they could have been used for the reference implementation.  If Walter
>> was in charge of the GDC or LDC project, then we would have had a better
>> compiler than what we have today.  That way I think D as a new modern
>> programming language could have been in a much better position.  You also
>> don't need to pay people to fix bugs or do whatever that is needed to be
>> done so long as you have a healthy and growing open source community.  I
>> don't think we have that yet, and perhaps the fact that Walter comes from
>> the closed-source proprietary world is part of the reason.
>>
>
> The problems D has had have rarely been the back end.
>

You don't get it!  If only one back-end was used then there wouldn't be
three different groups working on three different projects that try to
accomplish the same thing.

Also, whenever there is a failure in communication, you end up with forked
projects, hence Tango.


Re: Advocacy (Was: Who here actually uses D?)

2011-01-01 Thread Caligo
On Sat, Jan 1, 2011 at 11:27 PM, Ulrik Mikaelsson <
ulrik.mikaels...@gmail.com> wrote:

> On a side-note (and I'm clearly biased here so I hardly even take
> myself very seriously), I think the non-windows os:es, especially
> Linux, should also be an intentional focus-area. It is VERY difficult
> to compete with .NET on Windows, and somehow I don't think we'll find
> most of the efficiency-focused audience there, but if D can
> demonstrate it's usefulness in key systems components in Linux, it's
> likely to attract more curious right-minded developers. I'm not sure
> exactly how to realize this, but there may be two opportunities in
> quickly providing a lightwheight attractive desktop environment for
> the upcoming Wayland system, as well as someone finally writing a
> disk-indexing system that doesn't eat all your disk-bandwidth and ram
> during the first week.
>
>
I agree with you on this.  For example, Linus Torvald hates C++ and probably
for good reasons.  Imagine if Linus tries D and thinks it's a good language
and begins to use it in kernel development.  I don't think I need to
describe what would happen to D then.  Sadly, GDC is not in a good state
right now.


Re: Advocacy (Was: Who here actually uses D?)

2011-01-02 Thread Caligo
On Sun, Jan 2, 2011 at 1:42 AM, Nick Sabalausky  wrote:

>
> I don't have a link, but I read a post he made somewhere that explained the
> reason Linux kernal is plain-C-only is because, IIRC, they frequently need
> a
> very, very tight mapping between the source and the generated instructions.
> Partly for tight control over the instruction generation, and partly becase
> they often needed be be able to look at the source and know what got
> generated. I don't know, but I suspect D may be even further from C++ in
> than regard.
>
>
>
Linus also doesn't want C++ to be used for Git.

"

On Wed, 5 Sep 2007, Dmitry Kakurin wrote:
>
> When I first looked at Git source code two things struck me as odd:
> 1. Pure C as opposed to C++. No idea why. Please don't talk about portability,
> it's BS.

**YOU** are full of bullshit.

C++ is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if
the choice of C were to do **nothing** but keep the C++ programmers out,
that in itself would be a huge reason to use C.

In other words: the choice of C is the only sane choice. I know Miles
Bader jokingly said "to piss you off", but it's actually true. I've come
to the conclusion that any programmer that would prefer the project to be
in C++ over C is likely a programmer that I really **would** prefer to piss
off, so that he doesn't come and screw up any project I'm involved with.

C++ leads to really really bad design choices. You invariably start using
the "nice" library features of the language like STL and Boost and other
total and utter crap, that may "help" you program, but causes:

 - infinite amounts of pain when they don't work (and anybody who tells me
   that STL and especially Boost are stable and portable is just so full
   of BS that it's not even funny)

 - inefficient abstracted programming models where two years down the road
   you notice that some abstraction wasn't very efficient, but now all
   your code depends on all the nice object models around it, and you
   cannot fix it without rewriting your app.

In other words, the only way to do good, efficient, and system-level and
portable C++ ends up to limit yourself to all the things that are
basically available in C. And limiting your project to C means that people
don't screw that up, and also means that you get a lot of programmers that
do actually understand low-level issues and don't screw things up with any
idiotic "object model" crap.

So I'm sorry, but for something like git, where efficiency was a primary
objective, the "advantages" of C++ is just a huge mistake. The fact that
we also piss off people who cannot see that is just a big additional
advantage.

If you want a VCS that is written in C++, go play with Monotone. Really.
They use a "real database". They use "nice object-oriented libraries".
They use "nice C++ abstractions". And quite frankly, as a result of all
these design decisions that sound so appealing to some CS people, the end
result is a horrible and unmaintainable mess.

But I'm sure you'd like it more than git.

Linus
"


Source:  
http://thread.gmane.org/gmane.comp.version-control.git/57643/focus=57918


Re: Advocacy (Was: Who here actually uses D?)

2011-01-02 Thread Caligo
On Sun, Jan 2, 2011 at 2:24 AM, Walter Bright wrote:

> Nick Sabalausky wrote:
>
>> Hmm, from that I get the impression that Linus is basically just like the
>> old Java-evangelists except instead of OO being his silver bullet, it's
>> zero-abstraction. I'm almost suprised he allows things like functions, or
>> anything other than Asm for that matter, or cares about portability. I
>> really doubt he'd like D. Maybe he'd dislike parts of it less than C++, but
>> that's probably about it.
>>
>
> Yeah, I don't think Linus would find D appealing.
>

So why is D being advertised as a systems programming language?  By saying
Linus would not find D appealing you are basically saying kernel developers
would not find it appealing.


Re: Advocacy (Was: Who here actually uses D?)

2011-01-02 Thread Caligo
2011/1/2 so 

> I agree with you on this.  For example, Linus Torvald hates C++ and
>> probably
>> for good reasons.
>>
>
> If someone using the word "love" for C and at the same time "hate" C++...
> He might be a god to some people but at the same time this makes him a
> dumbass language lawyer.
>

When you insult people like that, what does that make you?


Re: Moving to D

2011-01-06 Thread Caligo
On Thu, Jan 6, 2011 at 12:28 AM, Walter Bright
wrote:

>
> That's pretty much what I'm afraid of, losing my grip on how the whole
> thing works if there are multiple dmd committers.
>
> Perhaps using a modern SCM like Git might help?  Everyone could have (and
should have) commit rights, and they would send pull requests.  You or one
of the managers would then review the changes and pull and merge with the
main branch.  It works great; just checkout out Rubinius on Github to see
what I mean: https://github.com/evanphx/rubinius


Re: Moving to D

2011-01-06 Thread Caligo
On Thu, Jan 6, 2011 at 5:50 AM, Russel Winder  wrote:

> Whilst I concur (massively) that Subversion is no longer the correct
> tool for collaborative working, especially on FOSS projects, but also
> for proprietary ones, I am not sure Git is the best choice of tool.
> Whilst Git appears to have the zeitgeist, Mercurial and Bazaar are
> actually much easier to work with.  Where Git has GitHub, Mercurial has
> BitBucket, and Bazaar has Launchpad.
>
> --
> Russel.
>
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip:
> sip:russel.win...@ekiga.net 
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@russel.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
>

BitBucket has copied almost everything from Github, and I don't understand
how they've never been sued.

http://dev.pocoo.org/~blackbird/github-vs-bitbucket/bitbucket.html

Github team has been the innovator here, and they never stop improving the
site with new features and bug fixes.  It would be nice to support their
work by using Github.

There is also Gitorious.  It only offers free hosting and it is more team
orientated than Github, but Github has recently added the "Organization"
feature.   The interesting thing about Gitorious is that you can run it on
your own server.  I don't think you can do that with Github.

One cool thing about Github that I like is gist: https://gist.github.com/
It's a pastebin, but it uses Git and supports D syntax.  People are always
sharing snippets on these newsgroups, and it would have been nice if they
were gists.

I've never used Bazaar, so no comment on that.  But, between Git and
Mercurial, I vote for Git.


Re: Moving to D

2011-01-06 Thread Caligo
On Thu, Jan 6, 2011 at 8:47 PM, Daniel Gibson  wrote:

>
> Yeah, see also: http://schacon.github.com/bitbucket.html by the same
> author
>
> When this rant was new I read a page that listed where Github stole their
> ideas and designs (Sourceforce for example), but I can't find it anymore.
> This rant was bullshit, as even the author seems to have accepted.
>
> I don't understand why people still mirror and link this crap.
>

hmmm...Interesting!  I did not know that, and thanks for the share.  There
is even a discussion about it on reddit where the author apologizes.  I
don't understand why he would do such a thing.


Re: DVCS (was Re: Moving to D)

2011-01-13 Thread Caligo
On Wed, Jan 12, 2011 at 11:33 PM, Walter Bright
wrote:

> Vladimir Panteleev wrote:
>
>> On Thu, 13 Jan 2011 05:43:27 +0200, Walter Bright <
>> newshou...@digitalmars.com> wrote:
>>
>>  The keyboards fail so often I keep a couple spares around.
>>>
>>
>> Let me guess, all cheap rubber-domes? Maybe you should have a look at some
>> professional keyboards. Mechanical keyboards are quite durable, and feel
>> much nicer to type on.
>>
>
> Yup, the $9.99 ones. They also get things spilled on them, why ruin an
> expensive one? 
>


  http://www.daskeyboard.com/

or

http://steelseries.com/us/products/keyboards/steelseries-7g

expensive, I know, but who cares.  You only live once!


Re: repeat

2011-01-17 Thread Caligo
How is this:

repeat("abc", 3) -> ["abc", "abc", "abc"]

repeated("abc", 3) -> "abcabcabc"


Re: first git commit

2011-01-23 Thread Caligo
On Sun, Jan 23, 2011 at 10:14 PM, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:

> We've moved the entire camp to github: dmd compiler, phobos, druntime,
> website, installer.
>
> I'm happy to report that we have our first git commit:
>
>
> https://github.com/D-Programming-Language/phobos/commit/81a4a4034aabe83d41cf2a0a202fedb428da66b6
>
>
> Andrei
>
>
What about the GDC team? Are they planning to switch to Git as well?


Re: Is D not-for-profit or not?!

2011-01-30 Thread Caligo
On Sun, Jan 30, 2011 at 10:55 AM, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:

> On 01/30/2011 08:27 AM, retard wrote:
>
>> I also doubt you can make
>> the dmc/dmd backend FOSS with any sum of money. If you wanted some
>> changes badly, I'd recommend donating the money to some democratic
>> community language without any BDFL persons.
>>
>
> I think that's just false. With money the backend could be bought from
> Symantec.
>
> Andrei
>

What is so great about this back-end (no offense)?  Why can it not be
replaced with something like LLVM or GCC?  Why can we not have LDC or GDC be
the official compiler?


Re: Some lazy code to D

2012-08-28 Thread Caligo
Did you time the runs?

Non-lazy D version, compiled as -O -inline -release, and ran with pick(6,
11):

real0m8.587s
user0m8.497s
sys0m0.012s


Lazy D version, compiled as -O -inline -release, and ran with pick(6, 11):

real0m4.195s
user0m4.168s
sys0m0.008s


Haskell version, compiled as -O2, and ran with pick(6, 11):

real0m0.159s
user0m0.116s
sys0m0.028s


Re: DIP19: Remove comma operator from D and provision better syntactic support for tuples

2012-09-24 Thread Caligo
If tuples are ever introduced, I hope parentheses will not be used.

I would prefer something like this:

tuple<2,1,8>


Re: DIP19: Remove comma operator from D and provision better syntactic support for tuples

2012-09-24 Thread Caligo
foo(<11,2,8>, a, b)
vs
foo((11,2,8), a, b)

Parentheses are everywhere in D.  Sometimes it looks like Lisp.

On Mon, Sep 24, 2012 at 11:37 AM, bearophile  wrote:
>
> That both breaks code, doesn't improve the syntax, but makes it worse.
>
> Bye,
> bearophile


Re: [ ArgumentList ] vs. @( ArgumentList )

2012-11-06 Thread Caligo
On Tue, Nov 6, 2012 at 1:18 PM, Walter Bright
 wrote:
>
> No hitting below the belt! Let the games begin!

If those are our only choices, then I vote for @( ArgumentList ).

Otherwise, I think these look better:

[: ArgumentList :]

or

|: ArgumentList :|


Re: I'm back

2012-11-12 Thread Caligo
On Mon, Nov 12, 2012 at 2:28 PM, Andrei Alexandrescu
 wrote:
>
> * The execution of that feature (merging in the trunk along with a bunch of
> unrelated work) was extremely poor. We need to acquire a sense of urgency
> about fixing our process, lest this mom-and-pop-shop style of getting work
> done will end up alienating our user base.
>
> Andrei

+1


Re: GSoC Mentor Summit Observations and D Marketing

2011-10-24 Thread Caligo
On Mon, Oct 24, 2011 at 7:42 PM, dsimcha  wrote:

> I wanted to thank the D community for getting us involved in GSoC and
> giving me the opportunity to attend the Mentor Summit, which was this
> weekend.  I was pleasantly surprised to find out that most hardcore
> programmers have at least heard of D by now, at least if the Mentor Summit
> was a representative sample of hardcore programmers that I had never talked
> to before.  There seemed to be substantial interest in it from the informal
> conversations I had over meals, etc.
>
> I got the impression that D is not being used partly because of the obvious
> reasons (lack of libraries, legacy code in other languages) but also partly
> because most people, even if they've heard of it, don't know what its most
> important features/benefits are.  I think that we need to develop a short,
> memorable "elevator speech" version of its selling points, even if we ignore
> some substantial areas in doing so.  The one I used was basically
> "compile-time metaprogramming on steroids, static if, CTFE, string mixins,
> see std.algorithm, std.range and std.parallelism for examples".
>
> I was also frequently asked about D's compatibility with C and C++.  The
> impression I get is that we would do well to highlight our ease of
> integrating with C more in our marketing, especially now that we have
> Deimos.
>
> BTW, Fawzi Mohammed was also at the Mentor Summit and may have additional
> comments.  I'd be interested to see him weigh in on this thread.
>

I wasn't there at the Mentor Summit, but I would consider myself a hardcore
programmer.  I discovered D in early 2008, and I was immediately impressed.

Many other programmers I've interacted with, including my coworkers, are
aware of D, but the main reason they've not taken it seriously is not lack
of libraries or legacy code in other languages, but lack of stable
compilers.  It is the same reason why I haven't been able to take D
seriously.  This year alone I started two projects in D, but I had to put
them on hold because of bugs in DMD.  Yes, I aware it's getting better, but
it's still not there yet.

I personally don't think compatibility with C and C++ (specially C++) is
going to matter much, specially in the long run.  D offers so much over C++
that I think many of the most popular libraries will be rewritten in D.  But
that's just me, and I could be wrong.  For example, about a decade ago the
men responsible for Qt decided to avoid using C++ templates mainly because
of lack of compiler support.  Imagine if Qt was rewritten in D! hmm...


Re: Ada, HCSS and more

2011-10-29 Thread Caligo
On Tue, Oct 25, 2011 at 10:16 PM, bearophile wrote:

> (Report after a mistake.)
>
> This looks mostly like Ada advertisement, but it's readable (May 2008):
> http://www.mil-embedded.com/articles/id/?3277
>
> The Reddit thread about it:
>
> http://www.reddit.com/r/programming/comments/lol4l/ccjava_a_gazillion_features_and_still_suck_at/
>
> From the article:
>
> >Last year's High Confidence Software and Systems (HCSS) conference,
> sponsored by NSA to address security-critical issues, featured an
> interesting presentation from Microsoft addressing such issues in the
> context of Windows. The primary sources of problems in Microsoft's
> experience are buffer overruns and integer overflow problems.<
>
> I have done some searching, but I have not found this presentation.
>
> Bye,
> bearophile
>

Walter once said that Ada is a failed language.
http://www.digitalmars.com/d/archives/digitalmars/D/Clay_language_125339.html#N125402

Why?


Re: phobos alt.

2011-10-31 Thread Caligo
On Mon, Oct 31, 2011 at 7:46 PM, Jonathan M Davis wrote:

> On Monday, October 31, 2011 16:48 bls wrote:
> > On 10/31/2011 04:11 PM, Jonathan M Davis wrote:
> > > That's perfectly reasonable. The fact that std.container is so
> incomplete
> > > is a _huge_ problem for Phobos. It needs to be filled out and its API
> > > fully ironed out. Overall, it looks solid, but it just doesn't have
> > > enough actual usage at this point to really verify that because of the
> > > lack of containers. std.container_will_ be completed, so this really
> > > shouldn't be a long term concern, but in the short term, I agree that
> > > it's a definite problem.
> >
> > Thanks.
> > I've tried to contact Steven via email in order to stress-test my
> > skiplist implementation in dcollections.
> >
> > (I am not obsessed regarding skiplists, but all measurements I have seen
> > so far are showing that in case of massive appending the skiplist
> > algorithm wins).. makes sense for std.database (orm/unitofwork)
> >
> > Nevertheless, what I don't understand is : What has to be ironed out
> > before giving std.collections a go ?, What's the show-stopper? The only
> > thing I can vaguely imagine is streaming .. but dunno.
>
> std.collections? Do you mean std.container? Andrei wants the custom
> allocators
> sorted out before we implement a bunch of containers that we'd then have to
> change. As it is, Array and SList are supposed to be turned into final
> classes
> rather than reference-counted structs, and not even that has happened yet.
> So,
> it seems like std.container has effectively stagnated while waiting for the
> custom allocator stuff to be worked out. However, supposedly Andrei is
> going
> to start messing around with the recently reviewed region allocator stuff
> with
> std.container sometime soon in order to iron it out a bit more, but with
> how
> busy he is, I don't know where that stands.
>
> - Jonathan M Davis
>

How long before custom allocator stuff is complete?  6 months? a year?


Re: Firefox changes, and languages

2011-11-01 Thread Caligo
Nowadays everyone seems to be developing some new programming language.  I
just discovered Nu today:
http://en.wikipedia.org/wiki/Nu_(programming_language)


Re: Firefox changes, and languages

2011-11-01 Thread Caligo
And then there is Chapel, but I think you already know about it.  I've had
my eye on Chapel for a while.  I like its 'Configs' features, but that's a
small one.


BitBucket Offers Git Support

2011-11-01 Thread Caligo
I just found out that Bitbucket finally offers Git support.  I wonder,
would anyone else like to see GDC switch to Git?  I would like to kindly
make a request because it would make things little easier.


Re: BitBucket Offers Git Support

2011-11-02 Thread Caligo
This wasn't supposed to be about Git vs Mercurial.  I should have been more
clear in my post!

The reason it would make things easier if we switched to using Git on
Bitbucket is because it would make things more streamlined.  I don't like
how I need to use Mercurial when I want to work on GDC, then switch back to
Git when working on DMD.  It would even be better if both projects were
using the same hosting site.


Re: Bartosz about Chapel

2011-11-07 Thread Caligo
On Mon, Nov 7, 2011 at 7:51 PM, bearophile  wrote:

> Bartosz talks a bit about the very nicely designed Chapel language:
>
> http://bartoszmilewski.wordpress.com/2011/11/07/supercomputing-in-seattle/
>
> (But my appreciation for Chapel design is on other things).
>
> Bye,
> bearophile
>

Interesting (maybe useless) facts: Chapel has 59 keywords.  D has, I think,
107 keywords.  C++11, I think, 81.  Python has 33.


Re: Bartosz about Chapel

2011-11-07 Thread Caligo
On Mon, Nov 7, 2011 at 7:51 PM, bearophile  wrote:

> Bartosz talks a bit about the very nicely designed Chapel language:
>
> http://bartoszmilewski.wordpress.com/2011/11/07/supercomputing-in-seattle/
>
> (But my appreciation for Chapel design is on other things).
>
> Bye,
> bearophile
>

I haven't looked at Chapel in depth, but I would like to see sample code
where it shows its generics is better than D's.


Re: Bartosz about Chapel

2011-11-09 Thread Caligo
On Wed, Nov 9, 2011 at 5:20 PM, Walter Bright wrote:

> On 11/9/2011 2:45 PM, Danni Coy wrote:
>
>> how many keywords in D are needed because the preprocessor is built into
>> the
>> language itself?
>>
>
> It's true, people forget about the preprocessor keywords when counting C++
> keywords.
>
>
>
You're right, I did forget about the preprocessor.  Besides the usual
things in the header files, I always try to avoid macros.

There are about 20 directives, so that puts the keywords count for C++ to
101.  It's still fewer than D.  Does that mean D is more complex than C++?

Python with 33, I think most would agree that is has a very consice
grammer.


Re: Bartosz about Chapel

2011-11-09 Thread Caligo
On Wed, Nov 9, 2011 at 8:58 PM, Walter Bright wrote:

> On 11/9/2011 5:46 PM, Caligo wrote:
>
>> There are about 20 directives, so that puts the keywords count for C++ to
>> 101.
>>  It's still fewer than D.  Does that mean D is more complex than C++?
>>
>
> C++ has "unsigned", "long", and "unsigned long" while D has "uint",
> "long", and "ulong". That's one more keyword; does that make D more complex
> than C++?
>
>
In that example, I prefer the D way.  But, in both cases the different data
types exist because of speed and efficiency.Semantically, int is more
or less a subset of long, so why do we need separate data types?  We don't,
really, and it's lame to clutter up the semantics of the language like that.

Something like this would have been better, and if I recall this is how
Chapel is doing it:

int(32)  a;  // int
int(64)  b;  // long


>
>  Python with 33, I think most would agree that is has a very consice
>> grammer.
>>
>
> Python lacks a lot of powerful features that are in D.
>
>
I know, and I wasn't trying to say that Python is more powerful.


Re: Python vs D [ was Re: Bartosz about Chapel ]

2011-11-10 Thread Caligo
>
>
> Without a properly financed and orchestrated marketing campaign to push
> D out there to the C, C++ and Fortran crowd and/or a group of people who
> could be the "killer audience", and then for there to be serious take
> up, D remains a 10+ year old niche experiment with no mainline future.
>
>
That's like going back 20 years and telling Linus "without a properly
financed and orchestrated marketing campaign to push Linux out there..." ,
you get my drift.

Money and marketing are important, specially when you are developing
a proprietary system.  You can have a shit product, but with enough
marketing you can make people believe it's not shit; Microsoft has done it,
same with Sun and Java.

If D fails, it's not because of lack of money or marketing, but because of
lack of a healthy and growing community.  A healthy community is what all
successful open source projects have in common.  Moving to Github was a
step in the right direction, but it's not enough, and the people in charge
don't seem to have a clue as to how to build a community.  How many new
developers have joined the development of D/Phobos in the last year?  I bet
very few.  They haven't even fixed the link to that old site, and it's been
like that for far too long.

Where is "D/Phobos Developer's Guide" page?


Re: Python vs D [ was Re: Bartosz about Chapel ]

2011-11-11 Thread Caligo
On Thu, Nov 10, 2011 at 9:47 PM, Walter Bright
wrote:

> On 11/10/2011 7:06 PM, Caligo wrote:
>
>> Where is "D/Phobos Developer's Guide" page?
>>
>
> Andrei and I have talked about writing one, but it will help a lot if you
> would contribute a draft.
>

Done.

Since I'm not a D developer, there is a lot that I had to leave blank, but
it's a draft nonetheless (maybe an outline).

It's loosely based on Python Dev Guide, and it uses Sphinx.  Change to
'ddevguide' and run 'make html', and you should end up with HTML files in
the build directory.

Whatever section I could not complete, I left TODO notes.  Read those and
complete the section if you can.

I hope the attachment goes through.
<http://sphinx.pocoo.org/>


ddevguide.tar.gz_
Description: Binary data


Re: Python vs D [ was Re: Bartosz about Chapel ]

2011-11-11 Thread Caligo
On Fri, Nov 11, 2011 at 2:59 AM, SimonM  wrote:

> On 2011/11/11 06:56 AM, Andrei Alexandrescu wrote:
>
>> On 11/10/11 9:06 PM, Caligo wrote:
>>
>>> I bet very few. They haven't even fixed the link to that old
>>> site, and it's been like that for far too long.
>>>
>>
>> What link?
>>
>
> I think he's probably referring to 
> http://www.digitalmars.com/d/**2.0/<http://www.digitalmars.com/d/2.0/>which 
> should preferrably redirect to
> http://d-programming-language.**org/ <http://d-programming-language.org/>.
>
> I always need to keep a bookmark to the .org site, because if I just
> Google "D" I only get to the digitalmars site, and it doesn't provide any
> link to the .org site.
>

yes, that's what I mean. I don't even know why that old site still exists.
Walter said he would get it fixed:

http://www.digitalmars.com/d/archives/digitalmars/D/Why_I_m_hesitating_to_switch_to_D_139517.html#N139559


How do I use DDoc?

2011-11-11 Thread Caligo
I'm about to go to bed and I can't keep my eyes open, so sorry if the
answer to this is obvious.

I cloned '
https://github.com/D-Programming-Language/d-programming-language.org' and I
want to work on documentation.  I've read
http://www.digitalmars.com/d/2.0/ddoc.html, but maybe I've missed it.

1. How do I get dmd to generate the HTML files from all those *.dd files?
I run 'dmd -Dddocdir *.dd' and it creates 'docdir' folder with bunch of
HTML files, but they are only a few KBs with no content.  What am I doing
wrong?

2. What are the *.ddco for?  Do they contain the predefined macros?  If so,
why are some of them missing than what's listed on that page?


Re: How do I use DDoc?

2011-11-12 Thread Caligo
On Sat, Nov 12, 2011 at 1:59 AM, Jonathan M Davis wrote:

> On Saturday, November 12, 2011 01:54:48 Caligo wrote:
> > I'm about to go to bed and I can't keep my eyes open, so sorry if the
> > answer to this is obvious.
> >
> > I cloned '
> > https://github.com/D-Programming-Language/d-programming-language.org'
> and I
> > want to work on documentation.  I've read
> > http://www.digitalmars.com/d/2.0/ddoc.html, but maybe I've missed it.
> >
> > 1. How do I get dmd to generate the HTML files from all those *.dd files?
> > I run 'dmd -Dddocdir *.dd' and it creates 'docdir' folder with bunch of
> > HTML files, but they are only a few KBs with no content.  What am I doing
> > wrong?
> >
> > 2. What are the *.ddco for?  Do they contain the predefined macros?  If
> so,
> > why are some of them missing than what's listed on that page?
>
> If you want to build d-programming-language.org, then use its makefile.
>
> make -f linux.mak
>
> or
>
> make -f win32.mak
>
> The generated files end up in ../web/, with the current HTML documentation
> in
> ../web/phobos-prerelease IIRC. You have to have the Phobos and druntime
> repositories as well, and I believe that they have to be in the same
> directory
> with the directory for d-programming-language.org.
>
> - Jonathan M Davis
>

First I had to modify 'linux.mak' because I don't have a standard install
of DMD (DMD=/path/to/dmd/dmd2/linux/bin64/dmd).

I then ran:

make -f linux.mak

and it generates ../web directory with all the HTML files from all the *.dd
files. Plus, it gave bunch of errors and quit.  So, then I cloned Phobos
and druntime and put them in the same directory as
d-programming-language.org directory.  That didn't work because it seems
that it tries to actually compile Phobos, but right now the latest Phobos
doesn't compile, and it fails and gives errors.

So, I used the source that comes with the standard DMD release, and yes,
they have to be in the same directory as d-programming-language.org.  That
finally worked.

Thanks.


Re: How do I use DDoc?

2011-11-14 Thread Caligo
Well, I've reached the conclusion that I don't like ddoc.  The syntax is
ugly, and when writing documentation the last thing I want to do is mess
around with macros.  The only advantage it has is when you want to generate
HTML files from commented D source code.

It's such a pleasure to do documentation with Sphinx and similar tools, and
perhaps I've been spoiled.

I think the pull request for D dev guide is still up on github if any
person wants to convert it to ddoc.


Re: reddit discussion on article by bearophile

2011-11-17 Thread Caligo
On Wed, Nov 16, 2011 at 10:57 AM, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:

> http://www.reddit.com/r/**programming/comments/me6a5/**
> some_examples_of_strong_**static_typing_in_d/
>
> Andrei
>

Those nested for-loops are painful to look at.


Re: Compile-time Interfaces

2011-11-26 Thread Caligo
It's almost 2012, and people are still using IDE's?


Re: boost crowd.

2011-11-28 Thread Caligo
On Sun, Nov 27, 2011 at 6:44 PM, Alexey Veselovsky <
alexey.veselov...@gmail.com> wrote:

> I'm trying to switch from C++ to D. But I can't find some things that
> I love in C++. For example in C++ I can separate module specification
> and implementation. Advertising article "The Case for D" says that it
> is real in D too:
>
> "D has a true module system that supports separate compilation and
> generates and uses module summaries (highbrowspeak for "header files")
> automatically from source, so you don't need to worry about
> maintaining redundant files separately, unless you really wish to, in
> which case you can. Yep, that stops that nag right in mid-sentence."
>
> But it is not true...
>

The separation of specification and implementation in C/C++ is not some
feature that they came up.  I would call it a design defect.  Having to
split up code between header files and source files is one of the things I
dislike about C/C++.  As for why anyone would be in love with such a thing,
well that's just beyond me.


Re: Website message overhaul, pass 2

2011-11-28 Thread Caligo
BTW, something is wrong with the class section of the language reference:
http://d-programming-language.org/new/class.html

It's been like that for months.


Re: Java > Scala

2011-12-01 Thread Caligo
On Thu, Dec 1, 2011 at 3:26 AM, Russel Winder  wrote:

> On Wed, 2011-11-30 at 23:08 -0800, Walter Bright wrote:
> [...]
> > When you can implement a competitive malloc() using Java, I'll believe
> it has
> > reached parity. There's a reason why the JVM is itself implemented in C,
> not
> > Java. D's runtime is implemented in D.
>
> This is like trying to compare apples and dog excrement.  Clearly malloc
> will always be written in C.
>
> I think this thread has shown that D folk need to accept that Java is a
> critical platform out there and will be for many years to come.
> Languages such as Groovy, JRuby and Closure -- the jury is still out on
> Scala, and the Jury cannot yet even compare Ceylon and Kotlin -- have
> evolved the milieu to be a active and efficacious one.  The point is
> that the JVM arena, the CLR arena and the native arena are three
> separate ones these days, with little or no crossover.
>

Java is a joke.  Get over it.  Java is a toy language and the only reason
people and companies have taken it seriously is because so many kids have
have decided (brainwashed) to play with it.  With enough marketing and
propaganda you can make people believe whatever you want them to believe.
Java is also the "blue collar" programming languages, which means
corporations get to exploit people all around the world in order to make
even more profits.



>
> D's fight is with C, C++, Go, not with Java.  D needs to make inroads
> into areas currently dominated by C and C++ and those being swept up in
> the tide of Go.
>
> If D is to be anything other than a interesting blip in the history of
> programming languages it needs to gain traction from more than just the
> core aficionados.
>
> So which area can D compete well in, who are the people and
> organizations who can show that D is better than C, C++, D, and Go in
> these areas.  Why are they not out there doing guerilla marketing of D?
>
> > Most Java benchmarks I've seen that showed Java being competitive were
> written
> > in Java (or at least Java style) and then ported to other languages. The
> reason
> > is because if you want to convert C, C++, or D code to Java, you have to
> > re-engineer it.
>
> So people doing the benchmarks you have seen are substandard and don't
> realize you are supposed to write the best idiomatic version of the
> algorithm in each of the languages under test.  This is not a stick to
> beat Java with.
>
>
So far I have competed in the ACM ICPC regional programming contests
twice.  I've met many students there and I've had many teammates, most if
not all of them Java programmers.  Besides me (I've never actually done any
Java), I don't know any other C++ programmer in there.  I have seen
countless problems solved in Java and C++, with Java always being 10-20
times slower: same problem, same algorithms and/or data structures.
Whenever I find an article that talks about Java being faster than C++, I
know it's BS.  You can find fair comparisons at http://www.spoj.pl/

Java is also very sluggish.  I don't exactly know why, but I'm sure it has
something to do with JVM and/or GC.  Just look at Android and compare it to
iPhone to see what I mean.  Apps running on the PC written in Java are also
sluggish: Things like Eclipse and Open Office come to mind.

Java is a joke.  It's a faith-based ideology.  Get over it.


> > The reason escape analysis is used in the JVM is because the Java
> bytecode is
> > severely limited in what it can express. So, a language bytecode
> generator has
> > to bash its semantics somehow into that tiny vocabulary, and then the
> JVM has to
> > "reverse engineer" the intent back out of it. The effort poured into the
> JVM is
> > to recognize higher level Java constructs, not higher level Scala
> constructs,
> > hence the poor results from Scala mentioned in the article.
>
> Fortran compiler writers have been doing this sort of thing very
> successfully for years:  1960s Fortran 4 serial code gets converted into
> parallel code by clever inferences and "reverse engineering.
>
> It has always amazed me that owners of these old Fortran codes think it
> is more important to expend resources on clever compiler trickery that
> just to rewrite the codes in a modern language, like Fortran 2009.
>
> Of course rewriting would give an opportunity to change language.  I bet
> they would go to C++ not D.  Though staying with Fortran 2009 may be
> even better.
>
> So the real question here is to get some benchmarks together to show
> that D outshines C, C++ and Fortran 2009 -- with of course the
> benchmarks being written properly in idiomatic language for each
> language not, as you noted earlier, transliterations from one language
> to all the others.
>
>
> --
> Russel.
>
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip:
> sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@russel.org.uk
> London SW1

Re: Java > Scala

2011-12-17 Thread Caligo
On Fri, Dec 2, 2011 at 2:19 AM, Russel Winder  wrote:

> Java is the main language of development just now.  D is a tiny little
> backwater in the nether regions of obscurity.  If any language is a joke
> here, it is D since it is currently unable to claim any serious market
> share in the world of development.  The sooner you accept this, the
> sooner you can discuss the shortcomings of a language you have no
> experience of, by your own admission.
>
> Your point about how languages become popular has some merit, albeit
> stated in an overly bigoted fashion.
>

That's like saying people should take Coke and Pepsi more seriously because
they have bigger market shares when in reality all you need is water.
Money isn't real, you know?

D is already a success, a BIG success.  Walter and Andrei (and the amazing
community, of course) have created a programming language that is light
years ahead of C++, Java and Go.

I don't think you know this, but every high school student who takes a
computer science course is required to learn Java.  It doesn't stop there:
in college and university it's all Java, too, and this has been going on
for almost two decades.  And before Java it was mostly C++, but it was
phased out.  Unless the course specifically requires a different
programming language (which is rare), you have to beg to use a different
programming language (which I did).  Sometimes professors do allow other
programming languages, but they mostly limit it to C/C++.  In most cases
students either have to accept it and do what they are told to do, or fail
the course.  If that's not indoctrination, I don't know what is.  Also, the
reason they restrict education to things like Java and C++ has very little
to do with the fact that those languages have claimed big market share;
rather, it's because corporations have had a vested interest in
universities in the first place and they receive what they order.  Just
look at what Microsoft has been doing in universities: everything from
"free" gifts such as free copies of Windows OS and Visual Studio Ultimate
that cost thousands of dollars to sponsoring various kinds of events.  The
students who are influenced by such tactics, to whom do you think they are
going to be loyal to?

The _main point_ here is that if students had been give the choice to learn
a programming language of their choosing, many of the so called
"successful" programming languages would not have been so "successful"
today.  So next time you decide to lecture someone on how popular or
"successful" Java is, just remember how it got to be so "successful".


Your point about exploitation should be aimed at the entirety of the
> economic systems of the world.  The systems in the USA, India and China
> (the three main economies of the world) rest completely and solely on
> exploitation.  It's called capitalism.
>

I do see the entirety of the economic system of the world, and, no, it's
NOT called capitalism.  It's called the Monetary System.  Capitalism,
Socialism, Communism, etc,... they are all inherently the same because they
are all based on the Monetary System.  Money is created out of debt, and
money is inherently scarce.  Differential advantage and exploitation is
name of the game, regardless of the form of government you have.  And as
far as I know, India isn't even in the top five;  USA, China, and Japan are
in the top three.


>
> [...]
>
> > So far I have competed in the ACM ICPC regional programming contests
> > twice.  I've met many students there and I've had many teammates, most if
> > not all of them Java programmers.  Besides me (I've never actually done
> any
> > Java), I don't know any other C++ programmer in there.  I have seen
> > countless problems solved in Java and C++, with Java always being 10-20
> > times slower: same problem, same algorithms and/or data structures.
> > Whenever I find an article that talks about Java being faster than C++, I
> > know it's BS.  You can find fair comparisons at http://www.spoj.pl/
>
> If you have never used Java or never actually investigated the issues as
> to when Java is significantly slower than C++ and when it is as fast as
> C++ then clearly you have no grounds on which to express any opinion
> based on facts, it is just prejudice and bigotry.  Such comments have no
> place in any discussion.
>

I choose to ignore Java for technical and non-technical reasons.  Unlike
you, I don't need to spend years of my life doing Java programming to
realize what a joke it is, and I have never seen a case where Java was just
as fas as C++.  This is one of those myths, or corporate propaganda, that's
been propagated by educated idiots.  I and the teams I've been a member of
have solved countless CS problems that have required every kind of data
structure and algorithm, and not once have I seen Java come close to
C/C++.  On average, Java has been about 20 times slower than C++ and
requiring on average 50 times more memory when it came to solving those
problems. 

Re: dfeed/gravatar issue

2011-12-17 Thread Caligo
On Sun, Dec 11, 2011 at 3:03 PM, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:

> I'm finding myself unable to set up my own Gravatar picture with dfeed.
> This is because I post on this newsgroup as seewebsiteforem...@erdani.org,
> which is a non-existent email address. Gravatar, however, requires the
> email to point to an attended mailbox because they send you the activation
> link to it.
>
> I already have a Gravatar account set up with my actual email address.
> What steps could I take to associate my newsgroup post email with my actual
> Gravatar account?
>
>
> Thanks,
>
> Andrei
>

OT, but what is your email address for TDPL Errata?  I wanted to send in a
correction, but the link 'contact Andrei' is broken.


Re: std.container and classes

2011-12-17 Thread Caligo
On Tue, Dec 13, 2011 at 9:08 PM, Jonathan M Davis wrote:

> Is the plan for std.container still to have all of its containers be final
> classes (classes so that they're reference types and final so that their
> functions are inlinable)? Or has that changed? I believe that Andrei said
> something recently about discussing reference counting and containers with
> Walter.
>
> The reason that I bring this up is that Array and SList are still structs,
> and
> the longer that they're structs, the more code that will break when they
> get
> changed to classes. Granted, some level of code breakage may occur when we
> add
> custom allocators to them, but since that would probably only affect the
> constructor (and preferably wouldn't affect anything if you want to simply
> create a container with the GC heap as you would now were Array and SList
> classes), the breakage for that should be minimal.
>
> Is there any reason for me to not just go and make Array and SList final
> classes and create a pull request for it?
>
> - Jonathan M Davis
>

What happens in cases where you need to extend functionality of those
containers by inheritance?  With structs you'll have to rely on composition.


Re: Java > Scala

2011-12-17 Thread Caligo
On Sat, Dec 17, 2011 at 11:01 PM, Jonathan M Davis wrote:

> In my experience, it's the professors who get to choose what they're
> teaching
> and the main reason that Java is used is a combination of its simplicitly
> and
> the fact that it's heavily used in the industry. C and C++ have a lot more
> pitfalls which make learning harder for newbie programmers. Java does more
> for
> you (like garbage collection instead of manual memory management) and has
> fewer ways to completely screw yourself over, so it makes more sense as a
> teaching language than C or C++. And since the primary focus is teaching
> the
> principles of computer science rather than a particular programming
> language,
> the exact language usually doesn't matter much.
>

In my experience professors only get to choose what to wear to class, lol.

It's interesting how many professors choose the same exact text book for
the same courses they teach.  And it's also interesting how those textbooks
cost 10 times more than the equivalent book covering the same material.
Some professors even give out the same exams as other professors in
different universities.  So, no, I don't think professors get to choose
either.  It's as if they are given a script, and they have to follow it
pretty closely (ABET might have something to do with this, idk).  I've had
many professors who severely rejected the idea of using something else
besides Java for a given project, and I never understood why (even in
junior and senior years).

Python is just as simplistic as Java, used heavily in the industry, and a
more elegant language.  So, what's the excuse for not allowing something
like Python?  oh, maybe because it's an open source project and no
corporation has direct control over it, no?

It's also interesting to see how the choice of Java in schools and
universities has NOT produced better computer scientists and software
engineers.  I've lost count of people I've worked with in group projects
that had not freaking clue as to what they were doing.  I've even had TAs
working on their PhDs and couldn't compile 200 lines of code written in
something else besides Java or C#.

*sigh*
Maybe I should have gone to a private school.


>
> Now, this _does_ have the effect that the majority of college students are
> most
> familiar and comfortable with Java, and so that's what they're generally
> going
> to use (so there _is_ a lot of indoctrination in that sense), but that's
> pretty much inevitable. You use what you know. Ultimately though, that's
> what's likely to happen with most any university simply because teaching
> programming languages is not the focus - teaching computer science is. And
> for
> most of that, the language isn't particularly relevant.
>
> And Java was successful before they started using it in universities, or it
> likely wouldn't have been used much in them in the first place. It's just
> that
> that has a feedback effect, since the increased used in universities tends
> to
> increase its use in industry, which tends to then make the universities
> more
> likely to select it or to stick with it as long as they don't have a solid
> reason to switch. But I believe that the initial switch was a combination
> of
> the fact that its popularity in industry was increasing and the fact that
> it
> works much better as a teaching language than C or C++. It's not because of
> anything that corporations did (aside from saying that they used it), since
> Java isn't a language where donating stuff or discounting really helps
> (unlike
> C++), since almost all of the tools for Java are free.
>
> - Jonathan M Davis
>

Well, I disagree because Java in the beginning was a complete failure as a
language, and they looked for ways to market it.  To them it was a product
rather than a programming language that was going to help them make money
and have control over the industry.  Nearly the same exact thing happened
with Microsoft Windows: an inferior OS that suddenly became popular and has
helped generate billions of dollars of profit and control over 90% of the
desktop market share.

Java being a great teaching language is something that not everyone will
accept.  Allowing diversity in schools so that students and professors get
to choose what programming language they want to learn and teach, without
pressure from the industry, is something that I think most will agree needs
to happen.


Re: Java > Scala

2011-12-18 Thread Caligo
On Sun, Dec 18, 2011 at 12:17 AM, Russel Winder wrote:

> On Sat, 2011-12-17 at 22:45 -0600, Caligo wrote:
> [...]
>
> I thought this thread had finished, but...
> >
> > That's like saying people should take Coke and Pepsi more seriously
> because
> > they have bigger market shares when in reality all you need is water.
> > Money isn't real, you know?
>
> Taking that paragraph out of the context of the previous emails in the
> thread leads to misinterpretation of what was being said.
>
>
Taking things out of context wasn't my intention.  I said what I said
because, based on what you said, it seemed to me that your definition of
the word "success" depended heavily on the size of the market share claimed
by something.


> > D is already a success, a BIG success.  Walter and Andrei (and the
> amazing
> > community, of course) have created a programming language that is light
> > years ahead of C++, Java and Go.
> >
> > I don't think you know this, but every high school student who takes a
> > computer science course is required to learn Java.  It doesn't stop
> there:
>
> I didn't know this, but I guess it is only a factor in the USA.  In the
> rest of the world, it is almost certainly not the case.  It definitely
> isn't in the UK.
>
>
The education system is really bad here in the U.S.  It's a joke, really.
If you question the education system, or anything that the government does
for that matter, you are being un-American.  At one point I was asked to
leave the country when I challenged the education system at the university.

Watch the documentary "Waiting for Superman" to get an idea of how bad it
is, and that's everything before university.  I know certain countries
offer better education, but I still think the issue is global.

I've had professors who have PhDs from big universities like Princeton, yet
they can't speak nor write proper English.  How the hell does that happen?
And then some of them teaching data structures and algorithms or software
engineering without having a clue as to what they are teaching if it wasn't
for the textbooks.



> I suspect the major problem with most educators -- only in USA and Italy
> are all educators called professors, in places like UK, France and
> Germany, professor is a title that has to be earned and is a matter of
> status within the system -- is that they are themselves under-educated.
> Far too many educators teaching programming cannot themselves program.
> Their defensive reaction is to enforce certain choices on their
> students.  Sometimes there is a reasonable rationale -- you don't write
> device drivers in Prolog, well unless you are using ICL CAFS -- but
> generally the restriction is because the educator doesn't know any other
> programming language than the one they enforce.
>

I agree.


> > reason they restrict education to things like Java and C++ has very
> little
> > to do with the fact that those languages have claimed big market share;
> > rather, it's because corporations have had a vested interest in
> > universities in the first place and they receive what they order.  Just
> > look at what Microsoft has been doing in universities: everything from
> > "free" gifts such as free copies of Windows OS and Visual Studio Ultimate
> > that cost thousands of dollars to sponsoring various kinds of events.
>  The
> > students who are influenced by such tactics, to whom do you think they
> are
> > going to be loyal to?
>
> I worry more about what Macdonalds does in primary schools.  Enforcing
> pupils to learn to count by counting BigMacs strikes me as the worst
> sort of indoctrination.
>
> Your description of Microsoft's behaviour is a natural consequence of
> the economic system.  Using marketing budget to indoctrinate people into
> buying your product is all that is going on.  Some companies realize
> that spending that money on molding the minds of 2--12 year olds is the
> way of creating an income stream in the future.
>
>
I agree.


> > The _main point_ here is that if students had been give the choice to
> learn
> > a programming language of their choosing, many of the so called
> > "successful" programming languages would not have been so "successful"
> > today.  So next time you decide to lecture someone on how popular or
> > "successful" Java is, just remember how it got to be so "successful".
>
> The single most important factor here is that people learn to program
> using more than one paradigm of computation and thus more than one
> language -- FOOPLOG and Scala are special case, that are interesting 

Re: Java > Scala

2011-12-20 Thread Caligo
On Tue, Dec 20, 2011 at 2:09 AM, Russel Winder  wrote:
>
> Musicians are coming up with new ways of funding things that is working
> very well.  Pre-sales.  Put out the road-map and business plan for an
> album or concert.  Take bookings and money before committing to
> anything, then you have the cash float to make commitments.  Organizing
> it from cash flow means no need for sponsors.  Except that once the show
> realization is on the road you can inform the sponsors of what a
> successful event this is going to be and how they are going to look bad
> if they are not there.
>
> PyCon UK (un)conferences tend to get organized on this model these days.
>
> Obviously though it is all about having the contacts who can commit
> budget.


I don't understand why Walter, Andrei, or other D experts aren't going to
universities to give talks.  As far as I know it costs no money.  At least
it didn't cost us anything to set up an even when we were activists.  You
just need to ask and reserve a room, such as an auditorium.  It doesn't
have to be some official corporate sponsored DCon.  Don't forget a YouTube
version :-)


Re: std.container and classes

2011-12-20 Thread Caligo
On Sun, Dec 18, 2011 at 10:12 PM, Jonathan M Davis wrote:

> So, I'm beginning to think that we're going to have to go the struct route.
>
> - Jonathan M Davis
>

Two questions:

1. If you guys, the D experts, are having such a difficult time with this,
what happens to the rest of us when we need to implement data structures
that are not offered by Phobos?  Do we just wait and see what happens with
Phobos and learn from it?

2.  Are the new containers going to be multi-threaded?  i.e., will I be
able to insert elements into a container from multiple threads?


Could we have mod in std.math?

2011-12-20 Thread Caligo
1.
The % operator, just like in C/C++, calculates the remainder, but it
doesn't handle negative numbers properly.  It's not a mod operator, even
though sometimes it's called that.

  assert(-6 %  20 == -6);
  assert( 6 % -20 ==  6);
  assert(-6 % -20 == -6);

I use my own mod function whenever I need to handle negative numbers.  It
looks like this:

pure T mod(T)(T n, T d) if(isIntegral!(T)){
  T r = n % d;
  return sgn(r) == -(sgn(d)) ? r + d : r;
}

  assert(mod(-6,  20) ==  14);
  assert(mod( 6, -20) == -14);
  assert(mod(-6, -20) == -6);

I'm hoping to see something like the above mod function in Phobos someday.
And perhapse a 'rem' or 'remainder' function that's a wrapper for the %
operator, just to stay consistent.

2.
With the above, the math.fmod then would have to be renamed to 'frem'
because, just like the % for integrals, it doesn't handle negative numbers
properly only calculates the remainder.

  assert(fmod(-6,  20) == -6);
  assert(fmod( 6, -20) ==  6);
  assert(fmod(-6, -20) == -6);

I'm not so sure why we have 're­main­der` and `remquo` in std.math when
there is 'fmod`, though.

What do you guys think?


Re: good news for vi(m) users?

2011-12-21 Thread Caligo
On Sun, Dec 18, 2011 at 10:21 PM, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:

> http://code.google.com/p/vim/**issues/detail?id=34
>
> Andrei
>

Great.  I don't use vi, but I may give it a try just because of this.  D
doesn't have good support in Emacs, and I hope it gets some love.


Re: @noreturn ?

2011-12-24 Thread Caligo
On Sat, Dec 24, 2011 at 2:09 PM, bearophile wrote:

>
> I don't fully understand why such attribute is so useful in C programs
>
> Bye,
> bearophile
>

Functions are like people.  Sometimes they go places that's so beautiful
that they never want to return.


*sigh*

2011-12-26 Thread Caligo
At the moment I don't see how anything serious can be done with D.  In the
past few weeks, while working on a _toy_ project, I've encountered several
bugs that have caused a lot of problems and wasted a lot of time.  Sorry,
but it's just frustrating.  it's gotten to the point where I have to rum
DMD every time I add/modify 10 lines of code just to make sure the compiler
doesn't die.

Two of the bugs were causing 'internal errors', but I never managed to
isolate the issue so that I could bug report them.  I can't reproduce them
outside of my project, but at the moment I have managed to not have them
get triggered.  I also use GDC-4.6, which sometimes performs better.

*sigh*
Now that I got that off my chest...

I need to figure out what this is because I can't compile my code anymore,
and I get this:

  dmd: glue.c:1065: virtual unsigned int Type::totym(): Assertion `0'
failed.
  Aborted

I don't want to spend hours shuffling code around to find out what's
causing it :(


Re: *sigh*

2011-12-27 Thread Caligo
On Tue, Dec 27, 2011 at 1:59 AM, Andrew Wiley wrote:

> On Tue, Dec 27, 2011 at 1:56 AM, Caligo  wrote:
> > At the moment I don't see how anything serious can be done with D.  In
> the
> > past few weeks, while working on a _toy_ project, I've encountered
> several
> > bugs that have caused a lot of problems and wasted a lot of time.  Sorry,
> > but it's just frustrating.  it's gotten to the point where I have to rum
> DMD
> > every time I add/modify 10 lines of code just to make sure the compiler
> > doesn't die.
> >
> > Two of the bugs were causing 'internal errors', but I never managed to
> > isolate the issue so that I could bug report them.  I can't reproduce
> them
> > outside of my project, but at the moment I have managed to not have them
> get
> > triggered.  I also use GDC-4.6, which sometimes performs better.
> >
> > *sigh*
> > Now that I got that off my chest...
> >
> > I need to figure out what this is because I can't compile my code
> anymore,
> > and I get this:
> >
> >   dmd: glue.c:1065: virtual unsigned int Type::totym(): Assertion `0'
> > failed.
> >   Aborted
> >
> > I don't want to spend hours shuffling code around to find out what's
> causing
> > it :(
>
> Have you tried Dustmite?
> https://github.com/CyberShadow/DustMite
>
> It works excellently for reducing ICE bugs. More Linux friendly than
> Windows because you've got to write some shell scripts, but it's worth
> it.
>

I'll take a look at DustMite in the morning, and once I get some rest.

But, I found the bug!



---8<--8<--
struct A{

  A opBinary(string op)(const ref A a){ A rt; return rt; }

  void fun(){ }
}

struct B{

  A _a;
  alias _a this;
}


void main(){

  B b1, b2, b3;
  b3 = (b1 - b2).fun();
}
--->8-->8--

Which causes:

dmd: glue.c:1065: virtual unsigned int Type::totym(): Assertion `0' failed.
Aborted

DMD 2.57, 64-bit.

I'll check in the morning if it's already been bug reported.


Re: *sigh*

2011-12-27 Thread Caligo
On Tue, Dec 27, 2011 at 9:10 AM, Adam D. Ruppe wrote:

> On Tuesday, 27 December 2011 at 08:59:33 UTC, Caligo wrote:
>
>> But, I found the bug!
>>
>
> I'm pretty sure that's the same bug I hit over the weekend,
> but couldn't get isolated.
>
> In my case, it was caused by one of the parameters being
> of type __error__ which isn't handled in the totym() switch.
>

I think DMD should just give error and refuse to compile: "Error:
expression (b1 - b2).fun() is void and has no value"


http://d.puremagic.com/issues/show_bug.cgi?id=7173


Re: *sigh*

2011-12-27 Thread Caligo
On Tue, Dec 27, 2011 at 9:25 AM, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:

> The way I see it is, you are a customer (and one who has had enough
> faith to hang around for a while), so your issues should be given
> priority. We can and we should improve quality in the abstract, but at
> the end of the day it's about the human beings who are using the language.
>

I prefer to be called a "user" rather than a "customer".  Even better, a
"member" of _D_ revolution.
:-)

Let me make a couple of points about this code. (To be clear, neither
> justifies the presence of an internal compiler error.)
>
> First, you are returning a reference to a local. That is automatically
> suspicious, although I assume this is reduced code from something
> meaningful.
>
> Second, you are exploring a territory that is hardly accessible with other
> languages - operator overloading with consolidated implementation in
> conjunction with subtyping. That means it's not run-of-the-mill stuff the
> compiler is failing with, it's stuff that you would need to abandon
> wholesale if you switched languages.
>
> Again, that's not a justification for the code not working with a
> meaningless error message. I want to warn against the paradoxical "I can't
> get creative use of feature X working, therefore I'm going back to my old
> language where I can't even think of X."
>
> That _all_ being said, creative use of creative D features is a prime
> attraction factor of D and we must have them down perfectly. As I mentioned
> once, very often the first use of D by newcomers is not some shit task;
> shit tasks can be done in any language. It's some difficult task that D
> features promise a miraculous solution for, one that would be quite hard to
> achieve with other languages.
>
>
> Andrei
>

Actually, in regards to this issue, there isn't anything meaningful in my
code because:

somewhere in my project there is a member function that returns void,
represented in the code I posted by "fun()".  Then there is a another
member function that returns non-void, and its name differs only by a
letter (we'll call it here funs() ).  When I was coding I meant to call
funs(), and not fun().  When it came time to compiling the code, I got the
non-informative error message. This

b3 = (b1 - b2).funs();

made the error go away, but it wasn't easy to find.  This has been an
accidental bug discovery, :-)

I know bitching about issues isn't productive, but sometimes it gets
frustrating.  Programming in D is very exciting and fun, and
compiler/language bugs get in the way.


Re: The God Language

2011-12-29 Thread Caligo
On Thu, Dec 29, 2011 at 3:16 AM, Walter Bright
wrote:

> http://pastebin.com/AtuzJqh0
>

This is somewhat of a serious question:  If there is a God (I'm not saying
there isn't, and I'm not saying there is), what language would he choose to
create the universe?  It would be hard for us mortals to imagine, but would
it resemble a functional programming language more or something else?  And
what type of hardware would the code run on?  I mean, there are
computations happening all around us, e.g., when an apple falls or planets
circle the sun, etc, so what's performing all the computation?


Re: The God Language

2011-12-29 Thread Caligo
On Thu, Dec 29, 2011 at 4:40 AM, Gour  wrote:

>
>
> Just answer the following question: Are we mortals the result of pure
> function or just side-effect?
>
>
>
You are asking about creationism and evolution, aren't you?  I have to say
that I don't know.

Always trust the one who is looking for the truth, not the one who has
found it. :-)


Re: const - Best practices

2011-12-31 Thread Caligo
On Sun, Jan 2, 2011 at 4:43 PM, Jonathan M Davis wrote:

>
>
> - Jonathan M Davis
>

Almost a year has passed, and what is the state of const now?  Is it still
broken?  I've been reading some threads on SO, and I'm a bit confused as to
what's correct in my code and what's not.


Re: Happy New Year in 2012....

2011-12-31 Thread Caligo
On Sat, Dec 31, 2011 at 11:34 PM, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:

> to the entire D community!
>
> Andrei
>

Happy New Year.

:-)


Re: Happy New Year in 2012....

2012-01-01 Thread Caligo
On Sat, Dec 31, 2011 at 11:34 PM, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:
>
> to the entire D community!
>
> Andrei


I used GitStats to gather some statistics on DMD.  My favorites:

Age - 932 days, 598 active days (64.16%)
Total Files - 1_016
Total Lines of Code - 328_727 (525_735 added, 197_008 removed)
Total Commits - 2_876 (average 4.8 commits per active day, 3.1 per all days)
Authors - 30 (average 95.9 commits per author)
Busiest month in 2011 - July with over 450 commits
Compared to 2010, there were 4 times as many commits in 2011

Top 10 Authors:
Walter Bright1440 (50.07%)
Don Clugston541 (18.81%)
Brad Roberts402 (13.98%)
k-hara221 (7.68%)
Daniel Murphy70 (2.43%)
dawg63 (2.19%)
KennyTM~29 (1.01%)
Shahid19 (0.66%)
David Nadlinger19 (0.66%)
Michel Fortin17 (0.59%)


2012 is going to be an interesting year.


Re: Can anyone reproduce this?

2012-01-01 Thread Caligo
On Sun, Jan 1, 2012 at 7:51 PM, Timon Gehr  wrote:

> On my machine, the following program causes an access violation in
> druntime instead of throwing an AssertError.
>
> module test;
> void foo(int x){assert(x);}
> void main(){foo(0);}
>
> dmd -run test
> -- killed by signal 11
>
>
> Is this a regression or a problem with my setup (DMD 2.057 on Ubuntu 11.10
> 64 bit)?
> Can anyone reproduce this?
>

mine throws an AssertError.

DMD 2.057, Ubuntu 11.10 64bit


Re: Can anyone reproduce this?

2012-01-01 Thread Caligo
On Sun, Jan 1, 2012 at 8:07 PM, Joshua Reusch  wrote:

> Am 02.01.2012 02:51, schrieb Timon Gehr:
>
>  On my machine, the following program causes an access violation in
>> druntime instead of throwing an AssertError.
>>
>> module test;
>> void foo(int x){assert(x);}
>> void main(){foo(0);}
>>
>> dmd -run test
>> -- killed by signal 11
>>
>>
>> Is this a regression or a problem with my setup (DMD 2.057 on Ubuntu
>> 11.10 64 bit)?
>> Can anyone reproduce this?
>>
>
> Seems like an 64 bit error. On my Ubuntu 11.10 machine (32bit) with the
> same dmd version, it "works" as expected.
>

I have the same exact setup as the OP, and mine works as expected, too.
 Doesn't seem like a 64-bit issue.


Re: The God Language

2012-01-02 Thread Caligo
On Mon, Jan 2, 2012 at 4:29 PM, Timon Gehr  wrote:

> On 01/02/2012 09:00 PM, Nick Sabalausky wrote:
>
>> "maarten van damme"  wrote in message
>> news:mailman.1985.1325157846.**24802.digitalmars-d@puremagic.**com...
>>
>>> I think it would be an object oriented language, I'm a believer in the
>>> string theory :)
>>>
>>
>> I heard on the Science Channel that M-theory was becoming favored over
>> string therory. (Not that I would actually know.)
>>
>>  I have actually thought of the whole universe as one big simulation,
>>> would
>>> really explain how light waves without medium (like a math function).
>>>
>>>
>> I came across a book one time that talked about the 'verse basically being
>> one big quantum computer. I didn't actually red through it though, and I
>> can't remember what it was called... :(
>>
>>  If I were god I would def use object oriented because it makes for easy
>>> describing of different particles and strings. and I'm pretty sure there
>>> is
>>> no garbage collector included in gods language :p
>>>
>>>
>> If I were god, then I'd presumably be omnipotent, and if I were
>> omnipotent,
>> then I'd be able to do it all in something like FuckFuck, or that
>> shakesperian language, or that lolcat language without any difficulty.
>> And I
>> could just fix any limitations in the implementation. So that would seem
>> the
>> best option :)
>>
>>
>>
> God cannot be omnipotent. If he was, he could invent a task he cannot
> solve.
>

He has; the human race.


Re: Discussion about D at a C++ forum

2012-01-08 Thread Caligo
On Sun, Jan 8, 2012 at 1:47 AM, Nick Sabalausky  wrote:
> > I was impressed though that none of them seemed to be buying any of the crap
> that "rapidcoder" was spreading.
>

rapidcoder's brother has put up a video on YouTube:

http://www.youtube.com/watch?v=3rI85jH3F4U&feature=related


Re: [OT] destroy all software (was Programming language WATs)

2012-01-20 Thread Caligo
On Fri, Jan 20, 2012 at 9:28 PM, Adam D. Ruppe
 wrote:
> On Friday, 20 January 2012 at 15:40:44 UTC, Robert Clipsham wrote:
>>
>> https://www.destroyallsoftware.com/talks/wat
>
>
>
> Curious: anyone here checked out the author's screencasts?
>
> I found this video amusing so I looked at the others,
> but he wants money for it.
>
> Worth the ten bucks?
>
>

You could watch this for free, but it's not amusing.  I know, I just graduated.

http://www.youtube.com/watch?v=VpZtX32sKVE


Re: [OT] Programming language WATs

2012-01-20 Thread Caligo
On Fri, Jan 20, 2012 at 9:40 AM, Robert Clipsham
 wrote:
> Just came across this amusing 4 minute video:
>
> https://www.destroyallsoftware.com/talks/wat
>
> Anyone have any other WATs you can do in other languages? Bonus points for
> WATs you can do in D.
>
> --
> Robert
> http://octarineparrot.com/


Maybe a WAT for people new to D.  I personally found this to be
confusing and inconsistent.

  float[4] sa = [1, 2, 3, 4];
  float[] da = [1, 2, 3, 4];

  fill(da, map!(sqrt)(da));  // works
  fill(sa, map!(sqrt)(sa));  // doesn't work

  fill(sa[], map!(sqrt)(sa[]));  // ok


Emacs D mode needs love

2012-02-04 Thread Caligo
I would like to kindly request for Emacs D mode to be updated.  I've
been using 2.0.4, which I think was last released in 2007, but it
doesn't reflect the latest version of D.  Its indentation also has
issues.


Re: [OT] I ported Empire to D2 and made it cross platform.

2012-02-05 Thread Caligo
On Sun, Feb 5, 2012 at 8:44 PM, Bernard Helyer  wrote:
> I've tried multiple times to contact Walter through his websites, but
> apparently _that's_ a dead end so...
>
> http://i.imgur.com/DzrN6.png
>
> Look at it! The selection pulses! Empire's never looked so good!
>
> There are some rough edges; the save games fail to load, demo isn't working,
> the text log isn't cleared correctly. But other than that you can happily
> play a game right through. I can't put the code anywhere because
> distribution is prohibited, so this is my last ditch effort to contact
> Walter.
>
>
> -Bernard.

So I presume that you modified the source code slightly to make it
work?  Or is it a complete rewrite?


Why is there no or or and ?

2012-02-16 Thread Caligo
C++ has this and it makes code little more readable in certain cases:

if(something() or foo() and bar()){  ... }

instead of this in D:

if(something() || foo() && bar()){ ... }


possible enhancement request?  or is there a good reason it is not in
the language?


Re: Why is there no or or and ?

2012-02-16 Thread Caligo
On Thu, Feb 16, 2012 at 10:35 PM, Jonathan M Davis  wrote:
> On Thursday, February 16, 2012 22:31:18 Caligo wrote:
>> C++ has this and it makes code little more readable in certain cases:
>>
>> if(something() or foo() and bar()){  ... }
>>
>> instead of this in D:
>>
>> if(something() || foo() && bar()){ ... }
>>
>>
>> possible enhancement request?  or is there a good reason it is not in
>> the language?
>
> Since when does C++ have "or" and "and"? C++ uses || and &&, just like C and
> Java and C# and... I'm sure that there's a language somewhere whch uses "or"
> and "and," but I've never used one that did.
>
> And I'm actually mildly shocked that anyone (at least any programmer) would
> think that "or" and "and" were more readable. The fact that operators aren't
> words is a _major_ boon to code readibility.
>
> - Jonathan M Davis

In C++ 'and' and 'or', among many others, are alternative logical
operators for && and ||.


Re: Why is there no or or and ?

2012-02-16 Thread Caligo
http://en.cppreference.com/w/cpp/language/operator_alternative


Re: Why is there no or or and ?

2012-02-16 Thread Caligo
On Thu, Feb 16, 2012 at 11:16 PM, Nick Sabalausky  wrote:
>
> This is why I think people are nuts when they claim that english-like
> VB-style syntax is more readable than C-style.
>
> (Yea, to a grandmother with zero programming experience english-like
> languages are more readable. For a programmer it's worse becase code !=
> english.)
>
>

This is not about having an English-like syntax.  Not every programmer
speaks English, but nearly every programming language uses English
words.  At least for them 'and'  and && are about the same.

I can agree that having multiple operators that do the exact same
thing can be problematic, so such a change might be too late for D
(unless we replace &&, ||, etc. with 'and', 'or', etc.).  But at the
same time, when I was new to D I found things like 'is' and '=='
confusing, and I'm sure I'm not the only one.

Another thing, most editors render keywords with a different colour
than, say, the logical operators. So in

if(a or b and c){ }

the 'if', 'and', and 'or' are the same colour.


Re: Julia: a language for technical computing

2012-03-10 Thread Caligo
I'm not impressed.  Sage is superior in many ways, and many who use
things like Matlab or Mathematica are moving to Sage.

Here are some old benchmarks:
http://www.sagemath.org/tour-benchmarks.html

They should include Sage in their High-Performance JIT Compiler comparison.

On Fri, Mar 2, 2012 at 6:26 AM, renoX  wrote:
> Hello,
>
> the thread about tuples reminded about Julia because it supports tuples
> natively and its syntax for (de)constructing tuples is simple:
> http://julialang.org/manual/functions/
>
> It's a very different language from D, being dynamically typed (but with
> optionnal static typing and multiple dispatch) but it's still interesting:
> opensource (MIT licensed) and 1.0 release recently, so for those who like
> languages:
>
> http://julialang.org/
>
> Best regards,
> renoX


Re: Feq questions about the D language

2012-03-11 Thread Caligo
D is not ready for anything.  At the very best, It's in alpha.  Don't
let others make you think otherwise.

DMD is one of the buggiest compilers out there.  If you are a
non-DMD/Phobos developer and think that D is ready for any kind of
work then you must be high on dope.

If you want to learn a new programming language and experience D, then
go for it.  The language itself is very enjoyable, specially if you
are coming from C/C++/Java.  However, anything more than a 1K LOC is
going to get you in trouble, specially if you decide to use one of the
_nice_ features of the language.

Yes, things are improving rapidly, but I would say it's going take at
least another year before DMD is stable.


Re: Feq questions about the D language

2012-03-11 Thread Caligo
On Sun, Mar 11, 2012 at 2:46 PM, Andrei Alexandrescu
 wrote:
> On 3/11/12 1:44 PM, Caligo wrote:
>>
>> D is not ready for anything.  At the very best, It's in alpha.  Don't
>> let others make you think otherwise.
>
>
> What happened here?
>
> Andrei
>

Bugs causing frustration, that's all.  If someone is new to D, just
like the OP, and they want to do anything serious with D, then they
are going to get frustrated.  At least that's been my experience in
the past year or so, and I'm just trying to save the guy the trouble.
D Developers offering workarounds or urgent bugs getting fixed quickly
is about the only help he's going to get.


Re: Feq questions about the D language

2012-03-11 Thread Caligo
On Sun, Mar 11, 2012 at 3:00 PM, Alex Rønne Petersen
 wrote:
>
> False. MCI is 20k+ lines. We have around 4 workarounds for DMD bugs in the
> source. That is all.
>
> --
> - Alex


Well, I don't know what MCI is.  Maybe you could give us a link?

My own project is maybe 5K lines, and there are at least 4-5
workarounds.  iirc, in the past year I have discovered and reported
half a dozen new bugs, and I have encountered a few dozen bugs that
have already been reported and/or later fixed.  I'm sorry, but time
wasted because of bugs is not fun, UNLESS you are there specifically
to find and resolve DMD issues.

And just for the record, there are software projects that are millions
of lines of code in C/C++ and have ZERO workarounds.  Also, I have
never encountered a bug in GCC when programming in C++, even when
trying out the latest C++11.


Re: Feq questions about the D language

2012-03-11 Thread Caligo
On Sun, Mar 11, 2012 at 5:27 PM, Nick Sabalausky  wrote:
> "Caligo"  wrote in message
> news:mailman.500.1331503046.4860.digitalmar...@puremagic.com...
>>
>>And just for the record, there are software projects that are millions
>>of lines of code in C/C++ and have ZERO workarounds.  Also, I have
>>never encountered a bug in GCC when programming in C++, even when
>>trying out the latest C++11.
>
> Peronally, I find D with some occasional bugs to still be *vastly* nicer to
> deal with than a perfect implementation of C++. YMMV, of course.
>
>

lol, I can totally agree with that.  Maybe that's why I haven't left
D.  Although, getting used to dealing with compiler bugs has some
getting used to.


Re: Negative integer modulo/division

2012-03-14 Thread Caligo
http://www.digitalmars.com/d/archives/digitalmars/D/Could_we_have_mod_in_std.math_152977.html


  1   2   3   >