Re: rdmd and popen

2009-01-19 Thread Max Samukha
On Sat, 17 Jan 2009 12:57:24 -0800, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Max Samukha wrote: On Sat, 17 Jan 2009 09:19:38 -0800, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Max Samukha wrote: On Sat, 17 Jan 2009 16:09:43 +0200, Max Samukha

Re: DWT Cocoa 3.5 M3

2009-01-19 Thread Jacob Carlborg
John Reimer wrote: Hello Jacob, I thought that I would share my progress on the dwt cocoa port. I've ported all the SWT code, including the Browser package from dwt linux. The code is based on SWT just before milestone 3, to be exact 3.514.0. There are still problems with the port, runtime

Re: Descent 0.5.3 released

2009-01-19 Thread Ary Borenszweig
Trass3r wrote: Ary Borenszweig schrieb: And a question: what would you like to see next in Descent? #1: the preprocessed-source output discussed in the learn newsgroup! (...output a copy of what the source files look like after things like mixins, CTFE and versions are applied? (Sort of

Fan language

2009-01-19 Thread bearophile
Fan is a cute language for virtual machines, that can be used like Boo but has a Java-like syntax: http://www.fandev.org/doc/docIntro/StartHere.html It has both static and dynamic typing, and it's generally designed to be handy, and not dumb as Java, see for example the list type:

Re: Ada Vs C (with some D mixed in)

