Re: compiler support added for precise GC

2012-04-16 Thread Jacob Carlborg
On 2012-04-17 08:33, Walter Bright wrote: On 4/16/2012 11:26 PM, Jacob Carlborg wrote: Then it won't be possible to serialize third party types if they don't implements ISerializable. In this case, this solution is no better then manually registering types. Actually it's worse, since I can manua

Re: Orphan ranges

2012-04-16 Thread Jonathan M Davis
On Monday, April 16, 2012 23:07:34 Andrei Alexandrescu wrote: > On 4/16/12 12:57 PM, Jonathan M Davis wrote: > > So, the problem that we have is basically > > > > void main() > > { > > > > Range r; > > { > > Container c = //allocated using allocator, however that works > > r = c[]; > >

Re: compiler support added for precise GC

2012-04-16 Thread Sean Kelly
On Apr 16, 2012, at 7:20 PM, Andrei Alexandrescu wrote: > On 4/16/12 1:02 PM, Sean Kelly wrote: >> As for pointer maps, I think it's reasonable to establish a format >> that these will be made available to the GC, and for them to come >> from elsewhere in the runtime. I realize that different G

Re: Definitive list of storage classes

2012-04-16 Thread Jonathan M Davis
On Monday, April 16, 2012 22:58:44 Andrei Alexandrescu wrote: > On 4/16/12 9:20 PM, Jonathan M Davis wrote: > > On Monday, April 16, 2012 19:57:04 Caligo wrote: > >> So, since they haven't said anything, does this mean that neither > >> Walter nor Andrei have the answer to this question? or is this

Re: compiler support added for precise GC

2012-04-16 Thread Jacob Carlborg
On 2012-04-16 22:52, Steven Schveighoffer wrote: I feel this actually can be more generic. Can we change this to a more generic term? For example getRTInfo (short for get runtime info) and RTInfo(T)? Here is my thought: the GC is not the only entity that might be interested in permanently stori

Re: compiler support added for precise GC

2012-04-16 Thread Jacob Carlborg
On 2012-04-16 22:51, Walter Bright wrote: Serialization does NOT need to deal with all types, only the types that are to be serialized. Again, if a third party forgets to mark a type for serialization, or runtime reflection I'm out of luck. In in that case what I already have works better.

Re: compiler support added for precise GC

2012-04-16 Thread Walter Bright
On 4/16/2012 11:26 PM, Jacob Carlborg wrote: Then it won't be possible to serialize third party types if they don't implements ISerializable. In this case, this solution is no better then manually registering types. Actually it's worse, since I can manually register third party types. I'm not s

Re: compiler support added for precise GC

2012-04-16 Thread Jacob Carlborg
On 2012-04-16 22:42, Timon Gehr wrote: This could be fixed by introducing a simple language feature that allows a supertype to specify mixin templates that are 'inherited' by all subtypes. Eg: interface ISerializable { ubyte[] serialize(); super mixin Serialize; } Then it won't be possible

Re: compiler support added for precise GC

2012-04-16 Thread Francois Chabot
On Tuesday, 17 April 2012 at 05:34:17 UTC, Kapps wrote: On Monday, 16 April 2012 at 16:53:53 UTC, Walter Bright wrote: On 4/16/2012 9:40 AM, Jacob Carlborg wrote: Regardless of how the runtime reflection is generated, by a library or the compiler, it needs to be available to all types. Why?

Re: compiler support added for precise GC

2012-04-16 Thread Paulo Pinto
Because you cannot control third party code. Maybe I am mistaken and with std.variant together with compile-time reflection, it is possible to cover most use cases that make sense, but I am not 100% sure of it. -- Paulo "Walter Bright" wrote in message news:jmhir1$16nn$1...@digitalmars.com.

Re: compiler support added for precise GC

2012-04-16 Thread Kapps
On Monday, 16 April 2012 at 16:53:53 UTC, Walter Bright wrote: On 4/16/2012 9:40 AM, Jacob Carlborg wrote: Regardless of how the runtime reflection is generated, by a library or the compiler, it needs to be available to all types. Why? (I can see the point for a dynamic language, but not a s

Re: Orphan ranges

2012-04-16 Thread Andrei Alexandrescu
On 4/16/12 12:57 PM, Jonathan M Davis wrote: So, the problem that we have is basically void main() { Range r; { Container c = //allocated using allocator, however that works r = c[]; } //Container may or may not exist in memory, depending on the allocator, //but the range does exis

Re: Definitive list of storage classes

2012-04-16 Thread Andrei Alexandrescu
On 4/16/12 9:20 PM, Jonathan M Davis wrote: On Monday, April 16, 2012 19:57:04 Caligo wrote: So, since they haven't said anything, does this mean that neither Walter nor Andrei have the answer to this question? or is this something a lot more complicated ? My guess is that they haven't read th

Re: compiler support added for precise GC

2012-04-16 Thread Walter Bright
On 4/16/2012 7:20 PM, Andrei Alexandrescu wrote: The scheme Walter proposed has a lot of flexibility - it plants one pointer to function per type. This is very flexible because that pointer could point to the same function and use a bitmap-based scheme, or (as Walter proposed) point to different

Re: Definitive list of storage classes

2012-04-16 Thread Caligo
On Mon, Apr 16, 2012 at 9:20 PM, Jonathan M Davis wrote: > On Monday, April 16, 2012 19:57:04 Caligo wrote: >> So, since they haven't said anything, does this mean that neither >> Walter nor Andrei have the answer to this question? or is this >> something a lot more complicated ? > > My guess is t

Re: compiler support added for precise GC

2012-04-16 Thread Andrei Alexandrescu
On 4/16/12 3:49 PM, Walter Bright wrote: Either the compiler has to generate the marking stuff, meaning that no user designed GC is very practical, or it has to be generated at compile time with a template, where a user designed GC can experiment with a much wider range of possibilities without n

Re: compiler support added for precise GC

2012-04-16 Thread Andrei Alexandrescu
On 4/16/12 1:02 PM, Sean Kelly wrote: As for pointer maps, I think it's reasonable to establish a format that these will be made available to the GC, and for them to come from elsewhere in the runtime. I realize that different GC implementations may prefer different formats, but hopefully we can

Re: Definitive list of storage classes

2012-04-16 Thread Jonathan M Davis
On Monday, April 16, 2012 19:57:04 Caligo wrote: > So, since they haven't said anything, does this mean that neither > Walter nor Andrei have the answer to this question? or is this > something a lot more complicated ? My guess is that they haven't read the thread, but I don't know. - Jonathan M

Re: compiler support added for precise GC

2012-04-16 Thread Andrei Alexandrescu
On 4/16/12 1:31 PM, Alex Rønne Petersen wrote: I think we can safely settle on bitmaps for this. Most real world GCs use this kind of strategy. This is a valid argument, but I should say it's very much worth exploring techniques enabled by D specifically. Many unique and superior D idioms wou

Re: Shared libraries under linux

2012-04-16 Thread alexhairyman
On Tue, 17 Apr 2012 02:46:28 +0200 "Sven-Hendrik Haase" wrote: > On Tuesday, 17 April 2012 at 00:41:46 UTC, alexhairyman wrote: > > Just a tip for everybody, but Under Linux, you can do a lot > > with the Linker commands you know those -L ones, besides being > > able to link with shared, you ca

Re: Definitive list of storage classes

2012-04-16 Thread Caligo
So, since they haven't said anything, does this mean that neither Walter nor Andrei have the answer to this question? or is this something a lot more complicated ?

Re: Shared libraries under linux

2012-04-16 Thread Sven-Hendrik Haase
On Tuesday, 17 April 2012 at 00:41:46 UTC, alexhairyman wrote: Just a tip for everybody, but Under Linux, you can do a lot with the Linker commands you know those -L ones, besides being able to link with shared, you can also specify where the ELF binary will look to find your D shared library,

Shared libraries under linux

2012-04-16 Thread alexhairyman
Just a tip for everybody, but Under Linux, you can do a lot with the Linker commands you know those -L ones, besides being able to link with shared, you can also specify where the ELF binary will look to find your D shared library, by using -L-r which embeds a search path in your ELF binary, han

Re: D scored well in the Google CodeJam Qualification Round

2012-04-16 Thread bearophile
Somedude: Although there was very few D contestants (only 15 out of 18365 contestants used D), D scored number 1. This D solution of the "hall of mirrors" (modified from C++ code) is about 3.5 times faster on the large dataset than hos.lyric solution. No GC required, stack allocation wins: h

Re: compiler support added for precise GC

2012-04-16 Thread Timon Gehr
On 04/16/2012 10:51 PM, Walter Bright wrote: On 4/16/2012 11:42 AM, Jacob Carlborg wrote: On 2012-04-16 18:53, Walter Bright wrote: On 4/16/2012 9:40 AM, Jacob Carlborg wrote: Regardless of how the runtime reflection is generated, by a library or the compiler, it needs to be available to all t

Re: Usage of Exceptions in std.xml

2012-04-16 Thread Nick Sabalausky
"Rene Zwanenburg" wrote in message news:qsfdbygjmisksxwmz...@forum.dlang.org... > > Thanks. I've been trying to get D2-XML to compile for a few hours now > without much luck, so that one is out. Does anyone know another good > replacement? > The one in Tango is supposed to be pretty good (and

Re: std.benchmark ready for review. Manager sought after

2012-04-16 Thread Jens Mueller
Lars T. Kyllingstad wrote: > On Sunday, 15 April 2012 at 16:23:32 UTC, Jens Mueller wrote: > >Andrei Alexandrescu wrote: > >>There have been quite a few good comments, but no review manager > >>offer. Could someone please take this role? > > > >I will do this. > >But I will need to get more familia

Re: compiler support added for precise GC

2012-04-16 Thread Steven Schveighoffer
On Mon, 16 Apr 2012 16:52:54 -0400, Steven Schveighoffer wrote: But we need to change the name early on to avoid conflicts. I don't think a more generic name would be inappropriate, even if the GC is the only client at first. Should have said "But we need to change the name early on to

Re: compiler support added for precise GC

2012-04-16 Thread Steven Schveighoffer
On Sun, 15 Apr 2012 22:24:56 -0400, Walter Bright wrote: Just checked it in. Of course, it doesn't actually do precise GC, it is just thrown over the wall for the library devs who are itching to get started on it. I added a getGCInfo() method to TypeInfo that returns an immutable(void)

Re: compiler support added for precise GC

2012-04-16 Thread Walter Bright
On 4/16/2012 11:42 AM, Jacob Carlborg wrote: On 2012-04-16 18:53, Walter Bright wrote: On 4/16/2012 9:40 AM, Jacob Carlborg wrote: Regardless of how the runtime reflection is generated, by a library or the compiler, it needs to be available to all types. Why? (I can see the point for a dynam

Re: compiler support added for precise GC

2012-04-16 Thread Walter Bright
On 4/16/2012 10:08 AM, H. S. Teoh wrote: On Mon, Apr 16, 2012 at 09:53:34AM -0700, Walter Bright wrote: On 4/16/2012 9:40 AM, Jacob Carlborg wrote: Regardless of how the runtime reflection is generated, by a library or the compiler, it needs to be available to all types. Why? (I can see the

Re: compiler support added for precise GC

2012-04-16 Thread Walter Bright
On 4/16/2012 11:02 AM, Sean Kelly wrote: On Apr 16, 2012, at 2:25 AM, Walter Bright wrote: It's never going to be easy for anyone to just write their own GC, especially one that works better than one a lot of people have spent a lot of time on. What I've been going for is to have all functiona

Re: compiler support added for precise GC

2012-04-16 Thread Walter Bright
On 4/16/2012 10:00 AM, deadalnix wrote: The point was that putting this into object.d isn't, IMO, the best option to provide such a mecanism. I don't know of a better way to do it, nor do I think it matters if it is in object.d or someothername.d.

Re: compiler support added for precise GC

2012-04-16 Thread Timon Gehr
On 04/16/2012 08:42 PM, Jacob Carlborg wrote: On 2012-04-16 18:53, Walter Bright wrote: On 4/16/2012 9:40 AM, Jacob Carlborg wrote: Regardless of how the runtime reflection is generated, by a library or the compiler, it needs to be available to all types. Why? (I can see the point for a dyna

Re: std.benchmark ready for review. Manager sought after

2012-04-16 Thread Lars T. Kyllingstad
On Sunday, 15 April 2012 at 16:23:32 UTC, Jens Mueller wrote: Andrei Alexandrescu wrote: There have been quite a few good comments, but no review manager offer. Could someone please take this role? I will do this. But I will need to get more familiar with the process. And add it to http://p

Re: Usage of Exceptions in std.xml

2012-04-16 Thread Rene Zwanenburg
On Sunday, 15 April 2012 at 15:31:52 UTC, Jesse Phillips wrote: On Sunday, 15 April 2012 at 14:43:37 UTC, Rene Zwanenburg wrote: I'm not sure, but it appears that std.xml uses exceptions for control flow. I use VisualD for development, and Visual Studio has been configured to break on exception

Re: std library hooks

2012-04-16 Thread Nick Sabalausky
"Artur Skawina" wrote in message news:mailman.1798.1334576115.4860.digitalmar...@puremagic.com... > > You do realize this is exactly how it is supposed to work? You *want* the > build to fail if the implementation you were overriding parts of has > changed. > Then you can evaluate the situation

Re: compiler support added for precise GC

2012-04-16 Thread Jacob Carlborg
On 2012-04-16 18:37, Alex Rønne Petersen wrote: The point is that without built-in runtime reflection, reflection is only available for select classes that the programmer specifically asks to have RTTI for. This is useless. It doesn't enable discovery-based reflection at all, which is what makes

Re: compiler support added for precise GC

2012-04-16 Thread Jacob Carlborg
On 2012-04-16 18:53, Walter Bright wrote: On 4/16/2012 9:40 AM, Jacob Carlborg wrote: Regardless of how the runtime reflection is generated, by a library or the compiler, it needs to be available to all types. Why? (I can see the point for a dynamic language, but not a static one.) The stan

Re: compiler support added for precise GC

2012-04-16 Thread Alex Rønne Petersen
On 16-04-2012 20:02, Sean Kelly wrote: On Apr 16, 2012, at 2:25 AM, Walter Bright wrote: On 4/16/2012 2:05 AM, deadalnix wrote: Having this template into object.d seems problematic to me. It is now quite hard to provide any custom GC implementation without messing with Druntime. Providing a u

Re: compiler support added for precise GC

2012-04-16 Thread Sean Kelly
On Apr 16, 2012, at 2:25 AM, Walter Bright wrote: > On 4/16/2012 2:05 AM, deadalnix wrote: >> Having this template into object.d seems problematic to me. It is now quite >> hard >> to provide any custom GC implementation without messing with Druntime. >> >> Providing a user created GC should be

Re: Orphan ranges

2012-04-16 Thread Jonathan M Davis
On Sunday, April 15, 2012 11:34:11 Andrei Alexandrescu wrote: > I'm making good progress on an allocator design. If things come together > as I hope, it'll kick some serious ass. > > I'm currently looking at four allocation models: > > * straight GC, safe (no deallocation) > * GC + the ability to

Re: std.benchmark ready for review. Manager sought after

2012-04-16 Thread Jonathan M Davis
On Sunday, April 15, 2012 13:41:28 Jacob Carlborg wrote: > On 2012-04-15 04:58, Andrei Alexandrescu wrote: > > There have been quite a few good comments, but no review manager offer. > > Could someone please take this role? > > > > Again, it would be great to get std.benchmark in sooner rather tha

Re: --inline

2012-04-16 Thread Timon Gehr
On 04/16/2012 03:33 PM, bearophile wrote: For interested people, there is a thread in D.learn that shows a missed inlining in DMD: http://forum.dlang.org/thread/alnkynbdyddtrwpmf...@forum.dlang.org (After that manual inlining the D code is slower still than the same C++ code). I think there w

Re: compiler support added for precise GC

2012-04-16 Thread H. S. Teoh
On Mon, Apr 16, 2012 at 09:53:34AM -0700, Walter Bright wrote: > On 4/16/2012 9:40 AM, Jacob Carlborg wrote: > >Regardless of how the runtime reflection is generated, by a library or the > >compiler, it needs to be available to all types. > > Why? > > (I can see the point for a dynamic language,

Re: compiler support added for precise GC

2012-04-16 Thread deadalnix
Le 16/04/2012 18:37, Walter Bright a écrit : On 4/16/2012 4:32 AM, deadalnix wrote: Le 16/04/2012 11:25, Walter Bright a écrit : On 4/16/2012 2:05 AM, deadalnix wrote: Having this template into object.d seems problematic to me. It is now quite hard to provide any custom GC implementation witho

Re: compiler support added for precise GC

2012-04-16 Thread Walter Bright
On 4/16/2012 9:40 AM, Jacob Carlborg wrote: Regardless of how the runtime reflection is generated, by a library or the compiler, it needs to be available to all types. Why? (I can see the point for a dynamic language, but not a static one.)

Re: D Compiler as a Library

2012-04-16 Thread Jacob Carlborg
On 2012-04-16 14:14, Bernard Helyer wrote: https://github.com/bhelyer/SDC/commit/2002ec27e8df9144f0d1051032abbfe24d2ad4d2 Go nuts. Awesome :) -- /Jacob Carlborg

Re: compiler support added for precise GC

2012-04-16 Thread CTFE-4-the-win
On Monday, 16 April 2012 at 11:30:52 UTC, deadalnix wrote: Le 16/04/2012 11:25, Walter Bright a écrit : As for data that has no pointers, something has to indicate that. Of course, another strategy is to allocate such data in separate pools. In fact, that might be an excellent idea, as such p

Re: compiler support added for precise GC

2012-04-16 Thread Jacob Carlborg
On 2012-04-16 13:34, deadalnix wrote: This is a lib issue. phobos should provide a standard way to do compiletime -> runtime reflection so each lib doesn't need to provide its own way every time. Regardless of how the runtime reflection is generated, by a library or the compiler, it needs to

Re: D scored well in the Google CodeJam Qualification Round

2012-04-16 Thread Kagamin
On Monday, 16 April 2012 at 13:31:32 UTC, Somedude wrote: Although there was very few D contestants (only 15 out of 18365 contestants used D), D scored number 1. http://go-hero.net/jam/?repost2012 http://www.go-hero.net/jam/12/name/Soultaker lol, COBOL

Re: compiler support added for precise GC

2012-04-16 Thread Alex Rønne Petersen
On 16-04-2012 13:34, deadalnix wrote: Le 16/04/2012 13:24, Jacob Carlborg a écrit : On 2012-04-16 11:00, Walter Bright wrote: On 4/16/2012 1:20 AM, Jacob Carlborg wrote: I thought it was a first step for runtime reflection. The thing about runtime reflection is you only need it for a few cla

Re: compiler support added for precise GC

2012-04-16 Thread Walter Bright
On 4/16/2012 4:32 AM, deadalnix wrote: Le 16/04/2012 11:25, Walter Bright a écrit : On 4/16/2012 2:05 AM, deadalnix wrote: Having this template into object.d seems problematic to me. It is now quite hard to provide any custom GC implementation without messing with Druntime. Providing a user cr

Re: compiler support added for precise GC

2012-04-16 Thread Alex Rønne Petersen
On 16-04-2012 18:32, Walter Bright wrote: On 4/15/2012 7:29 PM, Walter Bright wrote: I realized after I posted this that the patterns: ptr .. int .. ptr .. int ptr .. int .. ptr ptr .. int .. ptr .. int .. int are the same as far as marking goes, and so should all generate the same function/da

Re: compiler support added for precise GC

2012-04-16 Thread deadalnix
Le 16/04/2012 18:32, Walter Bright a écrit : On 4/15/2012 7:29 PM, Walter Bright wrote: I realized after I posted this that the patterns: ptr .. int .. ptr .. int ptr .. int .. ptr ptr .. int .. ptr .. int .. int are the same as far as marking goes, and so should all generate the same function

Re: compiler support added for precise GC

2012-04-16 Thread Walter Bright
On 4/15/2012 7:29 PM, Walter Bright wrote: I realized after I posted this that the patterns: ptr .. int .. ptr .. int ptr .. int .. ptr ptr .. int .. ptr .. int .. int are the same as far as marking goes, and so should all generate the same function/data. Another possibility is to just emit a

Re: D scored well in the Google CodeJam Qualification Round

2012-04-16 Thread bearophile
Steven Schveighoffer: I would caution however, from my past experience, that looking at how well one language does vs. another is extremely subjective -- really good coders can do really well no matter what language they use. But the "Hall of Mirrors"-large Haskell solution by tmoHaskell is

Re: D scored well in the Google CodeJam Qualification Round

2012-04-16 Thread Somedude
Le 16/04/2012 15:51, Steven Schveighoffer a écrit : > On Mon, 16 Apr 2012 09:31:34 -0400, Somedude > wrote: > >> Although there was very few D contestants (only 15 out of 18365 >> contestants used D), D scored number 1. >> >> http://go-hero.net/jam/?repost2012 >> >> It was only the qualification

Re: D scored well in the Google CodeJam Qualification Round

2012-04-16 Thread SomeDude
On Monday, 16 April 2012 at 14:02:21 UTC, bearophile wrote: Somedude: Although there was very few D contestants (only 15 out of 18365 contestants used D), D scored number 1. This is very good advertisement for D. A D user (group) has to reach a good score in the ICFP Programming Contest too

Re: Why is complex being deprecated again?

2012-04-16 Thread Stewart Gordon
On 16/04/2012 12:42, Lars T. Kyllingstad wrote: Do you feel the SETI Institute should have given up years ago? I don't really see the similarity between SETI and Phobos. They've been working for decades in the hope of finding aliens. In the same way, imaginary types have been put into D in

Re: D scored well in the Google CodeJam Qualification Round

2012-04-16 Thread bearophile
Somedude: Although there was very few D contestants (only 15 out of 18365 contestants used D), D scored number 1. This is very good advertisement for D. A D user (group) has to reach a good score in the ICFP Programming Contest too :-) And why is D so popular in Japan? :-) Bye, bearophile

Re: Why is complex being deprecated again?

2012-04-16 Thread Andrei Alexandrescu
On 4/16/12 4:21 AM, Don Clugston wrote: On 15/04/12 06:20, Andrei Alexandrescu wrote: On 4/14/12 10:10 PM, Mehrdad wrote: Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.html I don't think that page makes a compelling argument, but I'm not an expert. If

Re: D scored well in the Google CodeJam Qualification Round

2012-04-16 Thread mist
IMHO this is worth D.announce :)

Re: D scored well in the Google CodeJam Qualification Round

2012-04-16 Thread Steven Schveighoffer
On Mon, 16 Apr 2012 09:31:34 -0400, Somedude wrote: Although there was very few D contestants (only 15 out of 18365 contestants used D), D scored number 1. http://go-hero.net/jam/?repost2012 It was only the qualification round, and admittedly, 3 out of 4 problems were not extremely interest

Re: --inline

2012-04-16 Thread bearophile
For interested people, there is a thread in D.learn that shows a missed inlining in DMD: http://forum.dlang.org/thread/alnkynbdyddtrwpmf...@forum.dlang.org (After that manual inlining the D code is slower still than the same C++ code). I think @forceinline is not necessary here, a more aggres

D scored well in the Google CodeJam Qualification Round

2012-04-16 Thread Somedude
Although there was very few D contestants (only 15 out of 18365 contestants used D), D scored number 1. http://go-hero.net/jam/?repost2012 It was only the qualification round, and admittedly, 3 out of 4 problems were not extremely interesting. Still, congrats to hos.lyric, - whoever that is (Ken

Re: Cheaper compile-time tests

2012-04-16 Thread bearophile
Here a new matrixMul is instantiated for each size of the input matrices, but this avoids that: ... So something like this: import std.stdio; void foo(T, @generic size_t n, @generic size_t m)(const ref T[n][m] matrix) { foreach (ref row; matrix) for (int i = 0; i < n; i++)

Re: foreach and filter

2012-04-16 Thread Russel Winder
On Mon, 2012-04-16 at 14:58 +0200, Timon Gehr wrote: [...] > Have you filed a bug report against Phobos for this? Not as yet, after lunch 'twill be done. -- Russel. = Dr Russel Winder t: +44 20 7585 2200 voip: sip

Re: foreach and filter

2012-04-16 Thread Timon Gehr
On 04/16/2012 01:20 PM, Russel Winder wrote: On Wed, 2012-04-11 at 18:32 +0200, Jakob Ovrum wrote: [...] Ranges are iterated in-place. You can't mutate a const range, hence you cannot advance it by one (`popFront`), which is required by the lowering of foreach using the range interface. [...]

Re: compiler support added for precise GC

2012-04-16 Thread dsimcha
On 4/15/2012 10:24 PM, Walter Bright wrote: Just checked it in. Of course, it doesn't actually do precise GC, it is just thrown over the wall for the library devs who are itching to get started on it. Excellent!! Maybe I'll get started on this soon.

Re: Cheaper compile-time tests

2012-04-16 Thread bearophile
you end instantiating many times the same template, inflating the binary with little purpose (because you are not very interested in the optimizations performed on the compile-time-known values). I know you want a simple example: import std.stdio, std.string, std.conv, std.numeric, st

Re: D Compiler as a Library

2012-04-16 Thread Bernard Helyer
On Monday, 16 April 2012 at 06:37:00 UTC, Jacob Carlborg wrote: On 2012-04-16 04:35, Ary Manzana wrote: On 4/13/12 9:10 PM, deadalnix wrote: SDC have a lot of theses, and I proposed a similar stuff for its evolution. I think it is easier for SDC than it is for dmd considering the codebase of

Re: D Compiler as a Library

2012-04-16 Thread Bernard Helyer
On Monday, 16 April 2012 at 02:34:29 UTC, Ary Manzana wrote: On 4/13/12 9:10 PM, deadalnix wrote: Le 13/04/2012 11:58, Ary Manzana a écrit : Having a D compiler available as a library will (at least) give these benefits: 1. Can be used by an IDE: D is statically typed and so an IDE can benef

Re: compiler support added for precise GC

2012-04-16 Thread bearophile
Steven Schveighoffer: > I also suggest that you look into changing the way structs are allocated > if you haven't already. Right now, they are allocated by creating a new > array of size 1. While this is convenient in terms of avoiding a new > function, it means all struct allocations are

Cheaper compile-time tests

2012-04-16 Thread bearophile
This is from the office of not so useful things. If you try to fake dependent types in D you end instantiating many times the same template, inflating the binary with little purpose (because you are not very interested in the optimizations performed on the compile-time-known values). So to help

Re: compiler support added for precise GC

2012-04-16 Thread Steven Schveighoffer
On Sun, 15 Apr 2012 22:24:56 -0400, Walter Bright wrote: 6. I suggest the GCInfo pointer be stored at the end of the allocated block, as then it won't affect the alignment of the allocated data. This conflicts with the array runtime's use of the end of the block to store the block's 'use

Re: D Compiler as a Library

2012-04-16 Thread Bernard Helyer
On Monday, 16 April 2012 at 11:34:14 UTC, deadalnix wrote: Le 16/04/2012 09:00, Jakob Ovrum a écrit : On Monday, 16 April 2012 at 06:37:00 UTC, Jacob Carlborg wrote: On 2012-04-16 04:35, Ary Manzana wrote: On 4/13/12 9:10 PM, deadalnix wrote: SDC have a lot of theses, and I proposed a similar

Re: D Compiler as a Library

2012-04-16 Thread Bernard Helyer
On Monday, 16 April 2012 at 07:00:19 UTC, Jakob Ovrum wrote: On Monday, 16 April 2012 at 06:37:00 UTC, Jacob Carlborg wrote: On 2012-04-16 04:35, Ary Manzana wrote: On 4/13/12 9:10 PM, deadalnix wrote: SDC have a lot of theses, and I proposed a similar stuff for its evolution. I think it is ea

Re: Why is complex being deprecated again?

2012-04-16 Thread Lars T. Kyllingstad
On Monday, 16 April 2012 at 11:27:29 UTC, Stewart Gordon wrote: On 16/04/2012 07:06, Lars T. Kyllingstad wrote: For any standard type (built-in or library) to be useful, it has to actually be used for something. You mean someone has to use it in order to prove that it's usable and therefore

Re: Orphan ranges

2012-04-16 Thread Steven Schveighoffer
On Sun, 15 Apr 2012 12:34:11 -0400, Andrei Alexandrescu wrote: I'm making good progress on an allocator design. If things come together as I hope, it'll kick some serious ass. I'm currently looking at four allocation models: * straight GC, safe (no deallocation) * GC + the ability to free

Re: Why is complex being deprecated again?

2012-04-16 Thread Somedude
Le 16/04/2012 08:09, Lars T. Kyllingstad a écrit : > On 15/04/12 23:37, Caligo wrote: >> On Sun, Apr 15, 2012 at 4:09 PM, Lars T. Kyllingstad >> wrote: >>> If there is anything missing from the module, I will be >>> happy to add it. >>> >>> -Lars >> >> How about Quaternions? > > If such were t

Re: D Compiler as a Library

2012-04-16 Thread deadalnix
Le 16/04/2012 09:00, Jakob Ovrum a écrit : On Monday, 16 April 2012 at 06:37:00 UTC, Jacob Carlborg wrote: On 2012-04-16 04:35, Ary Manzana wrote: On 4/13/12 9:10 PM, deadalnix wrote: SDC have a lot of theses, and I proposed a similar stuff for its evolution. I think it is easier for SDC than

Re: compiler support added for precise GC

2012-04-16 Thread deadalnix
Le 16/04/2012 11:25, Walter Bright a écrit : On 4/16/2012 2:05 AM, deadalnix wrote: Having this template into object.d seems problematic to me. It is now quite hard to provide any custom GC implementation without messing with Druntime. Providing a user created GC should be as easy as possible.

Re: std library hooks

2012-04-16 Thread Artur Skawina
On 04/16/12 07:17, Nick Sabalausky wrote: > "Walter Bright" wrote in message > news:jmflrl$5ub$1...@digitalmars.com... >> On 4/15/2012 4:19 PM, Manu wrote: >>> On 16 April 2012 02:09, Walter Bright >> > wrote: >>> >>> On 4/15/2012 3:04 AM, Manu wrote: >>> >>

Re: compiler support added for precise GC

2012-04-16 Thread deadalnix
Le 16/04/2012 13:24, Jacob Carlborg a écrit : On 2012-04-16 11:00, Walter Bright wrote: On 4/16/2012 1:20 AM, Jacob Carlborg wrote: I thought it was a first step for runtime reflection. The thing about runtime reflection is you only need it for a few classes, while the compiler is doomed to g

Re: Problem with dmd2.059.zip

2012-04-16 Thread Somedude
Le 16/04/2012 12:01, Ed McCardell a écrit : > The versions of std.datetime and std.path in the 2.059 zip file don't > have the latest fixes that take care of switching from the deprecated > std.path.sep and undeprecating std.path.onOutOfMemoryError. > > Compiling this simple program: > > import

Re: compiler support added for precise GC

2012-04-16 Thread Jacob Carlborg
On 2012-04-16 11:00, Walter Bright wrote: On 4/16/2012 1:20 AM, Jacob Carlborg wrote: I thought it was a first step for runtime reflection. The thing about runtime reflection is you only need it for a few classes, while the compiler is doomed to generate the info for all of them. Andrei sugges

Re: Why is complex being deprecated again?

2012-04-16 Thread Stewart Gordon
On 16/04/2012 07:06, Lars T. Kyllingstad wrote: For any standard type (built-in or library) to be useful, it has to actually be used for something. You mean someone has to use it in order to prove that it's usable and therefore useful? Well, if a feature isn't usable, it's probably due to so

Re: foreach and filter

2012-04-16 Thread Russel Winder
On Wed, 2012-04-11 at 18:32 +0200, Jakob Ovrum wrote: [...] > Ranges are iterated in-place. You can't mutate a const range, > hence you cannot advance it by one (`popFront`), which is > required by the lowering of foreach using the range interface. [...] I think I am still trying to recover from

Re: HTTP4D embedded http provider

2012-04-16 Thread goughy
On Monday, 16 April 2012 at 07:46:11 UTC, Brad Anderson wrote: On Sun, Apr 15, 2012 at 6:27 AM, goughy wrote: Hi, I have just finished the first cut of an HTTP library to provide application level support for HTTP (ie as a server, not a client). The library provide a very simple mechanism

Problem with dmd2.059.zip

2012-04-16 Thread Ed McCardell
The versions of std.datetime and std.path in the 2.059 zip file don't have the latest fixes that take care of switching from the deprecated std.path.sep and undeprecating std.path.onOutOfMemoryError. Compiling this simple program: import std.datetime; void main() {} gives an error when u

Re: std library hooks

2012-04-16 Thread Martin Nowak
1) ld mylib.a aux.o main.o Works, main's version of 'mylibfunc' is picked up 2) ld aux.o mylib.a main.o Fails: ld complains that 'mylibfunc' is multiply defined Because mylibfunc is undefined when the archive is scanned, i.e. the linker picks up the archive function and the find

Re: compiler support added for precise GC

2012-04-16 Thread Walter Bright
On 4/16/2012 2:05 AM, deadalnix wrote: Having this template into object.d seems problematic to me. It is now quite hard to provide any custom GC implementation without messing with Druntime. Providing a user created GC should be as easy as possible. It's never going to be easy for anyone to ju

Re: Why is complex being deprecated again?

2012-04-16 Thread Don Clugston
On 15/04/12 06:20, Andrei Alexandrescu wrote: On 4/14/12 10:10 PM, Mehrdad wrote: Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.html I don't think that page makes a compelling argument, but I'm not an expert. If Walter and Don agree, I'd remove the pag

Re: compiler support added for precise GC

2012-04-16 Thread deadalnix
Le 16/04/2012 11:08, deadalnix a écrit : Le 16/04/2012 09:09, Walter Bright a écrit : 4. GCInfo seems to be a better design. This is unrelated. In fact, GCInfo could use getMembers . Precise GC and reflection are brother. Never mind, I thought you were talking about __traits, but you are

Re: Language Subsets

2012-04-16 Thread Klaim - Joël Lamotte
On Mon, Apr 16, 2012 at 17:53, deadalnix wrote: > > @safe only allow operation that cannot screw up your memory. @system is > the complete language. > > @trusted is an explicit qualifie, to allow @safe code to call @system > code. It is mandatory, for instance, for @safe code to call the GC (GC c

Re: compiler support added for precise GC

2012-04-16 Thread deadalnix
Le 16/04/2012 09:09, Walter Bright a écrit : 4. GCInfo seems to be a better design. This is unrelated. In fact, GCInfo could use getMembers . Precise GC and reflection are brother.

Re: compiler support added for precise GC

2012-04-16 Thread deadalnix
Le 16/04/2012 04:24, Walter Bright a écrit : Just checked it in. Of course, it doesn't actually do precise GC, it is just thrown over the wall for the library devs who are itching to get started on it. I added a getGCInfo() method to TypeInfo that returns an immutable(void)*. This pointer can be

Re: compiler support added for precise GC

2012-04-16 Thread Walter Bright
On 4/16/2012 1:20 AM, Jacob Carlborg wrote: I thought it was a first step for runtime reflection. The thing about runtime reflection is you only need it for a few classes, while the compiler is doomed to generate the info for all of them. Andrei suggested a better design, which was to use com

Re: Orphan ranges

2012-04-16 Thread Dmitry Olshansky
On 15.04.2012 20:34, Andrei Alexandrescu wrote: I'm making good progress on an allocator design. If things come together as I hope, it'll kick some serious ass. I'm currently looking at four allocation models: * straight GC, safe (no deallocation) * GC + the ability to free memory * malloc/free

  1   2   >