Re: Matrix mul

2008-11-23 Thread Bill Baxter
On Sun, Nov 23, 2008 at 6:15 PM, bearophile <[EMAIL PROTECTED]> wrote: > Bill Baxter: >> Exactly. That's why I haven't spent too much time benchmarking it. >> It would be quite surprising if something I wrote in D outperformed >> the ATLAS SSE3 optimized BLA

Re: Unification and extension of compile-time reflection

2008-11-24 Thread Bill Baxter
On Tue, Nov 25, 2008 at 11:48 AM, Ary Borenszweig <[EMAIL PROTECTED]> wrote: > Jarrett Billingsley escribió: >> >> Once upon a time, D did not have string mixins, or CTFE, or templates, >> or any of the fun things we have today. Even so, it was still >> important to be able to access some informat

Re: Unification and extension of compile-time reflection

2008-11-25 Thread Bill Baxter
On Tue, Nov 25, 2008 at 10:42 PM, Steven Schveighoffer <[EMAIL PROTECTED]> wrote: > There is also one other benefit to min and max (and others) being first > class properties. You can mimic their behavior in user-defined types. For > example, if int.min is changed to traits(min, int) or even int.

Re: Simplifying templates

2008-11-29 Thread Bill Baxter
On Sun, Nov 30, 2008 at 6:05 AM, dfgh <[EMAIL PROTECTED]> wrote: > Warning: this would break existing code. > > I have an idea for a completely new template syntax that is easier to use and > implement. I'll explain it in therms of a hypothetical language called > Dscript. Let's start by imaginin

Re: Simplifying templates

2008-11-29 Thread Bill Baxter
On Sun, Nov 30, 2008 at 7:15 AM, dfgh <[EMAIL PROTECTED]> wrote: > BCS Wrote: > >> Please repost as plain text. >> >> > > It is plain text. Do you mean a .txt? Looked fine over here. The only thing odd about the formatting is there are no line breaks. But anyway you posted from the web-news inter

C++ script

2008-11-29 Thread Bill Baxter
""" There are a number of C/C++ interpreters that support a subset of C++, but the new C++Script language by Calum Grant, does something a little different. It enhances C++ with a garbage collector, closures, and dynamic typing, while using existing C++ compilers. """ http://dobbscodetalk.com/index

Re: indexing tuples using strings

2008-12-01 Thread Bill Baxter
On Tue, Dec 2, 2008 at 6:40 AM, Jarrett Billingsley <[EMAIL PROTECTED]> wrote: > On Mon, Dec 1, 2008 at 4:19 PM, llee <[EMAIL PROTECTED]> wrote: >> Is is possible to index the elements within a tuple using strings? >> Something similar to the way that associative arrays allow elements to be >> ind

Re: indexing tuples using strings

2008-12-01 Thread Bill Baxter
On Tue, Dec 2, 2008 at 9:39 AM, bearophile <[EMAIL PROTECTED]> wrote: > Bill Baxter: >> Tuples have an annoying "auto-flattening" behavior which means that >> it's difficult to create very advanced data structures out of them. > > This has to change in

Re: indexing tuples using strings

2008-12-01 Thread Bill Baxter
On Tue, Dec 2, 2008 at 10:14 AM, BCS <[EMAIL PROTECTED]> wrote: > Reply to Bill, > >> Isn't there an easier way to fake it using structs? Like >> template Tuple(T...) { alias T Tuple } >> struct STuple(T...) { alias T tuple; } >> alias Tuple!(STuple(int,float), STuple(string,double), int, creal) >>

Re: indexing tuples using strings

2008-12-02 Thread Bill Baxter
On Tue, Dec 2, 2008 at 10:01 PM, bearophile <[EMAIL PROTECTED]> wrote: > Bill Baxter: >> and I implemented it again this morning. > > I presume my version is "better" :-) > I have written it along one year of time. I'm sure if you have spent that much time o

Re: indexing tuples using strings

2008-12-02 Thread Bill Baxter
On Tue, Dec 2, 2008 at 7:26 PM, bearophile <[EMAIL PROTECTED]> wrote: > Bill Baxter: > >>What about Perl shows that auto-flattening is bad?< > > > You can find a note here: > http://steve.yegge.googlepages.com/ancient-languages-perl >> > Larry decided

Re: Tail call elimination

2008-12-03 Thread Bill Baxter
On Wed, Dec 3, 2008 at 8:21 PM, Nick Sabalausky <[EMAIL PROTECTED]> wrote: > "bearophile" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> - I know it's not necessary, just as closures aren't necessary in an OO >> language, >> because you can create a class every time you may want a

Does foreach on array literal allocate?