2009-01-19 Thread Walter Bright
bearophile wrote: Just for example, Safe D may enforce a safer indenting of code, to avoid the dangling else bug (it seems I was quite right, and GCC designers have had the same idea of mine, take a look at recently added warnings of GCC, -Wparentheses and -Wsequence-point here,

Re: Pluggable type sytems

2009-01-19 Thread Michel Fortin
On 2009-01-18 21:29:02 -0500, bearophile bearophileh...@lycos.com said: I think pluggable type systems will become more common in the following years (see also the optional annotations of Python3 that are designed for that too). This is more or less related:

Re: Ada Vs C (with some D mixed in)

2009-01-19 Thread bearophile
Walter Bright: SafeD is about guaranteeing memory safety, not other issues like integer overflows. Memory safety is a fairly specifically defined thing. Then maybe the name of SafeD isn't too much good, because when I hear that name I think about a safe(r) language, and not about memory

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Sergey Gromov
Mon, 19 Jan 2009 09:47:14 +0900, Bill Baxter wrote: On Mon, Jan 19, 2009 at 9:16 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Unless it's a class you mean? Yah, ranges are meant to have value semantics. If you have a class container exposing ranges, define the range

Re: DWT+OpenGL crashing on Vista

2009-01-19 Thread Sergey Gromov
Mon, 19 Jan 2009 10:20:51 +0900, Bill Baxter wrote: On Mon, Jan 19, 2009 at 8:53 AM, Sergey Gromov snake.sc...@gmail.com wrote: Mon, 19 Jan 2009 07:17:16 +0900, Bill Baxter wrote: Here's a modified version of one of the DWT opengl snippets that reproduces the crash for me. About 1 in 10-15

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Andrei Alexandrescu
John Reimer wrote: Hello Christopher, Walter Bright wrote: Yigal Chripun wrote: Walter Bright wrote: Lars Ivar Igesund wrote: toe() ?! tail() good, rear() not so good, toe() sucks. tail() is no good because it has a well-established meaning in programming of being everything but the

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Steven Schveighoffer
Jason House wrote Andrei Alexandrescu wrote: I'd be curious to find out more about a runtime queryable struct interface. How would it work? What idioms would it enable? I don't know what Lars is thinking of, but I think of struct interfaces as a non-polymorphic / compile-time inheritance.

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Steven Schveighoffer
Andrei Alexandrescu wrote It's been there for a while now (since 25 Nov 2008). http://www.digitalmars.com/d/2.0/statement.html#ForeachStatement Strange that I never noticed that. I remember when 2.022 came out, I did not see it there, but I guess I could have overlooked it. It definitely

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Steven Schveighoffer
Andrei Alexandrescu wrote Bill Baxter wrote: On Mon, Jan 19, 2009 at 9:16 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Unless it's a class you mean? Yah, ranges are meant to have value semantics. If you have a class container exposing ranges, define the range separately

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: Andrei Alexandrescu wrote It's been there for a while now (since 25 Nov 2008). http://www.digitalmars.com/d/2.0/statement.html#ForeachStatement Strange that I never noticed that. I remember when 2.022 came out, I did not see it there, but I guess I could have

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Andrei Alexandrescu
Daniel Keep wrote: Don wrote: [snip] And in fact, a Tango2 floor plan would be a good idea, too. For example, now that D2 supports foreach ranges, Tango containers will almost certainly want to support them. For reference, from tango.util.collection.model.Iterator: public interface

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Andrei Alexandrescu
dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Depends on how you define fancy. If fancy includes composable, opApply isn't that. Andrei Can you give an example of composable ranges, because I'm not sure exactly what you mean or how it works.

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Steven Schveighoffer
Piotrek wrote Hello! It's just an idea. After reading about issues on disallowing DWT to stay in standardization area (Anomaly on Wiki4D GuiLibraries page) some question appeared in my mind. For propaganda sake isn't it better to not make such a big division between phobos and tango in

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: Andrei Alexandrescu wrote Bill Baxter wrote: On Mon, Jan 19, 2009 at 9:16 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Unless it's a class you mean? Yah, ranges are meant to have value semantics. If you have a class container exposing ranges,

Re: Ada Vs C (with some D mixed in)

2009-01-19 Thread Lutger
bearophile wrote: Walter Bright: SafeD is about guaranteeing memory safety, not other issues like integer overflows. Memory safety is a fairly specifically defined thing. Then maybe the name of SafeD isn't too much good, because when I hear that name I think about a safe(r) language, and

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Jason House
Walter Bright wrote: Druntime is there, and it's up to the Tango team now. As I understand it, the biggest fear of the Tango team is to make an official D2 version and then have to chase after a moving standard. If an official port of Tango 0.99.7 was ported to work with dmd v2.023 how

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Jason House
Andrei Alexandrescu wrote: Speed is a small part of the equation, in fact a perk only. Ranges are composable; you can combine them to e.g. do parallel iteration over two ranges. Ranges really open std.algorithm to all data structures. I find opApply incredibly obtuse and fostering bad design.

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Andrei Alexandrescu
Jason House wrote: Andrei Alexandrescu wrote: Speed is a small part of the equation, in fact a perk only. Ranges are composable; you can combine them to e.g. do parallel iteration over two ranges. Ranges really open std.algorithm to all data structures. I find opApply incredibly obtuse and

Can we get rid of opApply?

2009-01-19 Thread Steven Schveighoffer
When looking at ranges, it seems like a much better model for iteration than opApply. It seems like it could be a whole replacement for opApply. But when looking at the current usage of opApply, there are some holes. foreach(i, x; range) { } What exactly happens? Do you have to return a

Re: TempAlloc and druntime GC

2009-01-19 Thread Sean Kelly
== Quote from dsimcha (dsim...@yahoo.com)'s article I've been thinking about how to deal with this issue and make TempAlloc safe enough for inclusion in the standard library. Since it works by allocating large (currently 4 MB) regions from the C heap, and then sub-allocating these regions to

Re: Can we get rid of opApply?

2009-01-19 Thread Steven Schveighoffer
Steven Schveighoffer wrote // foo translates to: foo(R r) { for(auto __r = r; !__r.empty(); __r.next()) { auto x = __r.head(); } for(auto __r = r; !__r.empty(); __r.next()) { int i, x; // compiler figures out from signature of head() __r.head(i, x); }

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Jason House
Andrei Alexandrescu wrote: Jason House wrote: Andrei Alexandrescu wrote: Speed is a small part of the equation, in fact a perk only. Ranges are composable; you can combine them to e.g. do parallel iteration over two ranges. Ranges really open std.algorithm to all data structures. I find

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread dsimcha
== Quote from Jason House (jason.james.ho...@gmail.com)'s article Andrei Alexandrescu wrote: Jason House wrote: Andrei Alexandrescu wrote: Speed is a small part of the equation, in fact a perk only. Ranges are composable; you can combine them to e.g. do parallel iteration over two

Re: TempAlloc and druntime GC

2009-01-19 Thread Sean Kelly
== Quote from dsimcha (dsim...@yahoo.com)'s article == Quote from Sean Kelly (s...@invisibleduck.org)'s article == Quote from dsimcha (dsim...@yahoo.com)'s article I've been thinking about how to deal with this issue and make TempAlloc safe enough for inclusion in the standard

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Rainer Deyke
aarti_pl wrote: first - last advance - retreat My preference: head - rhead next - rnext (or advance - radvance) The purpose of retreat and toe is to allow reverse iteration. retreat in not the opposite of advance/next, it's the same operation applied to the other end of the range. So why

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Sergey Gromov
Mon, 19 Jan 2009 06:15:06 -0800, Andrei Alexandrescu wrote: Michel Fortin wrote: Other possible things involves a rudimentary profiler (checking for the elapsed time at each loop iteration), or a progress monitoring template (notifying another thread of the progress of a particular task).

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Christopher Wright
Jason House wrote: void iterateOverArray(T)(T[] arr){ foreach (i; 0..arr.length) yield(arr[i]); } Coroutines are the slowest option, but the easiest to write. It takes 32 instructions or so to switch to or from a coroutine on x86. I'm not sure how that translates in terms of memory

Re: Can we get rid of opApply?

2009-01-19 Thread Daniel Keep
Andrei Alexandrescu wrote: Steven Schveighoffer wrote: When looking at ranges, it seems like a much better model for iteration than opApply. It seems like it could be a whole replacement for opApply. But when looking at the current usage of opApply, there are some holes. foreach(i, x;

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread bearophile
Andrei Alexandrescu: I know. Its popularity is part of what makes it dangerous. It's to good programming what fast food is to food :o). I think that's a false analogy: fast food kills you slowly, while experience shows me that in many programs a significant (large) percentage of lines of

Re: dsource considered harmful

2009-01-19 Thread Clay Smith
Martin Carney wrote: Visiting dsource I'm disappointed by the large number of half-finished and not-started projects on the projects page. I pick on interesting project and look at the source tree - no files or years out of date. I think the unfinished, out-of-date and not-started projects

Re: Ada Vs C (with some D mixed in)

2009-01-19 Thread bearophile
Walter Bright: Lutger wrote: I've always understood the 'safety' here as safe from buffer overflow exloits and such, instead of safety against bugs in general. (security). Exactly. http://en.wikipedia.org/wiki/Memory_safety OK, I'll wait for the coming of SecureD then :-) Bye,

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread bearophile
Sean Kelly: This assumes that the easy approach is slow and the fast approach is complex. I'd hope that we could find something that's both easy and fast :-) I agree that certain times it's possible to have something that is both simple, safe, short and fast (but if that yield can be used

