Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Mafi
Am 15.02.2011 22:49, schrieb Michel Fortin: On 2011-02-15 16:33:33 -0500, Walter Bright said: Nick Sabalausky wrote: "Walter Bright" wrote in message news:ijeil4$2aso$3...@digitalmars.com... spir wrote: Having to constantly explain that "_t" means type, that "size" does not mean size, what

Better assert without changing built-in assert

2011-02-16 Thread Jens Mueller
Hi, I'm trying to improve the assertions. I tried the following auto foo(bool var) { return tuple(var, "MyMessage"); } void bar(bool var, string text) { } unittest { bar(foo(true).expand); //assert(foo(true).expand); // won't compile } void main() {} $ dmd -unittest -ru

Re: std.range.zip performance

2011-02-16 Thread spir
On 02/16/2011 03:36 AM, Andrei Alexandrescu wrote: Initial: 58 seconds. Eliminated the switch in popFront: 53s. Replaced emplace with assignment: 23s. Specialized emplace for non-struct types, reinserted: 23s. Eliminated the loop in empty (replaced with return ranges[0].empty;): 17s. I'm sur

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread spir
On 02/16/2011 04:49 AM, Michel Fortin wrote: On 2011-02-15 22:41:32 -0500, "Nick Sabalausky" said: I like "nint". But is it unsigned or signed? Do we need 'unint' too? I think 'word' & 'uword' would be a better choice. I can't say I'm too displeased with 'size_t', but it's true that the 'si

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread spir
On 02/16/2011 03:07 AM, Jonathan M Davis wrote: On Tuesday, February 15, 2011 15:13:33 spir wrote: On 02/15/2011 11:24 PM, Jonathan M Davis wrote: Is there some low level reason why size_t should be signed or something I'm completely missing? My personal issue with unsigned ints in general as

Re: std.range.zip performance