2008-12-04 Thread Bill Baxter
Does anyone know off the top of their head if code like this allocates or not with current DMD 1.x compilers? foreach(x; [1, 2, 3, 4]) { // do something non-allocating with x } And is the answer different if the values are only known at runtime? Like here: void a func(int a1, int a2, int a

Re: Why I like D

2008-12-04 Thread Bill Baxter
Sounds pretty close to my thoughts on the subject. A couple of years ago I decided that I was really tired of fighting with with C++ (mostly the memory micro-management, the horrible template mess, and totally unreadable code in standard libs like Boost and STL). So I decided to find something ea

Re: Why I like D

2008-12-04 Thread Bill Baxter
On Fri, Dec 5, 2008 at 6:07 AM, bearophile <[EMAIL PROTECTED]> wrote: > Bill Baxter: > >>It was sitting down and realizing that with OCaml I was basically going to >>have to re-learn how to do everything I already knew how to do, but using >>Monads or whatever.<

Re: Does foreach on array literal allocate?

2008-12-04 Thread Bill Baxter
On Fri, Dec 5, 2008 at 10:31 AM, Sergey Gromov <[EMAIL PROTECTED]> wrote: > Fri, 5 Dec 2008 03:58:39 +0900, Bill Baxter wrote: > >> Does anyone know off the top of their head if code like this allocates >> or not with current DMD 1.x compilers? >> >> foreach

Re: Does foreach on array literal allocate?

2008-12-04 Thread Bill Baxter
On Fri, Dec 5, 2008 at 10:37 AM, Walter Bright <[EMAIL PROTECTED]> wrote: > Bill Baxter wrote: >> >> Does anyone know off the top of their head if code like this allocates >> or not with current DMD 1.x compilers? >> >> foreach(x; [1, 2, 3, 4]) >> {

Checking function callability in D1 (aka static try-catch)

2008-12-07 Thread Bill Baxter
This topic came up (again) fairly recently, and a solution was proposed, but I found a case where that solution doesn't work. The objective is to do a static check to see if something is callable with particular argument types, and if so call it. The proposed solution was to use '.init' like so:

Re: Checking function callability in D1 (aka static try-catch)

2008-12-07 Thread Bill Baxter
On Sun, Dec 7, 2008 at 7:08 PM, Christian Kamm <[EMAIL PROTECTED]> wrote: >> This topic came up (again) fairly recently, and a solution was >> proposed, but I found a case where that solution doesn't work. >> >> The objective is to do a static check to see if something is callable >> with particula

Re: More phpBB like forum?

2008-12-09 Thread Bill Baxter
On Wed, Dec 10, 2008 at 8:13 AM, Jarrett Billingsley <[EMAIL PROTECTED]> wrote: > On Tue, Dec 9, 2008 at 6:00 PM, Daniel White <[EMAIL PROTECTED]> wrote: >> Hi Brad, >> Good point I guess. While it's nice to have centralization for a forum's >> posts, the kind of centralization you're talking about

Re: Java's development cycle

2008-12-09 Thread Bill Baxter
On Wed, Dec 10, 2008 at 12:34 PM, Walter Bright <[EMAIL PROTECTED]> wrote: > Robert Fraser wrote: >> >> There are a lot of great language features, but C# and D are starting to >> look like monsters with their "everything in the kitchen sink" approach >> (c.f. C++). In Java, there's usually one way

Re: Type system question

2008-12-10 Thread Bill Baxter
On Thu, Dec 11, 2008 at 9:44 AM, BCS <[EMAIL PROTECTED]> wrote: > Reply to bearophile, > >> Tim M: >> >>> How would that improve on auto? >>> >> It's like asking how a domestic Flying Disk UFO can improve your >> bicycle travels to the nearby milk shop :-) >> >> The answer is: it can do that and mu

Re: Type system question

2008-12-10 Thread Bill Baxter
> So what D has is basically the ability to do type inferences in one > direction. To be fair, D can do some other kinds of inference too, as in selecting template type parameters using IFTI, and inferring which overload of a function you want based on argument types, and the is() expression can d

Re: More phpBB like forum?

2008-12-10 Thread Bill Baxter
On Thu, Dec 11, 2008 at 12:53 PM, Sean Kelly <[EMAIL PROTECTED]> wrote: > Walter Bright wrote: >> >> Sean Kelly wrote: >>> >>> I think there must be a generation gap here. The first thing I look for >>> is a >>> newsgroup dedicated to a subject. After that, a mailing list. I have >>> basically >

Re: Bit subscriptions, RAM columnwise layouts

2008-12-11 Thread Bill Baxter
On Thu, Dec 11, 2008 at 11:21 PM, bearophile wrote: > Wirbel lets you use an integer a little bit like a list of boolean values > with the fixed length of 32 or 64. You can used the square brackets to > directly address the bits: > > a = 0 > a[0] = true > a[2] = false > print(a) Nice idea, that

Re: Type system question

2008-12-11 Thread Bill Baxter
On Fri, Dec 12, 2008 at 10:58 AM, Michel Fortin wrote: > On 2008-12-10 20:17:54 -0500, "Bill Baxter" said: > >> someFunction(x, y) { >>return x+y; >> } >> >> addone(x) { >>val result; /*inferred-type result (in proposed language)*/ &

Re: Google NativeClient

2008-12-12 Thread Bill Baxter
On Sat, Dec 13, 2008 at 12:06 AM, Sean Kelly wrote: > Julio César Carrascal Urquijo wrote: >> >> "At Google we're always trying to make the web a better platform. That's >> why we're working on Native Client, a technology that aims to give web >> developers access to the full power of the client's

A template for method forwarding?

2008-12-12 Thread Bill Baxter
Let's say you want to use object composition instead of inheritance. Now you want to forward half-a-dozen method from the new to class to the composed class, like so: class NewClass { ImplT implementor; ... // Do some method forwarding void func1(int a, float b) { implementor.f

Can i plz has some template instantiation error stack traces?

2008-12-12 Thread Bill Baxter
kthx bye. --bb

Re: A template for method forwarding?

2008-12-12 Thread Bill Baxter
On Sat, Dec 13, 2008 at 6:00 AM, Simen Kjaeraas wrote: > On Fri, 12 Dec 2008 21:08:51 +0100, Bill Baxter wrote: > >> Let's say you want to use object composition instead of inheritance. >> Now you want to forward half-a-dozen method from the new to class to >>

Re: A template for method forwarding?

2008-12-12 Thread Bill Baxter
ill dig more. --bb On Sat, Dec 13, 2008 at 5:54 AM, dsimcha wrote: > == Quote from Bill Baxter (wbax...@gmail.com)'s article >> Let's say you want to use object composition instead of inheritance. >> Now you want to forward half-a-dozen method from the new t

Re: A template for method forwarding?

2008-12-12 Thread Bill Baxter
On Sat, Dec 13, 2008 at 6:13 AM, Bill Baxter wrote: > Cool. I don't see anything D2 specific there, so I think it should > work in D1 ok. > std.traits.ParameterTypeTuple and std.traits.ReturnType both exist in > D1, if that's what you were worried about. > > I think t

Re: Using DMD's -v to build dependencies

2008-12-12 Thread Bill Baxter
So how fast is dmd -o-? Does this pretty much double the compile time? An option to reuse a previously generated .deps might be nice. --bb On Sat, Dec 13, 2008 at 7:18 AM, Sergey Gromov wrote: > After some twitting ;) here's my Windows shell script (a .cmd file) > which can effectively replace

Re: Can i plz has some template instantiation error stack traces?

2008-12-12 Thread Bill Baxter
t, Dec 13, 2008 at 7:07 AM, Nick Sabalausky wrote: > "Bill Baxter" wrote in message > news:mailman.162.1229113882.22690.digitalmar...@puremagic.com... >> kthx bye. >> --bb > > I think we need a lolcat pic to go along with this. :) > > >

Re: Can i plz has some template instantiation error stack traces?

2008-12-12 Thread Bill Baxter
On Sat, Dec 13, 2008 at 12:44 PM, Robert Fraser wrote: > Bill Baxter wrote: >> >> kthx bye. >> --bb > > LDC can haz. > orly? As in haz them now? or can potentially haz at some point in the future if someone decides to do it? --bb

Re: Can i plz has some template instantiation error stack traces?

2008-12-13 Thread Bill Baxter
On Sat, Dec 13, 2008 at 4:53 PM, Christian Kamm wrote: >>> LDC can haz. >>> >> >> orly? >> >> As in haz them now? or can potentially haz at some point in the future >> if someone decides to do it? > > Can haz now. Currently looking like so > > templerror.d(9): Error: identifier 'wrong' is not defi

Re: Can i plz has some template instantiation error stack traces?

2008-12-13 Thread Bill Baxter
On Sat, Dec 13, 2008 at 5:07 PM, Christian Kamm wrote: > Bill Baxter wrote: >> Looks great. >> Is there a DMD patch for that somewhere in bugzilla? > > I sent it directly to Walter a few months ago, but I'll also attach it to > the enhancement request you just opened.

Re: Basic benchmark

2008-12-13 Thread Bill Baxter
On Sun, Dec 14, 2008 at 3:07 AM, Jarrett Billingsley wrote: > On Sat, Dec 13, 2008 at 12:55 PM, Jason House > wrote: >> Jarrett Billingsley wrote: >> >>> I hope bearophile will eventually understand that DMD is not good at >>> optimizing code, and so comparing its output to GCC's is ultimately >>

Re: Using DMD's -v to build dependencies

2008-12-13 Thread Bill Baxter
an be left as an exercise for the reader. :-) --bb On Sun, Dec 14, 2008 at 3:35 AM, Sergey Gromov wrote: > Sat, 13 Dec 2008 07:37:18 +0900, Bill Baxter wrote: > >> So how fast is dmd -o-? Does this pretty much double the compile time? >> An option to reuse a previously genera

