On Sun, 03 May 2009 09:18:41 +0200, digited wrote:
Walter Bright пишет:
This is a talk I gave last January for the NWCPP:
http://www.vimeo.com/4333802
http://www.reddit.com/r/programming/comments/8fymt/walter_bright_explains_metaprogramming_in_the_d/
Nice video!
What happened to
Walter Bright пишет:
This is a talk I gave last January for the NWCPP:
http://www.vimeo.com/4333802
http://www.reddit.com/r/programming/comments/8fymt/walter_bright_explains_metaprogramming_in_the_d/
Nice video!
What happened to the last part, about enums & strings? Can I read
somewhere ab
Walter Bright schrieb:
> Steve Teale wrote:
>> If I want a catch-all catch, which should I be using.
>>
>> Out of habit I use Exception, but if I do that then I will miss some
>> things thrown from Phobos.
>>
>> Is it the intention that Throwable be used for this purpose?
>>
>
> Yes.
Why is it po
Robert Jacques wrote:
> RAII is all about stack allocation over heap allocation (or so I
> thought). Ah, wikipedia has set me straight. Anyways, now for the simple
> answer: you can't create D1 arrays with RAII types, I think. (Anyone
> tried scope Foo[] foo?) Anyways, in D2, if I remember correctl
On Sat, 02 May 2009 22:14:59 -0400, Rainer Deyke
wrote:
Robert Jacques wrote:
On Sat, 02 May 2009 19:11:11 -0400, Rainer Deyke
wrote:
Given a value type 'T', you have the guarantee that no two variables of
type 'T' can alias each other. This guarantee is preserved when the
type 'T' is non
Robert Jacques wrote:
> On Sat, 02 May 2009 19:11:11 -0400, Rainer Deyke
> wrote:
>> Given a value type 'T', you have the guarantee that no two variables of
>> type 'T' can alias each other. This guarantee is preserved when the
>> type 'T' is non-copyable.
>>
>> An argument of type 'ref T' can ob
Hello Unknown,
So, really, all you want is a Visual Studio Language Service.
Jump to definition and syntax highlighting are relatively easy.
Refactoring is a bit more complex, and autocomplete is probably the
most complicated (to get right.)
Yah, I just want the hard stuff. (go figure :-)
On Sat, 02 May 2009 19:11:11 -0400, Rainer Deyke
wrote:
Robert Jacques wrote:
Again, D array's are structs with reference semantics. This isn't a
pro/con either way.
The D1 dynamic array type does not have reference semantics, nor does it
have value semantics.
void f(int[] a) {
a.length
Robert Jacques wrote:
Although, I'm starting to see an interesting story: Here are containers.
They have value semantics and are simple to use/prototype with. When
you're done, you can move to ranges in the performance critical sections
in order to boost performance. And some things, like high
Robert Jacques wrote:
> Again, D array's are structs with reference semantics. This isn't a
> pro/con either way.
The D1 dynamic array type does not have reference semantics, nor does it
have value semantics.
void f(int[] a) {
a.length = 1;
}
auto a = [];
f(a);
assert(a.length == 0);
>> - N
On Sat, 02 May 2009 17:45:16 -0400, Andrei Alexandrescu
wrote:
Robert Jacques wrote:
On Sat, 02 May 2009 10:18:41 -0400, Andrei Alexandrescu
wrote:
Bill Baxter wrote:
On Fri, May 1, 2009 at 6:25 PM, Andrei Alexandrescu
Matrix a, b, c; ... c = a; a += b;
Does the last operation mutate
On Sat, 02 May 2009 17:59:53 -0400, Andrei Alexandrescu
wrote:
Robert Jacques wrote:
Also, in a value semantics world, refs are third class citizens, but in
a reference semantic world, value semantics get their own assignment
operator ( []= ), and by convention, their own property ( .dup )
bearophile wrote:
Georg Wrede:
The more I think about it, the more I'm starting to believe that the
average desktop or laptop won't see two dozen cores in the immediate
future.
Too much late. My personal computer has already about 100 small cores in the
GPU, and using CUDA (and soon OpenCL)
Robert Jacques wrote:
Also, in a value semantics world, refs are third class citizens, but in
a reference semantic world, value semantics get their own assignment
operator ( []= ), and by convention, their own property ( .dup )
The major problem is not assignment. That can be taken care of. Th
Daniel Keep wrote:
What I want to know is why people quote multi-page messages only to add
a single line to the bottom that's only tangentially related to the
message they're responding to.
-- Daniel
Or those people who post a single line at the beginning, then a wall of quoted
text, leavi
Robert Jacques wrote:
On Sat, 02 May 2009 10:18:41 -0400, Andrei Alexandrescu
wrote:
Bill Baxter wrote:
On Fri, May 1, 2009 at 6:25 PM, Andrei Alexandrescu
Matrix a, b, c; ... c = a; a += b;
Does the last operation mutate c as well?
I said "assignments like a = b are rare" and you put one
On 5/3/2009 6:36 AM, Denis Koroskin wrote:
On Sun, 03 May 2009 01:02:41 +0400, Tyro[a.c.edwards]
wrote:
On 5/3/2009 3:44 AM, flourish wrote:
Hi,
why does the following code not compile -- or how to declare a (usable)
property of an associative array field?
//
class Test
On Sun, 03 May 2009 01:02:41 +0400, Tyro[a.c.edwards] wrote:
On 5/3/2009 3:44 AM, flourish wrote:
Hi,
why does the following code not compile -- or how to declare a (usable)
property of an associative array field?
//
class Test
{
private int[int] _testMap;
public in
On 5/3/2009 3:44 AM, flourish wrote:
Hi,
why does the following code not compile -- or how to declare a (usable)
property of an associative array field?
//
class Test
{
private int[int] _testMap;
public int[int] testMap() {return _testMap;}
public void opIndexAss
On 5/3/2009 3:44 AM, flourish wrote:
Hi,
why does the following code not compile -- or how to declare a (usable)
property of an associative array field?
//
class Test
{
private int[int] _testMap;
public int[int] testMap() {return _testMap;}
}
testMap() is a getter a
On Sat, 02 May 2009 15:17:04 -0400, Rainer Deyke
wrote:
Robert Jacques wrote:
On Sat, 02 May 2009 03:39:27 -0400, Rainer Deyke
wrote:
You can have non-copyable value types, but they can't be containers.
No they don't. Iteration can often be destructive. If I iterate over a
stack or a que
Georg Wrede:
> The more I think about it, the more I'm starting to believe that the
> average desktop or laptop won't see two dozen cores in the immediate
> future.
Too much late. My personal computer has already about 100 small cores in the
GPU, and using CUDA (and soon OpenCL) you are even ab
Robert Jacques wrote:
> On Sat, 02 May 2009 03:39:27 -0400, Rainer Deyke
> wrote:
>> You can have non-copyable value types, but they can't be containers.
>
> No they don't. Iteration can often be destructive. If I iterate over a
> stack or a queue, I'm left with an empty stack/queue. For value
>
Walter Bright wrote:
bearophile wrote:
The following idioms may be useful as an optional built-in idiom in D
programs, to improve debugging:
http://users.bestweb.net/~ctips/tip015.html
I clicked on that one at random. I think this is much less of an issue
with D than with C, because C's memor
Don wrote:
Bill Baxter wrote:
On Fri, May 1, 2009 at 5:36 PM, bearophile
wrote:
Bill Baxter:
Much more often the discussion on the numpy list takes the form of
"how do I make this loop faster" becuase loops are slow in Python so
you have to come up with clever transformations to turn your loo
Thanks for your reply,
but I get the same error when using:
test.testMap()[0] = 1;
On Sat, 02 May 2009 10:23:13 -0400, Andrei Alexandrescu
wrote:
Denis Koroskin wrote:
You can reuse memory even if it comprehends more complex patterns
than one single allocation.
Andrei
I *highly* doubt it is worth the trouble. Most likely, this container
won't be lock-free and scalable a
Thanks for your reply,
but I get the same error when using:
test.testMap()[0] = 1;
== Quote from dennis luehring (dl.so...@gmx.net)'s article
> On 02.05.2009 20:44, flourish wrote:
> > Hi,
> >
> > why does the following code not compile -- or how to declare a (usable)
> > property of an associa
On 02.05.2009 20:44, flourish wrote:
Hi,
why does the following code not compile -- or how to declare a (usable)
property of an associative array field?
//
class Test
{
private int[int] _testMap;
public int[int] testMap() {return _testMap;}
}
void main()
{
Test te
== Quote from bearophile (bearophileh...@lycos.com)'s article
> dsimcha:
> > we first need to fix D's string hashing.<
> Ages ago I did suggest this one in the main D newsgroup:
> http://www.azillionmonkeys.com/qed/hash.html
> Bye,
> bearophile
On second thought...The real problem is just a strang
On Sat, 02 May 2009 10:18:41 -0400, Andrei Alexandrescu
wrote:
Bill Baxter wrote:
On Fri, May 1, 2009 at 6:25 PM, Andrei Alexandrescu
Matrix a, b, c; ... c = a; a += b;
Does the last operation mutate c as well?
I said "assignments like a = b are rare" and you put one of those in
your exa
Hi,
why does the following code not compile -- or how to declare a (usable)
property of an associative array field?
//
class Test
{
private int[int] _testMap;
public int[int] testMap() {return _testMap;}
}
void main()
{
Test test = new Test();
test.testMap[0] = 1;
}
On Sat, May 2, 2009 at 1:00 PM, dsimcha wrote:
> The result is that only about 8400 unique hashes are used, meaning 90+ % of
> keys cannot be stored directly in the position corresponding to their hash.
> Note that this is in full hash_t space, not in the modulus space typically
> used for AAs, s
On Sat, 02 May 2009 10:58:08 -0400, Andrei Alexandrescu
wrote:
Robert Jacques wrote:
I do scientific computing. Generally, I find it breaks down into two
parts: things under 4x4, for which value types are probably better, and
everything else, for which value types are to be avoided like t
Brad Roberts wrote:
I'm going to play devils advocate too...
struct ctor/dtor's are simplifiers. They remove a hard to explain difference
and aren't even a little bit hard to understand.
Ideally, that would be true.
But there are some wonky rules abound struct ctors, static opCall, and
stru
== Quote from bearophile (bearophileh...@lycos.com)'s article
> dsimcha:
> > we first need to fix D's string hashing.<
> Ages ago I did suggest this one in the main D newsgroup:
> http://www.azillionmonkeys.com/qed/hash.html
> Bye,
> bearophile
Yeah, upon further reverse engineering, the way strin
Andrei Alexandrescu:
> Consider the progress we made when replacing char[]
> with string. Why? Because with char[] long-distance dependencies crop up
> easy and fast.
For big arrays people will put "ref" everywhere, so those bugs will not
decrease.
Bye,
bearophile
About the issue of matrices as reference or value semantics.
As a program I think references are more efficient, they are used everywhere in
many languages like Python/Numpy, Sage, Ruby, etc, and I don't like the idea of
putting "ref" everywhere. So I like references more. Also all objects in D
On Sat, 02 May 2009 04:17:29 -0400, Don wrote:
Bill Baxter wrote:
On Fri, May 1, 2009 at 5:36 PM, bearophile
wrote:
Bill Baxter:
Much more often the discussion on the numpy list takes the form of
"how do I make this loop faster" becuase loops are slow in Python so
you have to come up with
On Sat, 02 May 2009 06:23:46 -0400, Michel Fortin
wrote:
On 2009-05-01 13:44:58 -0400, "Robert Jacques" said:
I think you might of misunderstood the concept of a unique/mobile type.
If you take a slice or a reference of an unique, you null the source.
Which makes using unique T logica
dsimcha:
> we first need to fix D's string hashing.<
Ages ago I did suggest this one in the main D newsgroup:
http://www.azillionmonkeys.com/qed/hash.html
Bye,
bearophile
Bill Baxter:
>Strange though, aren't you the guy always telling us how being able to express
>your algorithm clearly is often more important than raw performance?<
Nope. I have said many things :-) One of the things I have said is that most of
the code of most programs isn't performance-critical
I've been playing around with associative array implementations in D, mostly
trying to create ones that are more GC-friendly. I had written one that
seemed much faster than the builtin for int and float keys but much slower for
strings. I've found the reason: The builtin AAs use trees for collis
Walter Bright:
>I clicked on that one at random. I think this is much less of an issue with D
>than with C, because C's memory corruption problems are nearly entirely
>related to its reliance on pointers and manual memory management.<
This is true, most of D code just doesn't use so much pointe
Walter Bright Wrote:
> Georg Wrede wrote:
> > And now that the Net is
> > even there, that's really a viable option. Congratulations!
>
> Before the web, D wouldn't even have been possible as it relies on the
> collaberation of people all over the world.
We're not quite there yet. It took me t
bearophile wrote:
The following idioms may be useful as an optional built-in idiom in D
programs, to improve debugging:
http://users.bestweb.net/~ctips/tip015.html
I clicked on that one at random. I think this is much less of an issue
with D than with C, because C's memory corruption problems
Andrei Alexandrescu:
> (untested)
> struct Mystring {
> size_t size, capacity;
> char* pdata() { return cast(char*) (&this + 1); }
> char[] data() { return pdata()[0 .. size]; }
> }
It looks quite more complex than the C code (but Denis Koroskin has found a
simple solution).
>bu
On 2009-05-02 10:18:41 -0400, Andrei Alexandrescu
said:
Yes, when you have an a=b anywhere you've got to pay attention and
make sure you didn't mean a=b.dup.
That is terrible. Anywhere == a portion of the code far, far away.
It's funny that you mention ==, since anywhere you write = you al
dolive wrote:
Sean Kelly дµ½:
== Quote from Steve Teale (steve.te...@britseyeview.com)'s article
dolive Wrote:
Why up to now return didn't an is like the jdbc or the ado.net such database
api £¿
thank's
dolive
More specifically, has anyone done anything under a liberal license that
im
On Sat, 02 May 2009 14:57:43 +0200, Bruno Deligny wrote:
> When i try to install dmd1 or dmd2 on my ubuntu i386 with the deb
> packages on http://www.digitalmars.com/d/download.html, it says "Error :
> incorrect Architecture « amd64 »"
>
> The packages were built for the amd64 architecture.
I do
Robert Jacques wrote:
I do scientific computing. Generally, I find it breaks down into two
parts: things under 4x4, for which value types are probably better, and
everything else, for which value types are to be avoided like the
plague. I'll often work with 100's mb of data with algorithms that
On Sat, 02 May 2009 18:17:16 +0400, Denis Koroskin <2kor...@gmail.com> wrote:
> On Sat, 02 May 2009 18:08:30 +0400, Andrei Alexandrescu
> wrote:
>
>> Robert Jacques wrote:
>>> On Sat, 02 May 2009 03:35:51 -0400, Andrei Alexandrescu
>>> wrote:
>>>
Robert Jacques wrote:
>> No, repeated
Denis Koroskin wrote:
You can reuse memory even if it comprehends more complex patterns
than one single allocation.
Andrei
I *highly* doubt it is worth the trouble. Most likely, this container
won't be lock-free and scalable anymore. Performance will also
degrade dramatically.
How did you ge
Bill Baxter wrote:
On Fri, May 1, 2009 at 6:25 PM, Andrei Alexandrescu
wrote:
Bill Baxter wrote:
On Fri, May 1, 2009 at 4:23 PM, Andrei Alexandrescu
wrote:
I guess at that point the would-be D user would be entitled to
make me a lavaliere out of my Matrix library and move on.
Python, and th
On Sat, 02 May 2009 18:08:30 +0400, Andrei Alexandrescu
wrote:
> Robert Jacques wrote:
>> On Sat, 02 May 2009 03:35:51 -0400, Andrei Alexandrescu
>> wrote:
>>
>>> Robert Jacques wrote:
> No, repeated allocations are trivial to eliminate. I didn't even
> bother to explain that in the
Robert Jacques wrote:
On Sat, 02 May 2009 03:35:51 -0400, Andrei Alexandrescu
wrote:
Robert Jacques wrote:
No, repeated allocations are trivial to eliminate. I didn't even
bother to explain that in the article. The loop must only refill the
allocated object from the object that needs to be
On Fri, May 1, 2009 at 6:25 PM, Andrei Alexandrescu
wrote:
> Bill Baxter wrote:
>>
>> On Fri, May 1, 2009 at 4:23 PM, Andrei Alexandrescu
>> wrote:
>>>
>>> I guess at that point the would-be D user would be entitled to make me a
>>> lavaliere out of my Matrix library and move on.
>>
>> Python, an
superdan wrote:
Steve Teale Wrote:
bearophile Wrote:
So I agree with nearly nothing you have (badly) expressed.
Bye,
bearophile
Who is this guy?" He must be putting his messages through one of those web
sites that translate into strange dialects - fry my ass!
fer tat i recommend da geor
When i try to install dmd1 or dmd2 on my ubuntu i386 with the deb
packages on http://www.digitalmars.com/d/download.html, it says "Error :
incorrect Architecture « amd64 »"
The packages were built for the amd64 architecture.
Steve Teale wrote:
If I want a catch-all catch, which should I be using.
Out of habit I use Exception, but if I do that then I will miss some things
thrown from Phobos.
Is it the intention that Throwable be used for this purpose?
Yes.
On Sat, 02 May 2009 03:56:05 +0400, bearophile wrote:
Walter Bright:
Why couldn't you do the exact same thing in D?<
Those ctips show some tricks done with the preprocessor that I don't
know yet how to do with D1, and there are some situations where in D I'd
like to be able to locally di
Georg Wrede wrote:
And now that the Net is
even there, that's really a viable option. Congratulations!
Before the web, D wouldn't even have been possible as it relies on the
collaberation of people all over the world.
Sean Kelly дµ½:
> == Quote from Steve Teale (steve.te...@britseyeview.com)'s article
> > dolive Wrote:
> > > Why up to now return didn't an is like the jdbc or the ado.net such
> > > database api £¿
> > >
> > > thank's
> > >
> > >
> > > dolive
> > More specifically, has anyone done anything und
On 2009-05-01 13:44:58 -0400, "Robert Jacques" said:
I think you might of misunderstood the concept of a unique/mobile type.
If you take a slice or a reference of an unique, you null the source.
Which makes using unique T logically invalid as a container.
Take note: I'm not expecting it to
bearophile wrote:
From a certain point of view you can think of a medium/high level as
D/Python/Ruby/Java as a collection of idioms of low level languages,
that now you can use at high level (OOP can be seen as a collection of
idioms in C. In old structured programming can be seen as an idiom. In
Steve Teale wrote:
superdan Wrote:
Steve Teale Wrote:
It's called retirement. I can use whatever language I like, and
write anything that comes to mind 24 hours a day if I want to.
nope. it's called /rich/ retirement. with my fuckin' stox n 401k &
the way shit is goin' i'll need to work til
On Sat, 02 May 2009 03:39:27 -0400, Rainer Deyke
wrote:
Robert Jacques wrote:
On Fri, 01 May 2009 15:37:56 -0400, Rainer Deyke
wrote:
All containers need to support copying.
No they don't.
There is no conceptual problem with a non-copyable struct. However, in
order to be a considered
Bill Baxter wrote:
On Fri, May 1, 2009 at 5:36 PM, bearophile wrote:
Bill Baxter:
Much more often the discussion on the numpy list takes the form of
"how do I make this loop faster" becuase loops are slow in Python so
you have to come up with clever transformations to turn your loop into
array
On Sat, 02 May 2009 03:35:51 -0400, Andrei Alexandrescu
wrote:
Robert Jacques wrote:
No, repeated allocations are trivial to eliminate. I didn't even
bother to explain that in the article. The loop must only refill the
allocated object from the object that needs to be replaced.
putting t
Robert Jacques wrote:
> On Fri, 01 May 2009 15:37:56 -0400, Rainer Deyke
> wrote:
>> All containers need to support copying.
>
> No they don't.
There is no conceptual problem with a non-copyable struct. However, in
order to be a considered a container, the struct must at least support
read-only
Robert Jacques wrote:
No, repeated allocations are trivial to eliminate. I didn't even
bother to explain that in the article. The loop must only refill the
allocated object from the object that needs to be replaced.
putting the test in the pseudo code for this would've help my
understanding.
On Fri, 01 May 2009 21:14:54 -0400, Bill Baxter wrote:
On Fri, May 1, 2009 at 5:36 PM, bearophile
wrote:
Bill Baxter:
Much more often the discussion on the numpy list takes the form of
"how do I make this loop faster" becuase loops are slow in Python so
you have to come up with clever trans
On Sat, 02 May 2009 02:34:57 -0400, Andrei Alexandrescu
wrote:
Robert Jacques wrote:
On Fri, 01 May 2009 19:25:35 -0400, Andrei Alexandrescu
wrote:
Robert Jacques wrote:
Do you have a link to your article?
http://tinyurl.com/dac82a
Andrei
Should've seen that one coming. :)
Anywa
73 matches
Mail list logo