Re: Can we get rid of opApply?

2009-01-19 Thread Andrei Alexandrescu
Chad J wrote: Steven Schveighoffer wrote: Andrei Alexandrescu wrote= Yes, I'm afraid type deduction will be harmed with ranges. BAD BAD BAD! I love being able to do type deduction in foreach... Not having that would be a real hard pill to swallow... I'm going to have to butt in and

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread John Reimer
Hello Steven, Piotrek wrote Hello! It's just an idea. After reading about issues on disallowing DWT to stay in standardization area (Anomaly on Wiki4D GuiLibraries page) some question appeared in my mind. For propaganda sake isn't it better to not make such a big division between phobos and

Re: TempAlloc and druntime GC

2009-01-19 Thread dsimcha
== Quote from dsimcha (dsim...@yahoo.com)'s article One more note: It would also be greatly appreciated if you would expose a version of GC.malloc that returns null on failure instead of throwing an exception. For performance, TempAlloc treats out of memory as non-recoverable. This is

Re: Can we get rid of opApply?

2009-01-19 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: Andrei Alexandrescu wrote Steven Schveighoffer wrote: When looking at ranges, it seems like a much better model for iteration than opApply. It seems like it could be a whole replacement for opApply. But when looking at the current usage of opApply, there are some

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Don
Steven Schveighoffer wrote: Let's not forget the licensing issues. Tango is incompatible with some developers license wise, as you must include attribution for Tango in any derivative works (i.e. compiled binaries). Are you sure? Where is that written down? I can't find that anywhere in

Re: Any chance to call Tango as Extended Standard Library

2009-01-19 Thread Walter Bright
Jason House wrote: Walter Bright wrote: Druntime is there, and it's up to the Tango team now. As I understand it, the biggest fear of the Tango team is to make an official D2 version and then have to chase after a moving standard. If an official port of Tango 0.99.7 was ported to work with

time measurement under linux?

2009-01-19 Thread Trass3r
I wrote a module to ease time measurement in my projects. Does anyone know how to get elapsed milli- or nanoseconds under linux? Want to make it portable :) module time; version(Windows) import std.c.windows.windows; long frequency; /// frequency of the high