Re: Basic benchmark

2008-12-13 Thread Bill Baxter
On Sun, Dec 14, 2008 at 4:41 AM, Don wrote: > Bill Baxter wrote: >> That said, LDC isn't quite there yet, especially on Windows, but it >> would be very encouraging to see Walter take at least a little >> interest in it. The transition would be a little painful for

Re: LDC Windows exception handling

2008-12-13 Thread Bill Baxter
On Sun, Dec 14, 2008 at 5:13 AM, Christian Kamm wrote: >> Speaking of LDC, any chance that the exception handling on Win32 gets >> fixed in the near future? > > No, unfortunately. > > It's a problem with LLVM only supporting Dwarf2 exception handling. I'm > pretty sure it'd work if we used ELF for

Re: LDC Windows exception handling

2008-12-13 Thread Bill Baxter
On Sun, Dec 14, 2008 at 7:55 AM, aarti_pl wrote: > Bill Baxter pisze: >> >> On Sun, Dec 14, 2008 at 5:13 AM, Christian Kamm >> wrote: >>>> >>>> Speaking of LDC, any chance that the exception handling on Win32 gets >>>> fixed in the near

Re: Basic benchmark

2008-12-13 Thread Bill Baxter
On Sun, Dec 14, 2008 at 9:15 AM, Jason House wrote: > > I couldn't agree more! > > I never understood why people were so anti-gdc. I would not be surprised to > hear that the gdc developer(s) stopped after hearing just how little people > appreciated their hard work. > Well, I think it has mor

