Re: Containers I'd like to see in std.containers

2010-06-01 Thread dennis luehring
Am 30.05.2010 23:53, schrieb Philippe Sigaud: There are some simple containers I'd like to see in std.containers: - a priority queue - a heap - a stack, a queue - a set Do people here also consider them as containers and useful ones in a standard library? Philippe and a range based tree (

Re: One document about Go

2010-06-01 Thread BCS
Hello Walter, BCS wrote: For that matter, how many expert language designers are there in the world? To make that have an answer, I've heard it said that to be an expert you need to have done something consistently (like as a part time job or more) for about 10 years. So Walter's and expert co

Re: One document about Go

2010-06-01 Thread Walter Bright
BCS wrote: For that matter, how many expert language designers are there in the world? To make that have an answer, I've heard it said that to be an expert you need to have done something consistently (like as a part time job or more) for about 10 years. So Walter's and expert compiler writer

Re: One document about Go

2010-06-01 Thread BCS
Hello Walter, Jérôme M. Berger wrote: Of course, using a decent editor will prevent it: if the editor is able to handle indentation correctly, it will indent the writeln in the same column as the for which makes the problem appear immediately. I think it is a serious mistake to design a lang

Re: One document about Go

2010-06-01 Thread BCS
Hello bearophile, Because (as you can see in my example) you can use/read/write an out argument before calling the function (if you write it before function call, such value gets overwritten), or just after the function entry, and such usages while "safe" are not nice. I've used C# and I can r

Re: Link time optimization in D

2010-06-01 Thread Leandro Lucarella
Walter Bright, el 1 de junio a las 17:18 me escribiste: > Leandro Lucarella wrote: > >LTO is not only targeted at C++. I don't have numbers to talk seriously > >about how a big gain is for C though, which might be closer to D in > >terms of parse time compared with the whole compilation process. E

Re: One document about Go

2010-06-01 Thread BCS
Hello Walter, bearophile wrote: Walter Bright: C got it right and it doesn't need fixing. I have never programmed in Go, but keep in mind that Go designers are expert language designers and programmers. They aren't stupid people. Even experts make mistakes. For that matter, how many e

Re: One document about Go

2010-06-01 Thread Jesse Phillips
On Tue, 01 Jun 2010 21:15:45 -0400, Adam Ruppe wrote: > On 6/1/10, Nick Sabalausky wrote: >> What I do like is what Programmer's Notepad 2 does: when I hit "Enter", >> it auto-indents the new line exactly the same as the line above it. > > Vim does the same. When I'm using some other editor, I a

BinaryHeap

2010-06-01 Thread Andrei Alexandrescu
I think I figured how to define BinaryHeap properly. Currently BinaryHeap is parameterized by its storage support, which must be a random-access range. It is easy to make BinaryHeap figure out whether its support is a random-access _container_ versus a random-access range. In the former case

Re: Binary data-structure serialization

2010-06-01 Thread Andrei Alexandrescu
On 06/01/2010 08:53 PM, bearophile wrote: Andrei Alexandrescu Wrote: Walter and I agreed to let it go, but somehow forgot to announce it. Are stack-allocated (scoped) classes too gone? De facto no, de jure yes. Andrei

Re: Binary data-structure serialization

2010-06-01 Thread Andrei Alexandrescu
On 06/01/2010 08:29 PM, Ellery Newcomer wrote: On 06/01/2010 08:17 PM, Andrei Alexandrescu wrote: On 06/01/2010 07:35 PM, bearophile wrote: Andrei Alexandrescu: Sorry, class allocators are gone. I must have missed the memo :o) Can you explain a bit? It was an ill-defined misfeature that di

Re: Binary data-structure serialization

2010-06-01 Thread bearophile
Andrei Alexandrescu Wrote: > Walter and I agreed to let it go, but somehow forgot to > announce it. Are stack-allocated (scoped) classes too gone? Bye, bearophile

Re: Binary data-structure serialization

2010-06-01 Thread Ellery Newcomer
On 06/01/2010 08:17 PM, Andrei Alexandrescu wrote: On 06/01/2010 07:35 PM, bearophile wrote: Andrei Alexandrescu: Sorry, class allocators are gone. I must have missed the memo :o) Can you explain a bit? It was an ill-defined misfeature that didn't deserve to stay in the language. Walter and