Re: loop through specific class members

2009-01-19 Thread Daniel Keep
Trass3r wrote: Is there any way to loop through specific members of a class, e.g. all public functions? I've already seen a function getMembers in druntime's ClassInfo class but I can't find anything related to the attributes there. Assuming you're using D2,

Re: time measurement under linux?

2009-01-19 Thread Daniel Keep
Trass3r wrote: I wrote a module to ease time measurement in my projects. Does anyone know how to get elapsed milli- or nanoseconds under linux? Want to make it portable :) [snip] Check std.perf; it's documented, but sadly doesn't show up in the docs. -- Daniel

Re: loop through specific class members

2009-01-19 Thread Trass3r
Daniel Keep schrieb: Assuming you're using D2, http://digitalmars.com/d/2.0/traits.html might prove to be of interest. -- Daniel It is indeed of interest though being not exactly what I want. Seems like there's currently no way to get attributes like public etc. But I think an acceptable

Re: loop through specific class members

2009-01-19 Thread Lutger
Trass3r wrote: Daniel Keep schrieb: Assuming you're using D2, http://digitalmars.com/d/2.0/traits.html might prove to be of interest. -- Daniel It is indeed of interest though being not exactly what I want. Seems like there's currently no way to get attributes like public etc. But

Re: IndexExpression

2009-01-19 Thread Jarrett Billingsley
On Mon, Jan 19, 2009 at 12:57 PM, Ellery Newcomer ellery-newco...@utulsa.edu wrote: IndexExpression: PostfixExpression [ ArgumentList ] The only place I can think of ArgumentList containing more than one element is in some sort of overloaded operator case. You're precisely right.

Re: Delegate contravariance

2009-01-19 Thread Jason House
Silvio Ricardo Cordeiro wrote: Is there any good reason why the following code doesn't work? The function foo requires as its argument a delegate that receives a B. This means that, because of the type soundness of the D language, the delegate will only be called with instances of B. Now,

Re: druntime

2009-01-19 Thread Jason House
Steven Schveighoffer wrote: Hoenir wrote So why don't they port tango to that D1 version of druntime? What is the need? I can only think of one reason: When porting Tango to D2, it'll be one less thing to do.

Re: base class access specifier[s]

2009-01-19 Thread BCS
Reply to Ellery, I don't buy that. Not that I'm a C guru or anything, but it looks to me that Parser::BaseClasses could be easily edited to make the point in question go away. it's not a parser thing but a grammar thing. It would be complex to define a grammar that allows one each of the

Re: time measurement under linux?

2009-01-19 Thread Bill Baxter
On Tue, Jan 20, 2009 at 2:19 AM, Trass3r mrmoc...@gmx.de wrote: Daniel Keep schrieb: Check std.perf; it's documented, but sadly doesn't show up in the docs. -- Daniel Cool, is similar to my design. Though GetTickCount64 could be added. That's odd. I made some updates to std.perf a while

Re: loop through specific class members

2009-01-19 Thread BCS
Reply to Lutger, Another possible hack: if used from a different module, you could use the 'compiles' trait with allMembers to find out if a member can be accessed. you could define a template in another module that does the check and returns the result.

Re: time measurement under linux?

2009-01-19 Thread Jarrett Billingsley
On Mon, Jan 19, 2009 at 1:46 PM, Jason House jason.james.ho...@gmail.com wrote: Trass3r wrote: I wrote a module to ease time measurement in my projects. Does anyone know how to get elapsed milli- or nanoseconds under linux? Want to make it portable :) The difficulty of doing platform

Re: loop through specific class members

2009-01-19 Thread Trass3r
BCS schrieb: Reply to Lutger, Another possible hack: if used from a different module, you could use the 'compiles' trait with allMembers to find out if a member can be accessed. you could define a template in another module that does the check and returns the result. Well, it'd indeed

Re: time measurement under linux?

2009-01-19 Thread Bill Baxter
On Tue, Jan 20, 2009 at 4:47 AM, Jarrett Billingsley jarrett.billings...@gmail.com wrote: On Mon, Jan 19, 2009 at 1:46 PM, Jason House jason.james.ho...@gmail.com wrote: Trass3r wrote: I wrote a module to ease time measurement in my projects. Does anyone know how to get elapsed milli- or