Re: Basic benchmark

2008-12-14 Thread Bill Baxter
On Sun, Dec 14, 2008 at 7:23 PM, Lars Ivar Igesund wrote: > dsimcha wrote: > >> == Quote from Jason House (jason.james.ho...@gmail.com)'s article >>> I couldn't agree more! >>> I never understood why people were so anti-gdc. I would not be surprised >>> to >> hear that the gdc developer(s) stoppe

Re: Basic benchmark

2008-12-14 Thread Bill Baxter
On Sun, Dec 14, 2008 at 3:22 PM, Walter Bright wrote: > Jarrett Billingsley wrote: >> >> Walter is the only one who can make DMD faster, and I think his time >> is much better spent on designing and maintaining the language. The >> reference compiler is just supposed to be _correct_, not necessar

Re: Basic benchmark

2008-12-14 Thread Bill Baxter
On Mon, Dec 15, 2008 at 11:37 AM, Walter Bright wrote: > Bill Baxter wrote: >> >> Of course that back end was also designed for C/C++ originally, right? > > Pretty much all of them are. > >> But anyway, I agree with bearophile, that requiring too many special >

Re: Basic benchmark

2008-12-14 Thread Bill Baxter
On Mon, Dec 15, 2008 at 12:37 PM, naryl wrote: >> Anyone have the data for the time required to compile tango with DMD >> vs LDC? It would be interesting to see how bad the difference is. > > Compiling tango-user-{ldc,dmd} > DMD - 20.950s > LDC - 34.891s Thanks for the data. Seems not so bad to

Re: Basic benchmark

2008-12-14 Thread Bill Baxter
On Mon, Dec 15, 2008 at 2:13 PM, Walter Bright wrote: > Jason House wrote: >> >> I have already hit long division related speed issues in my D code. >> Sometimes simple things can dominate a benchmark, but those same >> simple things can dominate user code too! > > I completely agree, and I'm in t

Re: Basic benchmark

2008-12-15 Thread Bill Baxter
On Tue, Dec 16, 2008 at 11:09 AM, Andrei Alexandrescu wrote: > Jarrett Billingsley wrote: >> >> On Sat, Dec 13, 2008 at 11:16 AM, Tomas Lindquist Olsen >> wrote: >>> >>> I tried this out with Tango + DMD 1.033, Tango + LDC r847 and GCC 4.3.2, >>> my >>> timings are as follows, best of three: >>>

Re: Basic benchmark

2008-12-15 Thread Bill Baxter
On Tue, Dec 16, 2008 at 12:00 PM, Denis Koroskin <2kor...@gmail.com> wrote: > On Tue, 16 Dec 2008 05:28:16 +0300, Bill Baxter wrote: > >> On Tue, Dec 16, 2008 at 11:09 AM, Andrei Alexandrescu >> wrote: >>> >>> Jarrett Billingsley wrote: >>>>

