Re: Binary data-structure serialization

2010-05-31 Thread Masahiro Nakagawa
Hi Robert, On Sun, 30 May 2010 19:38:10 +0900, Robert wrote: Hi, are there are any projectes / snippets / prototypes where someone tried to serializa D run-time data-structures (like an associative array) into a file? I may not be right about your question, but I am writing msgpack4d

Re: eliminating std.range.SListRange?

2010-05-31 Thread bearophile
Jonathan M Davis: >Uncommon? Sure, if you don't need the ability to arbitrarily add and remove >elements from a container, then a vector type is definitely better than a >linked list. However, there are _plenty_ of cases out there where the ability >to arbitrarily add and remove elements from a

Re: Huffman coding comparison

2010-05-31 Thread bearophile
Andrei: >Thanks for your notes.< My pleasure, if you like them I will try to do this thing some more times. There are probably tens or hundreds of small details that can be improved in Phobos. Some of such changes can improve the usage patterns. In past I have put some of them in Bugzilla. One

Re: Binary data-structure serialization

2010-05-31 Thread Robert
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 fix bugs and improve some features. Hi, does it support

Re: Binary data-structure serialization

2010-05-31 Thread Trass3r
If I could specify which memory allocator to use when creating a class, The class could be created in a MMF (which is mapped to main memory and hence there should be no difference in speed) and all references would go to the MMF as well. Isn't http://digitalmars.com/d/2.0/class.html#Class

If you have to learn just one programming language

2010-05-31 Thread retard
I'm not sure if bearophile or some other language advocate posted this already, but: http://www.reddit.com/r/programming/comments/c3p8e/ if_you_have_to_learn_just_one_programming_language/ "Here are my criteria for selecting (a non domain specific) language to learn." "It should provide high l

Re: If you have to learn just one programming language

2010-05-31 Thread Alessandro Ogheri
I suppose you are simply trolling... anyway, I think that D is an absolutely amazing language, but please, if you are able to write a language that is faster than D , more elegant, ALONE!! and you are willing to donate it to us like Mr. Bright has done... please show us why you think to be so muc

Re: If you have to learn just one programming language

2010-05-31 Thread Pelle
On 05/31/2010 05:43 PM, retard wrote: D is very close to C. The productivity is much lower than with other modern scripting or hybrid-functional languages. I disagree, unless you need a specific library which D does not yet have. DMD is much slower than Sun Javac/Jvm 7, GNU GCC 4.5, and LLVM.

Re: If you have to learn just one programming language

2010-05-31 Thread Yao G.
Thanks for another trolling post of yours. :rolleyes: Weren't you supposed to stop posting? On Mon, 31 May 2010 10:43:36 -0500, retard wrote: I'm not sure if bearophile or some other language advocate posted this already, but: http://www.reddit.com/r/programming/comments/c3p8e/ if_you_have_

Re: Huffman coding comparison

2010-05-31 Thread bearophile
> I'd like it to also return the popped item, a ElementType!Range, is this > possible? > Popping one item out is one of the most common operations I have to perform > on an heap. I have read some pages, trying to understand why your pop doesn't return the item. In a page I have read: >Pop retu

Re: If you have to learn just one programming language

2010-05-31 Thread Lars T. Kyllingstad
On Mon, 31 May 2010 15:43:36 +, retard wrote: > I'm not sure if bearophile or some other language advocate posted this > already, but: > > http://www.reddit.com/r/programming/comments/c3p8e/ > if_you_have_to_learn_just_one_programming_language/ > > "Here are my criteria for selecting (a non d

Re: If you have to learn just one programming language

2010-05-31 Thread BCS
Hello retard, I'm not sure if bearophile or some other language advocate posted this already, but: http://www.reddit.com/r/programming/comments/c3p8e/ if_you_have_to_learn_just_one_programming_language/ "Here are my criteria for selecting (a non domain specific) language to learn." "It should

Re: If you have to learn just one programming language

2010-05-31 Thread BCS
Hello Lars, As far as helping D goes, you might as well have said "I don't like cheese". And that phrase has even less content than most people first think because it fails to distinguish between disliking cheese and just not caring. I apologize for dragging out my soapbox but you just used

Re: If you have to learn just one programming language

2010-05-31 Thread Andrej Mitrovic
retard Wrote: > snip Even though he said all of that, he wouldn't be here and post so often if he didn't think D was a good language.

Re: If you have to learn just one programming language

2010-05-31 Thread retard
Mon, 31 May 2010 16:14:31 +, Alessandro Ogheri wrote: > I suppose you are simply trolling... > > anyway, I think that D is an absolutely amazing language, I was simply comparing the current status of D with the other languages mentioned in the original blog post and also propagated the link