2011-02-16 Thread dennis luehring
Am 16.02.2011 10:25, schrieb spir: On 02/16/2011 03:36 AM, Andrei Alexandrescu wrote: Initial: 58 seconds. Eliminated the switch in popFront: 53s. Replaced emplace with assignment: 23s. Specialized emplace for non-struct types, reinserted: 23s. Eliminated the loop in empty (replaced wit

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Walter Bright
Jonathan M Davis wrote: It's inevitable in any systems language. What are you going to do, throw away a bit for unsigned integers? That's not acceptable for a systems language. On some level, you must live with the fact that you're running code on a specific machine with a specific set of const

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Iain Buclaw
== Quote from spir (denis.s...@gmail.com)'s article > On 02/16/2011 04:49 AM, Michel Fortin wrote: > > On 2011-02-15 22:41:32 -0500, "Nick Sabalausky" said: > > > >> I like "nint". It's the machine integer, so I think the word 'mint' would better match your naming logic. Also, reminds me of this

Re: Better assert without changing built-in assert

2011-02-16 Thread Jim
Jens Mueller Wrote: > Hi, > > I'm trying to improve the assertions. I tried the following > auto foo(bool var) { > return tuple(var, "MyMessage"); > } > > void bar(bool var, string text) { > } > > unittest { > bar(foo(true).expand); > //assert(foo(true).expand); // won't compi

Re: Better assert without changing built-in assert

2011-02-16 Thread Andrei Alexandrescu
On 2/16/11 5:04 AM, Jim wrote: Jens Mueller Wrote: Hi, I'm trying to improve the assertions. I tried the following auto foo(bool var) { return tuple(var, "MyMessage"); } void bar(bool var, string text) { } unittest { bar(foo(true).expand); //assert(foo(true).expand);

Re: shared libraries in D

2011-02-16 Thread Iain Buclaw
== Quote from Christian Kamm (kamm-incasoftw...@removethis.de)'s article > Iain Buclaw wrote: > > == Quote from Christian Kamm (kamm-incasoftw...@removethis.de)'s article > >> Iain Buclaw wrote: > >> > Will be making shared libraries default in GDC pretty soon now... > >> Did you adjust the GC to c

Re: Better assert without changing built-in assert

2011-02-16 Thread Jim
Jens Mueller Wrote: > Hi, > > I'm trying to improve the assertions. I tried the following > auto foo(bool var) { > return tuple(var, "MyMessage"); > } > > void bar(bool var, string text) { > } > > unittest { > bar(foo(true).expand); > //assert(foo(true).expand); // won't compi

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Don
spir wrote: On 02/16/2011 03:07 AM, Jonathan M Davis wrote: On Tuesday, February 15, 2011 15:13:33 spir wrote: On 02/15/2011 11:24 PM, Jonathan M Davis wrote: Is there some low level reason why size_t should be signed or something I'm completely missing? My personal issue with unsigned ints

Re: std.range.zip performance

2011-02-16 Thread bearophile
Andrei: > I'm sure there are ways to further improve this, but there are a few > difficulties. Each pass through the loop the code must transport values from > the two arrays into a specific format and then distribute them for further > calculation. Then, upon each popFront two words must be to

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread KennyTM~
On Feb 16, 11 11:49, Michel Fortin wrote: On 2011-02-15 22:41:32 -0500, "Nick Sabalausky" said: I like "nint". But is it unsigned or signed? Do we need 'unint' too? I think 'word' & 'uword' would be a better choice. I can't say I'm too displeased with 'size_t', but it's true that the 'size_

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Steven Schveighoffer
On Tue, 15 Feb 2011 18:18:22 -0500, Rainer Schuetze wrote: Steven Schveighoffer wrote: In addition size_t isn't actually defined by the compiler. So the library controls the size of size_t, not the compiler. This should make it extremely portable. I do not consider the language an

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Steven Schveighoffer
On Tue, 15 Feb 2011 16:50:21 -0500, Nick Sabalausky wrote: "Nick Sabalausky" wrote in message news:ijesem$brd$1...@digitalmars.com... "Steven Schveighoffer" wrote in message news:op.vqx78nkceav7ka@steve-laptop... size_t works, it has a precedent, it's already *there*, just use it, or a

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread spir
On 02/16/2011 12:21 PM, Don wrote: spir wrote: On 02/16/2011 03:07 AM, Jonathan M Davis wrote: On Tuesday, February 15, 2011 15:13:33 spir wrote: On 02/15/2011 11:24 PM, Jonathan M Davis wrote: Is there some low level reason why size_t should be signed or something I'm completely missing? M

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread gölgeliyele
On 2/16/11 9:09 AM, Steven Schveighoffer wrote: On Tue, 15 Feb 2011 16:50:21 -0500, Nick Sabalausky wrote: "Nick Sabalausky" wrote in message module nick; alias size_t wordsize; Now you can use it anywhere, it's sooo freaking simple, I don't understand the outrage. But that is somewhat

Re: Stupid little iota of an idea

2011-02-16 Thread Bruno Medeiros
On 11/02/2011 23:55, Andrei Alexandrescu wrote: On 2/11/11 7:07 AM, foobar wrote: Andrei Alexandrescu Wrote: I don't find the name "iota" stupid. Andrei I want to make a few comments, arising from several different posts in this discussion. First, before this discussion that Ary sta

Re: DVCS vs. Subversion brittleness (was Re: Moving to D)

2011-02-16 Thread Bruno Medeiros
On 11/02/2011 23:30, Walter Bright wrote: Bruno Medeiros wrote: but seriously, even if I am connected to the Internet I cannot code with my laptop only, I need it connected to a monitor, as well as a mouse, (and preferably a keyboard as well). I found I can't code on my laptop anymore; I am to

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Steven Schveighoffer
On Wed, 16 Feb 2011 09:23:09 -0500, gölgeliyele wrote: On 2/16/11 9:09 AM, Steven Schveighoffer wrote: On Tue, 15 Feb 2011 16:50:21 -0500, Nick Sabalausky wrote: "Nick Sabalausky" wrote in message module nick; alias size_t wordsize; Now you can use it anywhere, it's sooo freaking simp

Re: DVCS vs. Subversion brittleness (was Re: Moving to D)

2011-02-16 Thread Bruno Medeiros
On 11/02/2011 18:31, Michel Fortin wrote: Ideally, if one wants to do push but the ancestor history is incomplete, the VCS would download from the central repository whatever revision/changeset information was missing. Actually, there's no "central" repository in Git. That stuff about DVCS n

Re: DVCS vs. Subversion brittleness (was Re: Moving to D)

2011-02-16 Thread Bruno Medeiros
On 11/02/2011 13:14, Jean Crystof wrote: Since you're a SVN advocate, please explain how well it works with 2500 GB of asset files? I'm not an SVN advocate. I have started using DVCSs over Subversion, and generally I agree they are better, but what I'm saying is that they are not all roses..

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread gölgeliyele
On 2/16/11 9:45 AM, Steven Schveighoffer wrote: I'm done with this thread... -Steve Ok, I don't want to drag on. But there is a reason why we have a style. size_t is against the D style and obviously does not match. I use size_t as much as Walter does in my day job, and I even like it. It

Re: 0nnn octal notation considered harmful

2011-02-16 Thread Stewart Gordon
On 12/02/2011 18:27, Don wrote: spir wrote: Copying a string'ed integer is indeed not the only this notation is bug-prone: prefixing a number with '0' should not change its value (!). Indeed. Even more confusing is that when it's a floating point it doesn't. But see http://d.puremagic.co

Re: D vs Go on reddit

2011-02-16 Thread Bruno Medeiros
On 10/02/2011 21:38, Ulrik Mikaelsson wrote: 2011/2/10 Bruno Medeiros: I'm very much a fan of simple and orthogonal languages. But this statement has a big problem: it's not clear what one actually considers to be "simple" and "orthogonal". What people consider to be orthogonal can vary not only

Re: DVCS vs. Subversion brittleness (was Re: Moving to D)

2011-02-16 Thread Russel Winder
On Wed, 2011-02-16 at 14:51 +, Bruno Medeiros wrote: [ . . . ] > That stuff about DVCS not having a central repository is another thing > that is being said a lot, but is only true in a very shallow (and > non-useful) way. Yes, in DVCS there are no more "working copies" as in > Subversion, n

Re: D vs Go on reddit

2011-02-16 Thread Bruno Medeiros
On 11/02/2011 03:08, Nick Sabalausky wrote: "Bruno Medeiros" wrote in message news:ij1guf$694$1...@digitalmars.com... You guys are way on the wrong track here. I'm very much a fan of simple and orthogonal languages. But this statement has a big problem: it's not clear what one actually conside

Re: What Makes A Programming Language Good

2011-02-16 Thread Bruno Medeiros
On 04/02/2011 20:55, bearophile wrote: Bruno Medeiros: That language ecosystems are what matter, not just the language itself. This is true, but only once your language is already very good :-) Bye, bearophile I disagree. I think an average language with an average toolchain (I'm not even

Re: DVCS vs. Subversion brittleness (was Re: Moving to D)

2011-02-16 Thread Ulrik Mikaelsson
2011/2/16 Russel Winder : > > Definitely the case.  There can only be one repository that represents > the official state of a given project.  That isn't really the issue in > the move from CVCS systems to DVCS systems. > Just note that not all projects have a specific "state" to represent. Many pr

Re: D vs Go on reddit

2011-02-16 Thread Ulrik Mikaelsson
2011/2/16 Bruno Medeiros : > We must not be saying (or thinking) the same thing then, because I do think > it is worthwhile to have orthogonality as one of the primary design goals. > I believe we are still not thinking of orthogonality in the same way. You > seem to be thinking in terms of pure si

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Jonathan M Davis
On Wednesday, February 16, 2011 06:51:21 gölgeliyele wrote: > On 2/16/11 9:45 AM, Steven Schveighoffer wrote: > > I'm done with this thread... > > > > -Steve > > Ok, I don't want to drag on. But there is a reason why we have a style. > size_t is against the D style and obviously does not match. I

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Daniel Gibson
Am 16.02.2011 19:20, schrieb Jonathan M Davis: > On Wednesday, February 16, 2011 06:51:21 gölgeliyele wrote: >> On 2/16/11 9:45 AM, Steven Schveighoffer wrote: >>> I'm done with this thread... >>> >>> -Steve >> >> Ok, I don't want to drag on. But there is a reason why we have a style. >> size_t is

Re: What Makes A Programming Language Good

2011-02-16 Thread Jonathan M Davis
On Wednesday, February 16, 2011 09:23:04 Bruno Medeiros wrote: > On 04/02/2011 20:55, bearophile wrote: > > Bruno Medeiros: > >> That language ecosystems are what matter, not just the language itself. > > > > This is true, but only once your language is already very good :-) > > > > Bye, > > bear

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Walter Bright
Don wrote: [1] What was size_t on the 286 ? 16 bits Note that in the small memory model (all pointers 16 bits) it really was possible to have an object of size 0x_, because the code was in a different address space. Not really. I think the 286 had a hard limit of 16 Mb. There was

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Don
Walter Bright wrote: Don wrote: [1] What was size_t on the 286 ? 16 bits Note that in the small memory model (all pointers 16 bits) it really was possible to have an object of size 0x_, because the code was in a different address space. Not really. I think the 286 had a hard lim