Re: Binary data-structure serialization

2010-06-01 Thread Andrei Alexandrescu
On 06/01/2010 07:35 PM, bearophile wrote: Andrei Alexandrescu: Sorry, class allocators are gone. I must have missed the memo :o) Can you explain a bit? It was an ill-defined misfeature that didn't deserve to stay in the language. Walter and I agreed to let it go, but somehow forgot to anno

Re: One document about Go

2010-06-01 Thread Adam Ruppe
On 6/1/10, Nick Sabalausky wrote: > What I do like is what Programmer's Notepad 2 does: when I hit "Enter", it > auto-indents the new line exactly the same as the line above it. Vim does the same. When I'm using some other editor, I always end up hitting tab or backspace too many times, expecting

Re: One document about Go

2010-06-01 Thread Nick Sabalausky
"Alex Makhotin" wrote in message news:hu438s$jc...@digitalmars.com... > Nick Sabalausky wrote: >> I've used editors that keep trying to re-arrange my code as I type (ex, >> Visual Studio) and I find it to be annoying as hell. It just gets in my >> way, even when it does correctly guess what I

Re: One document about Go

2010-06-01 Thread bearophile
Nick Sabalausky: > Also, note that I haven't even tossed call-chaining or templates into the > mix. You can also add to the mix the C labels used by goto and break, the in{} out{} body{} contract programming syntax, and the private:/public: attributes too, they give me code formatting troubles

Re: One document about Go

2010-06-01 Thread bearophile
Robert Clipsham: >This may be true, but the overhead of loading/setting up a JIT environment at >compile time will have a horrific effect on compile time for most D apps, it >will only show an advantage where there's a lot of CTFE used.< A JIT that is not trash is able to start only when it is

Re: Link time optimization in D

2010-06-01 Thread Alex Makhotin
Walter Bright wrote: I gotta believe that if you're writing Fortran functions and expecting them to be inlined into C code, or other such function-by-function language mixing, things are getting desperate. I have experienced a runtime disaster after executing exe which successfully linked

Re: One document about Go

2010-06-01 Thread Nick Sabalausky
"Steven Schveighoffer" wrote in message news:op.vdm3e1fbeav...@localhost.localdomain... > On Wed, 02 Jun 2010 16:50:05 -0400, Alex Makhotin > wrote: >> >> I prefer ANSI(Allman) style(second example, wrong). >> They want to force Java-like style which I dislike much. > > I do too. You will not

Re: Binary data-structure serialization

2010-06-01 Thread bearophile
Andrei Alexandrescu: > Sorry, class allocators are gone. I must have missed the memo :o) Can you explain a bit? Bye, bearophile

Re: Link time optimization in D

2010-06-01 Thread Walter Bright
Leandro Lucarella wrote: LTO is not only targeted at C++. I don't have numbers to talk seriously about how a big gain is for C though, which might be closer to D in terms of parse time compared with the whole compilation process. Even more, you can do LTO for object files generated from different

Re: One document about Go

2010-06-01 Thread Andrei Alexandrescu
On 06/01/2010 06:09 PM, Walter Bright wrote: For example, many years ago, Microsoft came out with "incremental linking" as a cool new feature to speed up the link process. This got a lot of buzz in the press. My manager at the time decided we need an "incremental linking" feature in order to catc

Re: Binary data-structure serialization

2010-06-01 Thread Andrei Alexandrescu
On 06/01/2010 06:41 PM, Masahiro Nakagawa wrote: On Wed, 02 Jun 2010 06:29:12 +0900, Robert M. Münch wrote: On 2010-05-31 17:01:16 +0200, Trass3r said: Isn't http://digitalmars.com/d/2.0/class.html#ClassAllocator what you want? Ah, that's cool. Didn't saw it. This looks very good. Will tho

Re: Link time optimization in D

2010-06-01 Thread Leandro Lucarella
Don, el 1 de junio a las 20:15 me escribiste: > Michiel Helvensteijn wrote: > >Adam Ruppe wrote: > > > >>>You save time by recompiling only files that have changes. > >>But, then the whole program goes through the process again anyway to > >>perform the optimization. You save a little time in skip

Re: One document about Go