Re: If you have to learn just one programming language

2010-05-31 Thread retard
Mon, 31 May 2010 13:57:34 -0400, Andrej Mitrovic wrote: > retard Wrote: > >> snip > > Even though he said all of that, he wouldn't be here and post so often > if he didn't think D was a good language. There's no such thing as bad publicity. And my "opinions" weren't completely wrong. You can e

Re: If you have to learn just one programming language

2010-05-31 Thread retard
Mon, 31 May 2010 18:23:18 +0200, Pelle wrote: > On 05/31/2010 05:43 PM, retard wrote: >> DMD is much slower than Sun Javac/Jvm 7, GNU GCC 4.5, and LLVM. > > For very special values of much, I suppose. Polymorphic method calls, auto-vectorization, link-time optimization, floating point performan

Re: If you have to learn just one programming language

2010-05-31 Thread Bane
This reminds me of elementary school and those discussions "which car/plane/tank is best". Pretty futile subject to begin with, as you cant compare fruits and vegetables. And no matter what somebody say there will always be some kid claiming opposite just for the sake of disagreeing. I guess t

Re: If you have to learn just one programming language

2010-05-31 Thread retard
Mon, 31 May 2010 14:19:22 -0400, Bane wrote: > This reminds me of elementary school and those discussions "which > car/plane/tank is best". Pretty futile subject to begin with, as you > cant compare fruits and vegetables. And no matter what somebody say > there will always be some kid claiming opp

Re: If you have to learn just one programming language

2010-05-31 Thread Pelle
On 05/31/2010 08:17 PM, retard wrote: But way better than in java, C, C++ or almost any other language. So basically if I'm offering you $10 and $10, you're taking $10 because it's more than $1 or $2 or any value between $3 and $4. Great logic. D has a delegate syntax which fits with the

Re: If you have to learn just one programming language

2010-05-31 Thread Adam Ruppe
On 5/31/10, retard wrote: > For example the lambda syntax is terribly verbose in D compared to Scala > or Haskell. Eh, one man's "terse" is another man's "unreadable".

Re: need clarification: will typedef, C struct initialization, etc. go or not?

2010-05-31 Thread Trass3r
I just want to know if (and when) these features will be removed or not. Especially typedef, which I found quite useful lately. C-style struct initialization and complex types have also been discussed but are still in. Nobody got an answer?

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread bearophile
Trass3r: > Nobody got an answer? My opinion: - complex types will be removed. And as far as I know complex number literals too will be removed from D (this is less nice). - I am not sure regarding C-style struct initializations. They are useful to save some typing if you have to for example to p

Re: The last changes to range

2010-05-31 Thread Philippe Sigaud
On Sun, May 30, 2010 at 15:48, Andrei Alexandrescu < seewebsiteforem...@erdani.org> wrote: > >> Will the definition of a forward range change to incorporate save, or do >> you intend to distinguish ranges that can do >> >> R r2 = r1; >> and those that have: >> auto r2 = r1.save; >> ? >> Un

Re: If you have to learn just one programming language

2010-05-31 Thread Bane
> IMHO the original blog post was more trolling than my false opinions. I > liked your critical way of thinking so much that I publicly admit that my > post was a bit provocative. Thank you for a compliment. > When you see this kind of articles, you should really ponder whether it > makes sens

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

2010-05-31 Thread Philippe Sigaud
Simen & Marianne too: > > There are other concerns than simply what works. First of all is > readability - having containers called queue and stack makes code easier > to understand, even if this is done with a simple alias. > There might also be a concern about efficiency, as there is a differenc

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

2010-05-31 Thread Philippe Sigaud
On Mon, May 31, 2010 at 00:47, Ellery Newcomer wrote: > On 05/30/2010 04:53 PM, Philippe Sigaud wrote: > >> There are some simple containers I'd like to see in std.containers: >> >> - a priority queue >> > > (incf vote) > > It seems like I'm always writing priority queue implementations whose > el

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

2010-05-31 Thread Philippe Sigaud
On Mon, May 31, 2010 at 01:56, Andrei Alexandrescu < seewebsiteforem...@erdani.org> wrote: > On 05/30/2010 04:53 PM, Philippe Sigaud wrote: > >> There are some simple containers I'd like to see in std.containers: >> >> - a priority queue >> - a heap >> > > What's the difference between the two? >

Re: If you have to learn just one programming language