Re: alias this question

2011-02-16 Thread Christopher Nicholson-Sauls
On 02/13/11 10:30, Olli Aalto wrote: > I encountered a problem with alias this, when the aliased member is > private. I'm using the latest dmd2. It reports the follwing: > src\main.d(14): Error: struct K.K member s is not accessible > > If I change the private modifier on the s member to public it

Dynamic array initialization syntax

2011-02-16 Thread bearophile
I have suggested a simple initialization syntax for dynamic arrays, similar to the syntax used for fixed-sized arrays: http://d.puremagic.com/issues/show_bug.cgi?id=5603 void main() { auto a2 = new int[5] = void; auto a1 = new int[5] = 1; auto m2 = new int[][](5, 5) = void; auto m

Re: Dynamic array initialization syntax

2011-02-16 Thread Andrej Mitrovic
import std.stdio; import std.range; auto newArray(T)(T value, size_t size) { return array(take(repeat(value), size)); } void main() { auto a1 = newArray(5, 3); assert(a1 == [5, 5, 5]); } __Dmain:; Function begin, communal sub esp, 28 ; 000

Re: Dynamic array initialization syntax

2011-02-16 Thread Andrej Mitrovic
Oh, but there's a call to array. I guess that could slow things down, sorry.

Re: What Makes A Programming Language Good