2010-06-01 Thread Ellery Newcomer
On 06/01/2010 06:27 PM, Walter Bright wrote: Bill Baxter wrote: Computer languages exist to make life easier for their human users. So I keep thinking that rather than limit the language's options in terms of grammar, it would be better to just provide an easy-to-use parsing library for the lang

dmdz, take 2

2010-06-01 Thread Ellery Newcomer
it doesn't really need itself to compile itself anymore (there's only 1 or 2 files), but for posterity's sake: http://personal.utulsa.edu/~ellery-newcomer/dmdz/dmdz.zip Rewrote split or whatever it was to be a bidirectional range. Also wrote a nifty join implementation (of which I am very prou

Re: One document about Go

2010-06-01 Thread Robert Clipsham
On 02/06/10 00:45, bearophile wrote: With some work LLVM can be used to JIT-compile the D compile-time functions, so they can probably run quite faster. This may be true, but the overhead of loading/setting up a JIT environment at compile time will have a horrific effect on compile time for mo

Re: One document about Go

2010-06-01 Thread bearophile
Walter Bright: > I've thought many times about adding a D lexer & parser to the standard > library. > It's a good idea. So a D (front-end) written in D can use it while it compiles itself :-) Bye, bearophile

Re: One document about Go

2010-06-01 Thread bearophile
Walter Bright: >dmd inlines delegates to templates when they are passed as alias parameters.< A functional language (Scala is partially a functional language) uses functions everywhere, so inlining of closures is a desired optimization feature. >I know you're a fan of LLVM,< With some work LL

Re: Binary data-structure serialization

2010-06-01 Thread Masahiro Nakagawa
On Wed, 02 Jun 2010 06:29:12 +0900, Robert M. Münch wrote: On 2010-05-31 17:01:16 +0200, Trass3r said: Isn't http://digitalmars.com/d/2.0/class.html#ClassAllocator what you want? Ah, that's cool. Didn't saw it. This looks very good. Will those clases be GCed? Default no. Documentatio

DMD front end with commercial software

2010-06-01 Thread Alex Makhotin
I'm considering to add the D code semantic awareness to the IDE which I develop. Before I start working on it I want to clarify some questions to remove potential confusion in the future. I would like to use the DMD front end for this purpose. As I understand from the DMD front end readme.txt fi

Re: One document about Go

2010-06-01 Thread Walter Bright
Bill Baxter wrote: Computer languages exist to make life easier for their human users. So I keep thinking that rather than limit the language's options in terms of grammar, it would be better to just provide an easy-to-use parsing library for the language that makes adding editor support simple.

Re: One document about Go

2010-06-01 Thread Walter Bright
bearophile wrote: Walter Bright: Firstly, this is not a back end vs front end issue. A compiler can do it in either place, neither is inherently better than the other.< You are right. This thread has gone in wrong directions. What I meant was: Scala language is designed to use delegates ofte

Re: One document about Go

2010-06-01 Thread Alex Makhotin
Nick Sabalausky wrote: I've used editors that keep trying to re-arrange my code as I type (ex, Visual Studio) and I find it to be annoying as hell. It just gets in my way, even when it does correctly guess what I want. And often it doesn't, because I tend to type code in a very non-linear way

Re: One document about Go

2010-06-01 Thread Nick Sabalausky
"Jérôme M. Berger"" wrote in message news:hu3r8t$1t...@digitalmars.com... > I've used editors that keep trying to re-arrange my code as I type (ex, Visual Studio) and I find it to be annoying as hell. It just gets in my way, even when it does correctly guess what I want. And often it doesn't,

Re: If you have to learn just one programming language

2010-06-01 Thread retard
Tue, 01 Jun 2010 17:44:57 -0500, Andrei Alexandrescu wrote: > On 06/01/2010 05:34 PM, retard wrote: >> When a Haskell developer invents something like SafeD, he/she >> immediately opens safed-spec.tex in vim or emacs. The paper is precise >> and published on the standard web site. It might even ge

Re: If you have to learn just one programming language

2010-06-01 Thread Andrei Alexandrescu
On 06/01/2010 05:34 PM, retard wrote: When a Haskell developer invents something like SafeD, he/she immediately opens safed-spec.tex in vim or emacs. The paper is precise and published on the standard web site. It might even get a presentation in some FPL conference. When D gets a new feature, th

Re: One document about Go