2010-05-31 Thread BCS
Hello retard, Mon, 31 May 2010 16:14:31 +, Alessandro Ogheri wrote: I suppose you are simply trolling... anyway, I think that D is an absolutely amazing language, I was simply comparing the current status of D with the other languages mentioned in the original blog post and also propaga

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

2010-05-31 Thread bearophile
Philippe Sigaud: > > Yeah, particularly if having both stack and queue just costs one alias. I > mean, it's a standard library. I know I can use built-in arrays (for > example) as stacks and queues, but sometimes I just want to have a stack. And in some situations it's better to have stacks and qu

Re: If you have to learn just one programming language

2010-05-31 Thread BCS
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 Haskell. But way better than in java, C, C++ or almost any other language. So basically if I'm offering you $1

Re: If you have to learn just one programming language

2010-05-31 Thread BCS
Hello retard, Mon, 31 May 2010 13:57:34 -0400, Andrej Mitrovic wrote: retard Wrote: snip Even though he said all of that, he wouldn't be here and post so often if he didn't think D was a good language. There's no such thing as bad publicity. And my "opinions" weren't completely wrong. Y

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

2010-05-31 Thread Mihail Strashun
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. On 05/31/2010 12:53 AM, Philippe Sigaud wrote: There are some simp

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Andrei Alexandrescu
On 05/31/2010 02:14 PM, bearophile wrote: Trass3r: Nobody got an answer? My opinion: - complex types will be removed. And as far as I know complex number literals too will be removed from D (this is less nice). - I am not sure regarding C-style struct initializations. They are useful to save

Re: The last changes to range

2010-05-31 Thread Andrei Alexandrescu
On 05/31/2010 02:20 PM, Philippe Sigaud wrote: On Sun, May 30, 2010 at 15:48, Andrei Alexandrescu mailto:seewebsiteforem...@erdani.org>> wrote: OK. So it's really sameFront and not equalFront or somesuch. Yah. A previous attempt at naming was sameHead but I don't want to add to

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

2010-05-31 Thread Andrei Alexandrescu
On 05/31/2010 02:36 PM, Philippe Sigaud wrote: Simen & Marianne too: There are other concerns than simply what works. First of all is readability - having containers called queue and stack makes code easier to understand, even if this is done with a simple alias. There might al

Re: If you have to learn just one programming language

2010-05-31 Thread Walter Bright
retard wrote: "Succinct: The language should not be verbose. This is very important. Brevity is one reason why Python and Ruby are popular." For example the lambda syntax is terribly verbose in D compared to Scala or Haskell. Have you checked out APL? Here's the game of life in APL: http://

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread bearophile
Andrei Alexandrescu: > typedef is gone. *mewls* I have shown here some examples of typedef usage, and I'll keep posting few more in future. I'd like to pull it back from the grave and keep it :-) Bye, bearophile

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Adam Ruppe
Doesn't struct T { R _payload; } accomplish the same thing as typedef R T; in the majority of useful cases? I use typedef void* Some_C_Type; a lot, and rather like it for a handful of other things, but I'm pretty sure the struct accomplishes the same thing in those cases. As a template in the

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Andrei Alexandrescu
On 05/31/2010 03:54 PM, bearophile wrote: Andrei Alexandrescu: typedef is gone. *mewls* I have shown here some examples of typedef usage, and I'll keep posting few more in future. I'd like to pull it back from the grave and keep it :-) It's wasted time. typedef is gone. Andrei

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Andrei Alexandrescu
On 05/31/2010 04:11 PM, Adam Ruppe wrote: Doesn't struct T { R _payload; } accomplish the same thing as typedef R T; in the majority of useful cases? Exactly. And with alias this and other mechanisms, you can define several well-defined typedef incarnations that achieve what you want to e

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Lionello Lunesu
On 1-6-2010 5:38, Andrei Alexandrescu wrote: > On 05/31/2010 03:54 PM, bearophile wrote: >> Andrei Alexandrescu: >>> typedef is gone. >> >> *mewls* I have shown here some examples of typedef usage, and I'll >> keep posting few more in future. I'd like to pull it back from the >> grave and keep it :

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Ellery Newcomer
On 05/31/2010 03:54 PM, bearophile wrote: Andrei Alexandrescu: typedef is gone. *mewls* I have shown here some examples of typedef usage, and I'll keep posting few more in future. I'd like to pull it back from the grave and keep it :-) Bye, bearophile user specified T.init?

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Lionello Lunesu
On 1-6-2010 6:25, Ellery Newcomer wrote: > user specified T.init? I love(d) that feature!

Link time optimization in D