2011-02-16 Thread retard
Wed, 16 Feb 2011 17:23:04 +, Bruno Medeiros wrote: > On 04/02/2011 20:55, bearophile wrote: >> Bruno Medeiros: >> >>> That language ecosystems are what matter, not just the language >>> itself. >> >> This is true, but only once your language is already very good :-) >> >> Bye, >> bearophile >

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Walter Bright
Don wrote: Walter Bright wrote: Don wrote: [1] What was size_t on the 286 ? 16 bits Note that in the small memory model (all pointers 16 bits) it really was possible to have an object of size 0x_, because the code was in a different address space. Not really. I think the 286 ha

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread dsimcha
This whole conversation makes me feel like The Naive Noob for complaining about how much 32-bit address space limitations suck and we need 64 support. On 2/16/2011 8:52 PM, Walter Bright wrote: Don wrote: Walter Bright wrote: Don wrote: [1] What was size_t on the 286 ? 16 bits Note th

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Kevin Bealer
== Quote from spir (denis.s...@gmail.com)'s article > On 02/16/2011 03:07 AM, Jonathan M Davis wrote: > > On Tuesday, February 15, 2011 15:13:33 spir wrote: > >> On 02/15/2011 11:24 PM, Jonathan M Davis wrote: > >>> Is there some low level reason why size_t should be signed or something > >>> I'm c

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Daniel Gibson
Am 17.02.2011 05:19, schrieb Kevin Bealer: > == Quote from spir (denis.s...@gmail.com)'s article >> On 02/16/2011 03:07 AM, Jonathan M Davis wrote: >>> On Tuesday, February 15, 2011 15:13:33 spir wrote: On 02/15/2011 11:24 PM, Jonathan M Davis wrote: > Is there some low level reason why si

Re: D vs Go on reddit

2011-02-16 Thread retard
Thu, 10 Feb 2011 22:38:03 +0100, Ulrik Mikaelsson wrote: > 2011/2/10 Bruno Medeiros : >> I'm very much a fan of simple and orthogonal languages. But this >> statement has a big problem: it's not clear what one actually considers >> to be "simple" and "orthogonal". What people consider to be orthog

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Nick Sabalausky
"KennyTM~" wrote in message news:ijghne$ts1$1...@digitalmars.com... > On Feb 16, 11 11:49, Michel Fortin wrote: >> On 2011-02-15 22:41:32 -0500, "Nick Sabalausky" said: >> >>> I like "nint". >> >> But is it unsigned or signed? Do we need 'unint' too? >> >> I think 'word' & 'uword' would be a bet

Re: Integer conversions too pedantic in 64-bit

2011-02-16 Thread Dmitry Olshansky
On 17.02.2011 9:09, Nick Sabalausky wrote: "KennyTM~" wrote in message news:ijghne$ts1$1...@digitalmars.com... On Feb 16, 11 11:49, Michel Fortin wrote: On 2011-02-15 22:41:32 -0500, "Nick Sabalausky" said: I like "nint". But is it unsigned or signed? Do we need 'unint' too? I think 'word