Re: time measurement under linux?

2009-01-19 Thread Trass3r
Jarrett Billingsley schrieb: On Mon, Jan 19, 2009 at 10:41 AM, Daniel Keep daniel.keep.li...@gmail.com wrote: Trass3r wrote: I wrote a module to ease time measurement in my projects. Does anyone know how to get elapsed milli- or nanoseconds under linux? Want to make it portable :) [snip]

Re: loop through specific class members

2009-01-19 Thread BCS
Reply to Daniel, It depends on what exactly you're trying to do. Some time ago, I wrote a library that created XML loaders for structs, and it needed to know the names of fields. Pre-traits, this is what I used: struct Stuff { int foo; char[] bar; alias Tuple!(foo, bar) _fields; } Then I

Re: time measurement under linux?

2009-01-19 Thread Bill Baxter
On Tue, Jan 20, 2009 at 6:04 AM, Trass3r mrmoc...@gmx.de wrote: Jarrett Billingsley schrieb: On Mon, Jan 19, 2009 at 10:41 AM, Daniel Keep daniel.keep.li...@gmail.com wrote: Trass3r wrote: I wrote a module to ease time measurement in my projects. Does anyone know how to get elapsed milli-

Re: array initialization problem

2009-01-19 Thread Rainer Deyke
Denis Koroskin wrote: Arrays in D are reference types. Besides, it's best to avoid hidden allocations. Arrays in D are reference types except when they're not. int[] a = [5]; int[] b = a; a[0] = 4; assert(b[0] == 4); a.length = 2; assert(b.length == 1); a[0] = 3; // Is b[0] 3 or 4? --

Re: loop through specific class members

2009-01-19 Thread Trass3r
Daniel Keep schrieb: Another possible hack: if used from a different module, you could use the 'compiles' trait with allMembers to find out if a member can be accessed. you could define a template in another module that does the check and returns the result. Well, it'd indeed be used from a

Re: Delegate contravariance

2009-01-19 Thread Christopher Wright
Jason House wrote: Silvio Ricardo Cordeiro wrote: Is there any good reason why the following code doesn't work? The function foo requires as its argument a delegate that receives a B. This means that, because of the type soundness of the D language, the delegate will only be called with

Re: loop through specific class members

2009-01-19 Thread Daniel Keep
BCS wrote: Reply to Daniel, It depends on what exactly you're trying to do. Some time ago, I wrote a library that created XML loaders for structs, and it needed to know the names of fields. Pre-traits, this is what I used: struct Stuff { int foo; char[] bar; alias Tuple!(foo,

Re: base class access specifier[s]

2009-01-19 Thread Ellery Newcomer
BCS wrote: Reply to Ellery, I don't buy that. Not that I'm a C guru or anything, but it looks to me that Parser::BaseClasses could be easily edited to make the point in question go away. it's not a parser thing but a grammar thing. It would be complex to define a grammar that allows one

Re: base class access specifier[s]

2009-01-19 Thread BCS
Reply to Ellery, BCS wrote: Reply to Ellery, I don't buy that. Not that I'm a C guru or anything, but it looks to me that Parser::BaseClasses could be easily edited to make the point in question go away. it's not a parser thing but a grammar thing. It would be complex to define a grammar

Re: base class access specifier[s]

2009-01-19 Thread BCS
Reply to Ellery, I don't buy that either. The subject was access specifiers for base classes, not storage classes for declarations or access specifiers for statements. In those cases I would grant your point, but a base class has precisely one access specifier and no storage classes. It would

[Issue 2593] New: Overriding interface functions in final classes fails

2009-01-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2593 Summary: Overriding interface functions in final classes fails Product: D Version: 2.023 Platform: PC OS/Version: Windows Status: NEW Keywords: rejects-valid

[Issue 2594] New: Const/immutable should not matter for value types in IFTI

2009-01-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2594 Summary: Const/immutable should not matter for value types in IFTI Product: D Version: 2.023 Platform: PC OS/Version: Windows Status: NEW Keywords:

[Issue 2524] final override inconsistent when implementing interfaces

2009-01-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2524 schvei...@yahoo.com changed: What|Removed |Added CC||samu...@voliacable.com ---

[Issue 2593] Overriding interface functions in final classes fails

2009-01-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2593 --- Comment #2 from samu...@voliacable.com 2009-01-19 11:58 --- Yeh, it's the same. I overlooked your report. --