2010-05-31 Thread Walter Bright
retard wrote: Mon, 31 May 2010 18:23:18 +0200, Pelle wrote: On 05/31/2010 05:43 PM, retard wrote: DMD is much slower than Sun Javac/Jvm 7, GNU GCC 4.5, and LLVM. For very special values of much, I suppose. Polymorphic method calls, auto-vectorization, link-time optimization, floating point

Re: Link time optimization in D

2010-05-31 Thread dsimcha
== Quote from Walter Bright (newshou...@digitalmars.com)'s article > retard wrote: > > Mon, 31 May 2010 18:23:18 +0200, Pelle wrote: > > > >> On 05/31/2010 05:43 PM, retard wrote: > >>> DMD is much slower than Sun Javac/Jvm 7, GNU GCC 4.5, and LLVM. > >> For very special values of much, I suppose.

Re: Link time optimization in D

2010-05-31 Thread retard
Mon, 31 May 2010 15:41:00 -0700, Walter Bright wrote: > retard wrote: >> Mon, 31 May 2010 18:23:18 +0200, Pelle wrote: >> >>> On 05/31/2010 05:43 PM, retard wrote: DMD is much slower than Sun Javac/Jvm 7, GNU GCC 4.5, and LLVM. >>> For very special values of much, I suppose. >> >> Polymorph

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Justin Spahr-Summers
On Tue, 01 Jun 2010 06:05:50 +0800, Lionello Lunesu wrote: > > On 1-6-2010 5:38, Andrei Alexandrescu wrote: > > On 05/31/2010 03:54 PM, bearophile wrote: > >> Andrei Alexandrescu: > >>> typedef is gone. > >> > >> *mewls* I have shown here some examples of typedef usage, and I'll > >> keep postin

Re: Binary data-structure serialization

2010-05-31 Thread Eric Poggel
On 5/30/2010 6:38 AM, Robert wrote: Hi, are there are any projectes / snippets / prototypes where someone tried to serializa D run-time data-structures (like an associative array) into a file? -- Robert M. Münch http://www.robertmuench.de After having difficulty getting ddbg to work, I decide

Unofficial wish list status.(Jun 2010)

2010-05-31 Thread 4tuu4k002
Hi This is the monthly status for the unofficial d wish list: http://all-technology.com/eigenpolls/dwishlist/ I am closing this wish list. New requests should be posted to bugzilla on http://d.puremagic.com/issues/ It would be a great help, if you could help move some of the wish list items

Re: If you have to learn just one programming language

2010-05-31 Thread Jonathan M Davis
Adam Ruppe wrote: > On 5/31/10, retard wrote: >> For example the lambda syntax is terribly verbose in D compared to Scala >> or Haskell. > > Eh, one man's "terse" is another man's "unreadable". True, though I think that Haskell's lambda syntax is quite nice (I haven't used Scala, so I can't co

Re: Unofficial wish list status.(Jun 2010)

2010-05-31 Thread Simen kjaeraas
Why is this still being posted here? Many of the items are already in D, others will never be, and nobody seems to care about the list anymore at all. Currently, this is just spam. -- Simen

Re: Combining infinite ranges

2010-05-31 Thread Simen kjaeraas
Andrei Alexandrescu wrote: Yah, there's no argument that infinite ranges must be allowed by a n-way cross-product. It reminds one of Cantor's diagonalization, just in several dimensions. Shouldn't be very difficult, but it only works if all ranges except one are forward ranges (one can be

Re: Link time optimization in D

2010-05-31 Thread Walter Bright
retard wrote: I thought the DMD's approach required sources for each module and GCC supported LTO even when only object / library files were provided. DMD does require the sources, or at least the sources you'd like to have inlined. GCC requires all the sources used to be compiled with a speci

Re: If you have to learn just one programming language

2010-05-31 Thread Walter Bright
retard wrote: Mon, 31 May 2010 18:23:18 +0200, Pelle wrote: On 05/31/2010 05:43 PM, retard wrote: DMD is much slower than Sun Javac/Jvm 7, GNU GCC 4.5, and LLVM. For very special values of much, I suppose. Polymorphic method calls, What do you mean by that as an optimization?

Stricter protection attributes for students

2010-05-31 Thread bearophile
D2 is quite complex, so it's not the best language to teach programming, but I think it can be used for this purpose too, for example by university students that already know basic programming in "simpler" languages (like Python). Such students that need to learn OOP probably need to learn to us

Re: Combining infinite ranges

2010-05-31 Thread Andrei Alexandrescu
On 05/31/2010 08:07 PM, Simen kjaeraas wrote: Andrei Alexandrescu wrote: Yah, there's no argument that infinite ranges must be allowed by a n-way cross-product. It reminds one of Cantor's diagonalization, just in several dimensions. Shouldn't be very difficult, but it only works if all ranges