Re: Basic benchmark

2008-12-16 Thread Bill Baxter
On Tue, Dec 16, 2008 at 9:43 PM, Don wrote: > Bill Baxter wrote: >> >> Anyway, all that said, it's not clear that we really do have that >> mythical "uber backend" available right now. >> >> According to my conversations on the clang mailing list,

Re: Basic benchmark

2008-12-16 Thread Bill Baxter
On Wed, Dec 17, 2008 at 12:36 PM, Brad Roberts wrote: >> Sounds to me like LDC is already ahead of clang's C++. >> I actually asked the same question over on the list "could it be that >> LDC is already the most advanced compiler availble on the LLVM >> platform?" One guy answered "No, there's ll

Re: Feature request: Deploying a class instance in the default data segment

2008-12-17 Thread Bill Baxter
On Thu, Dec 18, 2008 at 2:05 PM, Weed wrote: > Feature request: Deploying a class instance in the default data segment and > creation of a class instance at compile time. > > In this post I'll try to prove the necessity of this feature. > > I have found that in D it is impossible to create a polym

Re: Feature request: Deploying a class instance in the default data segment

2008-12-17 Thread Bill Baxter
2008/12/18 Weed : > Bill Baxter пишет: >> >> On Thu, Dec 18, 2008 at 2:05 PM, Weed wrote: >>> >>> Feature request: Deploying a class instance in the default data segment >>> and >>> creation of a class instance at compile time. >>> >

Re: Aliasing, alignment

2008-12-18 Thread Bill Baxter
On Fri, Dec 19, 2008 at 11:28 AM, bearophile wrote: > What's the stance of the D language regarding the "aliasing" problem? > The last C99 has added a keyword (restrict) to manage this problem (and in > GCC you can find some nonstandard extensions for C++ too). > > See also: > http://www.cellperf

Re: Compiler optimizations

2008-12-19 Thread Bill Baxter
On Fri, Dec 19, 2008 at 8:16 PM, Sergey Gromov wrote: > Fri, 19 Dec 2008 03:56:37 + (UTC), dsimcha wrote: > >> Does anyone know of a decent guide that has information on what types of >> optimizations compilers typically perform and what they aren't capable of >> performing automatically? I f

Re: memory management of array