2010-06-01 Thread bearophile
Jonathan M Davis: > However, there are cases where you really want the function to be returning > a single value - particularly when you're feeding the result into an > expression - and it's nice to be able to still get other values out of the > function with out or ref parameters. I have not a

Re: One document about Go

2010-06-01 Thread Alex Makhotin
Walter Bright wrote: Code should pass, or it should not. Not sort of, kind of, maybe, depending on switch settings. I agree. That is what option /WX (treat warning as errors) is about. Excuse me for the broken clock(messages seems to appear incorrectly again :(, I should fix this soon). Why

Re: One document about Go

2010-06-01 Thread bearophile
Walter Bright: >Firstly, this is not a back end vs front end issue. A compiler can do it in either place, neither is inherently better than the other.< You are right. This thread has gone in wrong directions. What I meant was: Scala language is designed to use delegates often. For example the ma

Re: If you have to learn just one programming language

2010-06-01 Thread retard
Tue, 01 Jun 2010 05:02:45 +, BCS wrote: > Hello Don, > >> BCS wrote: >> >>> Hello retard, >>> Mon, 31 May 2010 18:23:18 +0200, Pelle wrote: > On 05/31/2010 05:43 PM, retard wrote: > >> For example the lambda syntax is terribly verbose in D compared to >> Scala or

Re: One document about Go

2010-06-01 Thread Nick Sabalausky
"bearophile" wrote in message news:hu3pu5$310...@digitalmars.com... > Jacob Carlborg: >> Making parenthesis optional in function calls and semicolons make quite >> a nice delegate literal syntax: >> >> loop { >> // do something >> } > > It looks also like the Ruby blocks. But D seems designed to

Re: One document about Go

2010-06-01 Thread Bill Baxter
On Tue, Jun 1, 2010 at 2:24 PM, Walter Bright wrote: > Jérôme M. Berger wrote: >> >>        Of course, using a decent editor will prevent it: if the editor is >> able to handle indentation correctly, it will indent the writeln in >> the same column as the for which makes the problem appear immedia

Re: One document about Go

2010-06-01 Thread Jonathan M Davis
bearophile wrote: > Walter Bright: >> > Out parameters are initialized at function entry, so in theory all is >> > good and there are no bugs, but this is a *workaround*, a language >> > kludge, a hack, something dirty that is done because of language >> > limitation, or to keep the language compa

Re: If you have to learn just one programming language

2010-06-01 Thread retard
Tue, 01 Jun 2010 05:19:55 -0400, #ponce wrote: >> For example the lambda syntax is terribly verbose in D compared to >> Scala or Haskell. >> >> > It may seem surprising to you, but there is a lot of project who can't > afford using Scala or Haskell. > > If you're constrained to use D at your da

Re: One document about Go

2010-06-01 Thread bearophile
Walter Bright: > > Out parameters are initialized at function entry, so in theory all is good > > and there are no bugs, but this is a *workaround*, a language kludge, a > > hack, > > something dirty that is done because of language limitation, or to keep the > > language compatible with an ancien

Re: One document about Go

2010-06-01 Thread bearophile
Walter Bright: > Before you joined us, there were huge flamefests about this. I don't know about turning them all into errors, but the missing "override" warning is better as an error, as in C#: http://d.puremagic.com/issues/show_bug.cgi?id=383 The warnings generated by the examples here can bec

Re: One document about Go

2010-06-01 Thread bearophile
> http://d.puremagic.com/issues/show_bug.cgi?id=383 Sorry, I meant: http://d.puremagic.com/issues/show_bug.cgi?id=3836

Re: One document about Go

2010-06-01 Thread Walter Bright
bearophile wrote: Walter Bright: bearophile wrote: I meant that D seems designed to not assume that the back-end is able to inline delegates, and indeed at the moment usually not even LLVM is able to do it (while Scala compiler is able to often perform this optimization, and gives the JavaVM

Re: One document about Go

2010-06-01 Thread Andrei Alexandrescu
On 06/01/2010 05:06 PM, Walter Bright wrote: Andrei Alexandrescu wrote: On 06/01/2010 04:36 PM, Walter Bright wrote: Alex Makhotin wrote: In contrast, Microsoft C/C++ does(with opt. /Wall): warning C4390: ';' : empty controlled statement found; is this the intent? I think it's correct way i

Re: One document about Go

2010-06-01 Thread Walter Bright
bearophile wrote: Walter Bright: bearophile wrote: D language isn't even able to tell if an "out" argument has being used before it is assigned inside the function (as C# compiler is able to, because in C# using uninitialized variables is an error) This is awful and surely worse than multiple

Re: One document about Go

2010-06-01 Thread Walter Bright
Andrei Alexandrescu wrote: On 06/01/2010 04:36 PM, Walter Bright wrote: Alex Makhotin wrote: In contrast, Microsoft C/C++ does(with opt. /Wall): warning C4390: ';' : empty controlled statement found; is this the intent? I think it's correct way it should be done. Warnings are wishy-washy l

Re: One document about Go

2010-06-01 Thread bearophile
Walter Bright: > bearophile wrote: > > I meant that D seems designed to not assume that the back-end is able to > > inline delegates, and indeed at the moment usually not even LLVM is able to > > do it (while Scala compiler is able to often perform this optimization, and > > gives the JavaVM code

Re: One document about Go

2010-06-01 Thread Simen kjaeraas
Jérôme M. Berger wrote: for (int i = 0; i < 10; i++); writeln(i); I have seen students waste minutes locating that bug. I've seen a whole afternoon lost on that one. Of course, using a decent editor will prevent it: if the editor is able to handle indentation correctly, it will i

Re: One document about Go

2010-06-01 Thread bearophile
Walter Bright: > bearophile wrote: > > D language > > isn't even able to tell if an "out" argument has being used before it is > > assigned inside the function (as C# compiler is able to, because in C# using > > uninitialized variables is an error) This is awful and surely worse than > > multiple

OT: Cookie Monster consumes computerized coffee machine

2010-06-01 Thread Walter Bright
I'm not sure what this has to do with D, but it's funny: http://www.youtube.com/watch?v=RowwNXKEt4k

Re: Combining infinite ranges

2010-06-01 Thread bearophile
Andrei Alexandrescu: > And by the way, I added the feature that will ease bearophile's coding > by one order of magnitude: iota with one argument. Thank you. There's a long way to go still :o) Bye, bearophile

Re: One document about Go

2010-06-01 Thread Walter Bright
Alex Makhotin wrote: In contrast, Microsoft C/C++ does(with opt. /Wall): warning C4390: ';' : empty controlled statement found; is this the intent? I think it's correct way it should be done. Warnings are wishy-washy language design. Code should pass, or it should not. Not sort of, kind of,

Re: One document about Go

2010-06-01 Thread Andrei Alexandrescu
On 06/01/2010 04:36 PM, Walter Bright wrote: Alex Makhotin wrote: In contrast, Microsoft C/C++ does(with opt. /Wall): warning C4390: ';' : empty controlled statement found; is this the intent? I think it's correct way it should be done. Warnings are wishy-washy language design. Code should

Re: One document about Go

2010-06-01 Thread Walter Bright
bearophile wrote: I meant that D seems designed to not assume that the back-end is able to inline delegates, and indeed at the moment usually not even LLVM is able to do it (while Scala compiler is able to often perform this optimization, and gives the JavaVM code already optimized in this regard

Re: One document about Go

2010-06-01 Thread Walter Bright
bearophile wrote: D language isn't even able to tell if an "out" argument has being used before it is assigned inside the function (as C# compiler is able to, because in C# using uninitialized variables is an error) This is awful and surely worse than multiple return values. That's a misunder

Re: Binary data-structure serialization

2010-06-01 Thread Robert M. Münch
On 2010-06-01 02:13:18 +0200, Eric Poggel said: After having difficulty getting ddbg to work, I decided to write a dump function so I could easily see my data structures at runtime. The biggest part of it is a json encoder which can handle most D structures. If I recall, it only has trouble

Re: One document about Go

2010-06-01 Thread Walter Bright
Andrei Alexandrescu wrote: On 06/01/2010 03:37 PM, Walter Bright wrote: bearophile wrote: Walter Bright: C got it right and it doesn't need fixing. I have never programmed in Go, but keep in mind that Go designers are expert language designers and programmers. They aren't stupid people. E

Re: Binary data-structure serialization

2010-06-01 Thread Robert M. Münch
On 2010-05-31 17:01:16 +0200, Trass3r said: Isn't http://digitalmars.com/d/2.0/class.html#ClassAllocator what you want? Ah, that's cool. Didn't saw it. This looks very good. Will those clases be GCed? -- Robert M. Münch www.robertmuench.de

Re: Combining infinite ranges

2010-06-01 Thread Andrei Alexandrescu
On 06/01/2010 04:20 PM, Philippe Sigaud wrote: On Tue, Jun 1, 2010 at 23:12, Andrei Alexandrescu mailto:seewebsiteforem...@erdani.org>> wrote: On 06/01/2010 04:06 PM, Steven Schveighoffer wrote: It looks like you're missing some iterations there. -Steve There should b

Re: Combining infinite ranges

2010-06-01 Thread Andrei Alexandrescu
On 06/01/2010 04:20 PM, Steven Schveighoffer wrote: On Tue, 01 Jun 2010 17:12:29 -0400, Andrei Alexandrescu wrote: On 06/01/2010 04:06 PM, Steven Schveighoffer wrote: On Tue, 01 Jun 2010 13:54:01 -0400, Andrei Alexandrescu wrote: The output of the program is: 0 Tuple!(uint,uint)(0, 0) 1 T

Re: One document about Go

2010-06-01 Thread Andrej Mitrovic
I would argue that there will be more people coming to D from languages such as C and C++, versus Python or similar languages that don't use semicolons as statement terminators. And many of them will still use C/C++ because they still have to maintain some projects written in those languages. I

Re: Combining infinite ranges

2010-06-01 Thread Steven Schveighoffer
On Tue, 01 Jun 2010 17:12:29 -0400, Andrei Alexandrescu wrote: On 06/01/2010 04:06 PM, Steven Schveighoffer wrote: On Tue, 01 Jun 2010 13:54:01 -0400, Andrei Alexandrescu wrote: The output of the program is: 0 Tuple!(uint,uint)(0, 0) 1 Tuple!(uint,uint)(0, 1) 2 Tuple!(uint,uint)(1, 1) 3

Re: One document about Go

2010-06-01 Thread Walter Bright
Jérôme M. Berger wrote: Of course, using a decent editor will prevent it: if the editor is able to handle indentation correctly, it will indent the writeln in the same column as the for which makes the problem appear immediately. I think it is a serious mistake to design a language that

Re: Combining infinite ranges

2010-06-01 Thread Philippe Sigaud
On Tue, Jun 1, 2010 at 23:12, Andrei Alexandrescu < seewebsiteforem...@erdani.org> wrote: > On 06/01/2010 04:06 PM, Steven Schveighoffer wrote: > >> It looks like you're missing some iterations there. >> >> -Steve >> > > There should be 5 * 3 = 15 iterations. > > Andrei > The example is: auto c

Re: Combining infinite ranges

2010-06-01 Thread Philippe Sigaud
On Tue, Jun 1, 2010 at 22:54, Philippe Sigaud wrote: > I also found the (simple?) problem to enumerate a range of ranges to be > more interesting than I thought. > Given a range of ranges ... of ranges, of whatever rank, recursively > enumerate it: > > [[a,b,c],[d,e,f],[g,h,i]] > > produce: > > (a

Re: Combining infinite ranges

2010-06-01 Thread Andrei Alexandrescu
On 06/01/2010 04:06 PM, Steven Schveighoffer wrote: On Tue, 01 Jun 2010 13:54:01 -0400, Andrei Alexandrescu wrote: The output of the program is: 0 Tuple!(uint,uint)(0, 0) 1 Tuple!(uint,uint)(0, 1) 2 Tuple!(uint,uint)(1, 1) 3 Tuple!(uint,uint)(1, 0) 4 Tuple!(uint,uint)(0, 2) 5 Tuple!(uint,uint

Re: Combining infinite ranges

2010-06-01 Thread Steven Schveighoffer
On Tue, 01 Jun 2010 13:54:01 -0400, Andrei Alexandrescu wrote: The output of the program is: 0 Tuple!(uint,uint)(0, 0) 1 Tuple!(uint,uint)(0, 1) 2 Tuple!(uint,uint)(1, 1) 3 Tuple!(uint,uint)(1, 0) 4 Tuple!(uint,uint)(0, 2) 5 Tuple!(uint,uint)(1, 2) 6

Re: One document about Go

2010-06-01 Thread Andrei Alexandrescu
On 06/01/2010 03:37 PM, Walter Bright wrote: bearophile wrote: Walter Bright: C got it right and it doesn't need fixing. I have never programmed in Go, but keep in mind that Go designers are expert language designers and programmers. They aren't stupid people. Even experts make mistakes.

Re: One document about Go

2010-06-01 Thread bearophile
Adam Ruppe: > The back end can obviously handle delegates. I meant that D seems designed to not assume that the back-end is able to inline delegates, and indeed at the moment usually not even LLVM is able to do it (while Scala compiler is able to often perform this optimization, and gives the J

Re: One document about Go

2010-06-01 Thread Lurker
== Quote from bearophile (bearophileh...@lycos.com)'s article > Lurker: > Combine the 2 things into one struct and return by value. Multi-value return makes for hard to comprehend code. So, IMO, it's hardly syntactic sugar: it's syntactic grafitti. "You are very wrong, multiple return values are g

Re: One document about Go

2010-06-01 Thread Steven Schveighoffer
On Wed, 02 Jun 2010 16:50:05 -0400, Alex Makhotin wrote: Steven Schveighoffer wrote: where we don't want to (I've done it many times). This is one of those rare cases where people can easily type valid code that does not do what they want. The reason I ask is because I sometimes do empty

Re: One document about Go

2010-06-01 Thread Alex Makhotin
Steven Schveighoffer wrote: where we don't want to (I've done it many times). This is one of those rare cases where people can easily type valid code that does not do what they want. The reason I ask is because I sometimes do empty statements intentionally by placing a semicolon (surprised?)

Re: Combining infinite ranges

2010-06-01 Thread Philippe Sigaud
On Tue, Jun 1, 2010 at 19:54, Andrei Alexandrescu < seewebsiteforem...@erdani.org> wrote: > I thought about this some more, and it's more difficult and more interesting than I thought. Yeah, that's why I proposed it as a challenge. You guys sure seem to like this :) What's interesting, is that i

Re: Containers I'd like to see in std.containers

2010-06-01 Thread Mihail Strashun
On 06/01/2010 10:48 PM, Philippe Sigaud wrote: On Mon, May 31, 2010 at 22:27, Mihail Strashun mailto:m.stras...@gmail.com>> wrote: May be my question will be a bit naive, but what is about boost::multi_index approach? I find it brilliant for dividing container implementation from va

Re: One document about Go

2010-06-01 Thread Jérôme M. Berger
Walter Bright wrote: > bearophile wrote: >> Alex Makhotin: >>> Current DMD compiler version outputs on attempt to make empty statement: use '{ }' for an empty statement, not a ';' >>> Is there a reason? >> >> Yes, it avoids a common type of bug: >> >> for (int i = 0; i < 10; i++); >> writeln

Socket + Thread - any working example??

2010-06-01 Thread Vincent
Hello, guys! Still fighting with my server example and cannot catch what's wrong. Just simple example: == import std.stdio; import std.socket; import core.thread; int main(){ auto srv = new TcpSocket; srv.bind(new InternetAddress(1000)); srv.lis

Re: One document about Go

2010-06-01 Thread Walter Bright
bearophile wrote: Walter Bright: C got it right and it doesn't need fixing. I have never programmed in Go, but keep in mind that Go designers are expert language designers and programmers. They aren't stupid people. Even experts make mistakes.

Re: One document about Go

2010-06-01 Thread Walter Bright
bearophile wrote: Alex Makhotin: Current DMD compiler version outputs on attempt to make empty statement: use '{ }' for an empty statement, not a ';' Is there a reason? Yes, it avoids a common type of bug: for (int i = 0; i < 10; i++); writeln(i); I have seen students waste minutes locat

Re: One document about Go

2010-06-01 Thread Adam Ruppe
On 6/1/10, Lurker wrote: > And I do like what the the > unnecessary "missing" semis do for code readability. To me, missing semicolons look like sentence fragments. I tend to toss them in even on languages that don't require it, since it just looks wrong otherwise :S

Re: One document about Go

2010-06-01 Thread Adam Ruppe
On 6/1/10, bearophile wrote: > It looks also like the Ruby blocks. But D seems designed to work with a > simpler back-end in mind, unable to "digest" delegates. But, D can do the given example, only with parens and an semi thrown in. The back end can obviously handle delegates.

Re: One document about Go

2010-06-01 Thread bearophile
Jacob Carlborg: > Making parenthesis optional in function calls and semicolons make quite > a nice delegate literal syntax: > > loop { > // do something > } It looks also like the Ruby blocks. But D seems designed to work with a simpler back-end in mind, unable to "digest" delegates. Bye

Re: Containers I'd like to see in std.containers

2010-06-01 Thread Philippe Sigaud
On Mon, May 31, 2010 at 22:27, Mihail Strashun wrote: > May be my question will be a bit naive, but what is about > boost::multi_index approach? I find it brilliant for dividing container > implementation from various container interfaces - things you guys are > arguing here about a bit. > > My e

Re: One document about Go

2010-06-01 Thread Jacob Carlborg
On 2010-06-01 21:15, Walter Bright wrote: Lurker wrote: == Quote from bearophile (bearophileh...@lycos.com)'s article In Go you can omit semicolons at the end of lines, so I presume it's not a terrible thing for C-like languages: package main import " fmt " // formatted I/O. func main() { fm

Re: One document about Go

2010-06-01 Thread bearophile
Ali Çehreli: > > Go designers are trying to invent/adopt something simpler than > > C++-style templates > > I will not be surprised when they "invent" the same syntax of a language > Dat Dey've never hearD of... ;) It's not just a matter of syntax, it's something quite different from C++/D

Re: One document about Go

2010-06-01 Thread bearophile
Lurker: >Combine the 2 things into one struct and return by value. Multi-value return >makes for hard to comprehend code. So, IMO, it's hardly syntactic sugar: it's >syntactic grafitti.< You are very wrong, multiple return values are good, if they have a good enough syntax. Regarding this C/C+

Re: One document about Go

2010-06-01 Thread Steven Schveighoffer
On Wed, 02 Jun 2010 15:39:16 -0400, Alex Makhotin wrote: Walter Bright wrote: You inevitably forget to go back and append the ; to the previous line. Current DMD compiler version outputs on attempt to make empty statement: use '{ }' for an empty statement, not a ';' Is there a reason?

Re: One document about Go

2010-06-01 Thread Lurker
== Quote from Walter Bright (newshou...@digitalmars.com)'s article > Lurker wrote: > > When will D support that? Removing unnecessary semis really pretties up the > > code. > This idea reappears every few years, and even gets folded into a language now > and then. It started with Pascal, and most

Re: One document about Go

2010-06-01 Thread bearophile
> for (int i = 0; i < 10; i++); > writeln(i); That's a bad example, sorry :-( Bye, bearophile

Re: One document about Go

2010-06-01 Thread bearophile
Alex Makhotin: > Current DMD compiler version outputs on attempt to make empty statement: > > use '{ }' for an empty statement, not a ';' > Is there a reason? Yes, it avoids a common type of bug: for (int i = 0; i < 10; i++); writeln(i); I have seen students waste minutes locating that bug. B

Re: This just in: authorless TDPL becomes collector's edition

2010-06-01 Thread Robert Clipsham
On 01/06/10 19:47, Andrei Alexandrescu wrote: I forwarded your note to my editor. Andrei Excellent! :D I look forward to their response :)

Re: One document about Go

2010-06-01 Thread Alex Makhotin
Walter Bright wrote: You inevitably forget to go back and append the ; to the previous line. Current DMD compiler version outputs on attempt to make empty statement: use '{ }' for an empty statement, not a ';' Is there a reason? -- Alex Makhotin, the founder of BITPROX, http://bitprox.co

Re: Binary data-structure serialization

2010-06-01 Thread Masahiro Nakagawa
On Mon, 31 May 2010 22:36:13 +0900, Robert wrote: On 2010-05-31 11:09:54 +0200, "Masahiro Nakagawa" said: I may not be right about your question, but I am writing msgpack4d. http://www.bitbucket.org/repeatedly/msgpack4d This library will be available in Phobos(see d.announce). Now, I f

Re: One document about Go

2010-06-01 Thread Walter Bright
Lurker wrote: == Quote from bearophile (bearophileh...@lycos.com)'s article In Go you can omit semicolons at the end of lines, so I presume it's not a terrible thing for C-like languages: package main import " fmt " // formatted I/O. func main() { fmt.Printf ("Hello Hello\n") } When wil

  1   2   >