Re: Combining infinite ranges

2010-05-31 Thread Andrei Alexandrescu
On 05/31/2010 08:54 PM, Andrei Alexandrescu wrote: On 05/31/2010 08:07 PM, Simen kjaeraas wrote: Andrei Alexandrescu wrote: Yah, there's no argument that infinite ranges must be allowed by a n-way cross-product. It reminds one of Cantor's diagonalization, just in several dimensions. Shouldn't

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Trass3r
So what would be the way to translate those Windows headers? Create a unique struct for each old typedef? With alias this, and a ctor? Well, if that's the way to do it now, why not make typedef a shortcut for exactly that!? Yeah there must be some short and clean way to define it. IIRC typede

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Simen kjaeraas
Lionello Lunesu wrote: I also miss typedef. I thought D had a great opportunity to fix it. Take something like the Windows headers. It mostly consists of typedefs for handles and whatnot. Without typedef you'd have to use alias and type safety is out of the windows. So what would be the way t

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Leandro Lucarella
Justin Spahr-Summers, el 31 de mayo a las 16:41 me escribiste: > On Tue, 01 Jun 2010 06:05:50 +0800, Lionello Lunesu > wrote: > > > > On 1-6-2010 5:38, Andrei Alexandrescu wrote: > > > On 05/31/2010 03:54 PM, bearophile wrote: > > >> Andrei Alexandrescu: > > >>> typedef is gone. > > >> > > >> *m

Re: Link time optimization in D

2010-05-31 Thread Leandro Lucarella
Walter Bright, el 31 de mayo a las 15:41 me escribiste: > retard wrote: > >Mon, 31 May 2010 18:23:18 +0200, Pelle wrote: > > > >>On 05/31/2010 05:43 PM, retard wrote: > >>>DMD is much slower than Sun Javac/Jvm 7, GNU GCC 4.5, and LLVM. > >>For very special values of much, I suppose. > > > >Polymorp

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Andrei Alexandrescu
On 05/31/2010 10:07 PM, Simen kjaeraas wrote: Lionello Lunesu wrote: I also miss typedef. I thought D had a great opportunity to fix it. Take something like the Windows headers. It mostly consists of typedefs for handles and whatnot. Without typedef you'd have to use alias and type safety is

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Trass3r
struct Typedef( T ) { T payload; alias payload this; } alias Typedef!int myInt; There you go. The question is if this still works flawlessly for complicated examples.

Re: Combining infinite ranges

2010-05-31 Thread Simen kjaeraas
Andrei Alexandrescu wrote: I thought about this some more, and it's more difficult and more interesting than I thought. Cantor enumerated rational numbers the following way: first come all fractions that have numerator + denominator = 1. That's only one rational number, 1/1. Then come al

Re: The last changes to range

2010-05-31 Thread Simen kjaeraas
Philippe Sigaud wrote: OK. I really like this possibility to test for members and activate them when possible. Maybe it could be abstracted away into a Select-like template? More detail please. It's just that my code is full of these static ifs. They are clear but I'd like two things

Re: need clarification: will typedef, C struct initialization, etc.

2010-05-31 Thread Justin Spahr-Summers
On Mon, 31 May 2010 23:31:18 -0300, Leandro Lucarella wrote: > > Justin Spahr-Summers, el 31 de mayo a las 16:41 me escribiste: > > On Tue, 01 Jun 2010 06:05:50 +0800, Lionello Lunesu > > wrote: > > > > > > On 1-6-2010 5:38, Andrei Alexandrescu wrote: > > > > On 05/31/2010 03:54 PM, bearophil

Re: If you have to learn just one programming language

2010-05-31 Thread 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 Haskell. But way better than in java, C, C++ or almost any other language. So basically if I'm offerin

Re: If you have to learn just one programming language

2010-05-31 Thread BCS
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 Haskell. But way better than in java, C, C++ or almost any other language. So basically

Re: Link time optimization in D

2010-05-31 Thread Walter Bright
Leandro Lucarella wrote: Walter Bright, el 31 de mayo a las 15:41 me escribiste: To say D code is slower because it lacks link-time optimization is a false supposition. Yeah, but you can't get link-time optimization if you compile each file separately (to enable partial compilation when you ch

Re: Stricter protection attributes for students

2010-05-31 Thread Jesse Phillips
On Mon, 31 May 2010 21:47:18 -0400, bearophile wrote: > D2 is quite complex, so it's not the best language to teach programming, > but I think it can be used for this purpose too, for example by > university students that already know basic programming in "simpler" > languages (like Python). > >