2008-12-19 Thread Bill Baxter
On Sat, Dec 20, 2008 at 12:55 AM, ZHOU Zhenyu wrote: > I use D to solve the programming problems on projecteuler ( > http://projecteuler.net/ ) > > > I thought D should be as fast as C++, but it turns out that sometimes D is > much slower. > > It seems that array would reallocate its memory eve

Re: memory management of array

2008-12-20 Thread Bill Baxter
On Sat, Dec 20, 2008 at 8:22 PM, Michel Fortin wrote: > On 2008-12-19 17:01:48 -0500, "Bill Baxter" said: > >> In addition to what other people have said, if you know the length the >> array will be eventually you can preallocate by doing this: >> >> float

Re: Things that may be removed

2008-12-22 Thread Bill Baxter
On Mon, Dec 22, 2008 at 11:43 PM, Jarrett Billingsley wrote: > On Mon, Dec 22, 2008 at 8:59 AM, bearophile wrote: >> Jarrett Billingsley: >>> I suppose you mean for normal arrays. How about reverse as well? >> >> I'd like to see better and faster "reverse" and "sort", but I think they are >> us

Re: Optimizing Immutable and Purity

2008-12-22 Thread Bill Baxter
On Tue, Dec 23, 2008 at 11:30 AM, Jerry Quinn wrote: > Walter Bright Wrote: > >> I've been working on improving the optimizer to take advantage of >> immutability and purity. >> >> http://www.reddit.com/r/reddit.com/comments/7l5x4/optimizing_immutable_and_purity/ >> >> http://dobbscodetalk.com/ind

Re: Optimizing Immutable and Purity

2008-12-22 Thread Bill Baxter
On Tue, Dec 23, 2008 at 12:10 PM, bearophile wrote: > Walter Bright: >> I didn't know gcc had pure functions. It doesn't have immutable data. If >> it does optimize with it, you can try it and see! > > It seems to work: > [...] > As you can see now there's just one call to bar. > > Bye, > bearophi

Re: Things that may be removed

2008-12-23 Thread Bill Baxter
On Tue, Dec 23, 2008 at 6:08 PM, KennyTM~ wrote: > Bill Baxter wrote: >> >> On Mon, Dec 22, 2008 at 11:43 PM, Jarrett Billingsley >> wrote: >>> >>> On Mon, Dec 22, 2008 at 8:59 AM, bearophile >>> wrote: >>>> >>>> Jarrett B

Re: Null References and related matters

2008-12-23 Thread Bill Baxter
On Tue, Dec 23, 2008 at 10:36 PM, bearophile wrote: > system crashes, which have probably caused a billion dollars of pain and > damage in the last forty years. In recent years, a number of program > analysers like PREfix and PREfast in Microsoft have been used to check > references, and give

Re: dmd platform support - poll

2008-12-25 Thread Bill Baxter
On Fri, Dec 26, 2008 at 5:30 AM, Walter Bright wrote: > What platforms for dmd would you be most interested in using? mac osx 32 bit intel If I can only vote for one that would be my pick. --bb

Re: Operator overloading

2008-12-26 Thread Bill Baxter
On Sat, Dec 27, 2008 at 9:42 AM, The Anh Tran wrote: > aarti_pl wrote: >> >> Andrei Alexandrescu pisze: >> > We're trying to make that work. D is due for an operator overhaul. >> > >> > Andrei >> >> Is there any chance that we get possibility to overload "raw operators", >> like in C++? I think

Re: dmd platform support - poll

2008-12-27 Thread Bill Baxter
On Sat, Dec 27, 2008 at 8:37 PM, Walter Bright wrote: > Nick Sabalausky wrote: >> >> 2. I have absolutely zero interest in 64-bit. To the people annoyed at the >> limitations of the 32-bit address space: What in the world are you working >> on? Non-linear video editors and 3D modeling packages? >

Re: Operator overloading

2008-12-27 Thread Bill Baxter
On Sat, Dec 27, 2008 at 11:19 PM, Jarrett Billingsley wrote: > On Sat, Dec 27, 2008 at 2:31 AM, Andrei Alexandrescu > wrote: For iterators, increment is quite different from addition of an arbitrary number, so what D managed to do was effectively to cripple iterators. The stan

Re: Replacing built-in complex? What's this about?

2008-12-27 Thread Bill Baxter
On Sun, Dec 28, 2008 at 8:46 AM, Andrei Alexandrescu wrote: > Stewart Gordon wrote: >> >> So, is complex scheduled for removal from Fortran? > > Fortran has too little support for abstraction to accommodate complex as a > user-defined type gainfully. It also has a great deal of legacy code to > wo

Re: Replacing built-in complex? What's this about?

2008-12-27 Thread Bill Baxter
>>I don't think the compiler is quite there yet, so till it is, there is an >>advantage to having a built-in hash-table that can run at compile time.< > > At the moment, what can the compiler do with the built-in AAs at compile > time? (I think very little). I don't actually know. I was thinkin

Re: dmd platform support - poll

2008-12-27 Thread Bill Baxter
On Sun, Dec 28, 2008 at 12:50 PM, John Reimer wrote: > I may have actually reached a point where my motivation to upgrade was > significantly dampened by the fact that PC's technology had finally > progressed to a more acceptable usability/maintenance levels. Improvements > in technology seem to

Re: Operator overloading -- lets collect some use cases

2008-12-28 Thread Bill Baxter
On Mon, Dec 29, 2008 at 1:50 AM, Don wrote: > There's been some interesting discussion about operator overloading over the > past six months, but to take the next step, I think we need to ground it in > reality. What are the use cases? > > I think that D's existing opCmp() takes care of the pletho

Re: Resource File Accessing

2008-12-28 Thread Bill Baxter
On Mon, Dec 29, 2008 at 1:42 PM, Lionello Lunesu wrote: > --snip-- All you have to do is pass the -J flag to DMD to indicate the path where filename.dat lives. import() returns a string (a char[]) but you can cast it to whatever type you want, like I've casted to byte[] h

Re: Operator overloading -- lets collect some use cases

2008-12-28 Thread Bill Baxter
On Mon, Dec 29, 2008 at 3:00 PM, Don wrote: > bearophile wrote: >> >> Jarrett Billingsley: >>> >>> His library works by having you write your code in a DSL in strings, >>> which you pass to the library and then mix in the resulting X86. >> >> Have someone some benchmarks that show such Blade give

Re: Operator overloading -- lets collect some use cases

2008-12-28 Thread Bill Baxter
On Mon, Dec 29, 2008 at 1:50 AM, Don wrote: > There's been some interesting discussion about operator overloading over the > past six months, but to take the next step, I think we need to ground it in > reality. What are the use cases? > > I think that D's existing opCmp() takes care of the pletho

Re: division of objects into classes and structures is bad

2008-12-30 Thread Bill Baxter
On Wed, Dec 31, 2008 at 4:32 AM, Andrei Alexandrescu wrote: > Don wrote: >> >> Andrei Alexandrescu wrote: >>> >>> Don wrote: Christopher Wright wrote: > > Don wrote: >> >> The creation of temporaries during expressions is something I'm >> currently working on solving.

Re: Operator overloading -- lets collect some use cases

2008-12-30 Thread Bill Baxter
On Tue, Dec 30, 2008 at 11:30 PM, Frits van Bommel wrote: > Bill Baxter wrote: >> >> Merging might be useful there too --- A ~= b ~ c ~ d is probably more >> efficiently implemented as 3 ~= ops. > > Actually, it's probably most efficiently implemented as 1 "

Re: Operator overloading -- lets collect some use cases

2008-12-30 Thread Bill Baxter
2008/12/31 Don : > Weed wrote: >> >> Frits van Bommel пишет: >>> >>> Don wrote: Frits van Bommel wrote: > > Don wrote: >> >> A straightforward first step would be to state in the spec that "the >> compiler is entitled to assume that X+=Y yields the same result as >

Re: Operator overloading -- lets collect some use cases

2008-12-31 Thread Bill Baxter
On Thu, Jan 1, 2009 at 3:16 AM, bearophile wrote: > Andrei Alexandrescu: >> The name and original implementation of writefln are Walter's and >> predate my tenure with D. I just defined write() and writeln(). > > write/writeln are very useful to avoid the silly bugs caused by the possible > of a

Re: D BUGS Part 2

2009-01-01 Thread Bill Baxter
On Fri, Jan 2, 2009 at 5:23 AM, bearophile wrote: > The first part of this post was posted around October 2 2008, and shows a > lits of general bugs I have found in DMD/D. > > This post lists several problems/bugs/limits I have found in the > write/writefln of D1. > > [...] > As you can see this

Randomness in built-in .sort

2009-01-04 Thread Bill Baxter
It seems to me that the built-in .sort uses a randomized algorithm that leads to results that differ from run-to-run when there are elements with identical keys. This seems like a bad idea to me for the built-in algorithm to have non-deterministic behavior because it means you can have bugs that a

Re: Randomness in built-in .sort

2009-01-04 Thread Bill Baxter
On Mon, Jan 5, 2009 at 12:05 PM, dsimcha wrote: > == Quote from Bill Baxter (wbax...@gmail.com)'s article >> It seems to me that the built-in .sort uses a randomized algorithm >> that leads to results that differ from run-to-run when there are >> elements with identical

Re: Operator overloading -- lets collect some use cases

2009-01-05 Thread Bill Baxter
On Tue, Jan 6, 2009 at 1:10 AM, Weed wrote: > In that example with matrices > (http://www.dsource.org/projects/openmeshd/browser/trunk/LinAlg/linalg/MatrixT.d, > template MultReturnType (ArgT)) the returned type of matrices needed to > be altered in void (in the pointer on void). And add check by

Re: Randomness in built-in .sort

2009-01-05 Thread Bill Baxter
On Tue, Jan 6, 2009 at 12:16 AM, dsimcha wrote: > == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article >> dsimcha wrote: >> > On another note, it would be nice if std.algorithm implemented a stable >> > O(N log N) >> > sort, like a merge sort. Right now, IIRC it uses an in

Re: Randomness in built-in .sort

2009-01-05 Thread Bill Baxter
On Mon, Jan 5, 2009 at 8:40 PM, Stewart Gordon wrote: > Bill Baxter wrote: > >> >> I think the built-in sort should be some kind of stable sort. Also >> the stability or lack thereof is not mentioned in the spec, and it >> probably should be because stabilit

Re: Randomness in built-in .sort

2009-01-05 Thread Bill Baxter
On Tue, Jan 6, 2009 at 6:15 AM, dsimcha wrote: > == Quote from Bill Baxter (wbax...@gmail.com)'s article >> Actually, a function to sort multiple arrays in parallel was exactly >> what I was implementing using .sort. So that doesn't sound like a >> limitation to me

Re: Randomness in built-in .sort

2009-01-05 Thread Bill Baxter
On Tue, Jan 6, 2009 at 10:18 AM, bearophile wrote: > Bill Baxter: > >>I use this all the time in NumPy in the form of "argsort" which returns a >>list of indices giving the sort order. That can then be used as to index >>other arrays (thereby permuting

Re: division of objects into classes and structures is bad

2009-01-05 Thread Bill Baxter
On Tue, Jan 6, 2009 at 1:41 PM, Christopher Wright wrote: > Weed wrote: >> >> Who agrees with me? There are still ideas as it is possible to solve >> this problem and not to destroy language? > > When you reply to your reply to your reply to your post and nobody else > replies to any of your posts

Re: Randomness in built-in .sort

2009-01-06 Thread Bill Baxter
On Wed, Jan 7, 2009 at 4:09 AM, Walter Bright wrote: > Ary Borenszweig wrote: >> >> I think Bill speaks about a stable sort. You can have an unstable sort >> algorithm without having explicity a random invocation. Note that he's >> saying "leads to results that differ from run-to-run when there ar

Re: foreach ... else statement

2009-01-07 Thread Bill Baxter
On Thu, Jan 8, 2009 at 5:54 AM, Walter Bright wrote: > Sean Kelly wrote: >>> >>> I keep thinking I should put on a "Compiler Construction" seminar! >> >> You should. The academic courses do a good job with theory and >> general application, but that isn't quite the same as one based on >> practic

Re: foreach ... else statement

2009-01-07 Thread Bill Baxter
On Thu, Jan 8, 2009 at 6:46 AM, Andrei Alexandrescu wrote: > Bill Baxter wrote: >> >> On Thu, Jan 8, 2009 at 5:54 AM, Walter Bright >> wrote: >>> >>> Sean Kelly wrote: >>>>> >>>>> I keep thinking I should put on a "Compil

Re: foreach ... else statement

2009-01-07 Thread Bill Baxter
On Thu, Jan 8, 2009 at 10:28 AM, Andrei Alexandrescu wrote: > Walter Bright wrote: >> >> Bill Baxter wrote: >>> >>> On Thu, Jan 8, 2009 at 6:46 AM, Andrei Alexandrescu >>> wrote: >>>> >>>> Bill Baxter wrote: >

Re: Suggestion: module opcall

2009-01-08 Thread Bill Baxter
On Fri, Jan 9, 2009 at 2:33 AM, bearophile wrote: > bobef Wrote: >> The need for this is because often a module happens to be named as the >> functionality it contains and you have to write the stuff two times.< > > A design bug in the D1 module system is that when you import foo normally you >

Re: Properties

2009-01-08 Thread Bill Baxter
On Fri, Jan 9, 2009 at 9:59 AM, Miles <...@___.> wrote: > Nick Sabalausky wrote: >> A property setter is ALWAYS going to return nothing and > > Both the getter and the setter should return an rvalue. Properties exist > so that they are interchangeable with real member variables. Partly

Re: Suggestion: module opcall

2009-01-08 Thread Bill Baxter
On Fri, Jan 9, 2009 at 10:23 AM, bearophile wrote: > Bill Baxter: > >>I think this problem you refer to only applies to modules without package >>names. I.e. "module Foo" containing "class Foo". Things seem to work ok if >>you have "module x.

Re: Properties

2009-01-08 Thread Bill Baxter
On Fri, Jan 9, 2009 at 10:58 AM, Nick Sabalausky wrote: > "Bill Baxter" wrote in message > news:mailman.343.1231465331.22690.digitalmar...@puremagic.com... >> On Fri, Jan 9, 2009 at 9:59 AM, Miles <...@___.> wrote: >>> Nick Sabalausky wrote: >

Re: Properties

2009-01-08 Thread Bill Baxter
On Fri, Jan 9, 2009 at 11:01 AM, Miles <...@___.> wrote: > Bill Baxter wrote: >> On Fri, Jan 9, 2009 at 9:59 AM, Miles <...@___.> wrote: >>> Both the getter and the setter should return an rvalue. Properties exist >>> so that th

Why isn't ++x an lvalue in D?

2009-01-08 Thread Bill Baxter
Another thread just reminded me of something I use frequently in C++ that doesn't work in D because ++x is not an lvalue: int x,N; ... ++x %= N; So is there some deep reason for not making it an lvalue like in C++? --bb

Re: Why isn't ++x an lvalue in D?

2009-01-08 Thread Bill Baxter
2009/1/9 Weed : > Bill Baxter пишет: >> Another thread just reminded me of something I use frequently in C++ >> that doesn't work in D because ++x is not an lvalue: >> >>int x,N; >> ... >>++x %= N; >> >> So is there some deep reaso

Re: Why isn't ++x an lvalue in D?

2009-01-08 Thread Bill Baxter
On Fri, Jan 9, 2009 at 2:22 PM, Weed wrote: > Bill Baxter пишет: >> 2009/1/9 Weed : >>> Bill Baxter пишет: >>>> Another thread just reminded me of something I use frequently in C++ >>>> that doesn't work in D because ++x is not an lvalue: &g

Re: Why isn't ++x an lvalue in D?

2009-01-08 Thread Bill Baxter
On Fri, Jan 9, 2009 at 2:43 PM, Weed wrote: > Weed пишет: >> Bill Baxter пишет: >>> 2009/1/9 Weed : >>>> Bill Baxter пишет: >>>>> Another thread just reminded me of something I use frequently in C++ >>>>> that doesn'

<    3   4   5   6   7   8   9   >