Re: Descent 0.5.4 released

2009-01-27 Thread Frits van Bommel
Saaa wrote: How do you generate the compile-time view? Since Descent has a Java port of the DMD frontend inside, it probably just runs the semantics passes on the AST and prints it back out...

Re: QtD 0.1 is out!

2009-03-01 Thread Frits van Bommel
Walter Bright wrote: Frits van Bommel wrote: Walter Bright wrote: The problem if it detects it in an implementation-defined manner is the source code is no longer portable. ... If the result of compilation provably won't *run* anyway, what's the problem with a compile-time error? Nothing

Re: Just one more thing...

2009-03-01 Thread Frits van Bommel
Sean Kelly wrote: Daniel Keep wrote: extern(C) void __identifier(blah$UNIX2003)(int); That would be awesome. A beneficial side-effect is that I can finally get rid of all those mixins that are just doing this: mixin(`void `~name_of_fn~`(int a) { // ... rest of function ... }`); I had

Re: Open source dmd on Reddit!

2009-03-06 Thread Frits van Bommel
Georg Wrede wrote: Denis Koroskin wrote: On Fri, 06 Mar 2009 08:51:57 +0300, Walter Bright newshou...@digitalmars.com wrote: [snip] The ones I listen to are the ones who *are* using D and have some sweat equity in it. http://www.micropoll.com/akira/mpresult/539369-138652 Bipolar folks

Re: dmd 1.043 alpha for FreeBSD 7.1

2009-04-16 Thread Frits van Bommel
Walter Bright wrote: Anders Bergh wrote: You could probably make dmd run on some GNU/Darwin, but it's sort of dead. There's http://www.puredarwin.org/ but I'm not sure if it actually works yet. The iPhone is an ARM platform so dmd would certainly not work there... If dmd/phobos binaries for

Re: DCat - a compact web application server in D.

2009-04-20 Thread Frits van Bommel
Michel Fortin wrote: On 2009-04-20 00:38:48 -0400, Steve Teale steve.te...@britseyeview.com said: Michel Fortin Wrote: What's the license? Hmm, forgot about that stuff, BSD maybe - suggest one please. By looking at the code, I've found a license. Not sure which license it is (looks a

Re: dmd 2.029 release

2009-04-21 Thread Frits van Bommel
Lars T. Kyllingstad wrote: Walter Bright wrote: This is a major revision to Phobos, including Andrei's revolutionary new range support. http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.029.zip This is looking very nice! I want to switch from D1 to D2,

Re: dmd 2.029 release

2009-04-21 Thread Frits van Bommel
Daniel Keep wrote: Lars T. Kyllingstad wrote: Walter Bright wrote: This is a major revision to Phobos, including Andrei's revolutionary new range support. http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.029.zip This is looking very nice! I want to switch

Re: dmd 2.029 release

2009-04-23 Thread Frits van Bommel
Denis Koroskin wrote: On Thu, 23 Apr 2009 16:20:03 +0400, Don nos...@nospam.com wrote: struct Foo(A, B, C){ A[10] a; B b; C c; void toString(Sink sink){ foreach(x; a) sink(x); sink(b); sink(c); } } ... but it's not, you have to create a silly buffer to put all your strings in,

Re: dmd 2.029 release

2009-04-23 Thread Frits van Bommel
Andrei Alexandrescu wrote: Frits van Bommel wrote: IMHO It'd be pretty nice for the standard formatting systems (both the Tango and Phobos ones) to just call a standard Object method taking (Sink sink, char[] format = null) on objects. Probably we'll need that. You forgot the in though :o

Re: ldc 0.9.1 released

2009-05-27 Thread Frits van Bommel
Robert Clipsham wrote: Andrei Alexandrescu wrote: Great! Quick question - are you supporting or considering supporting D2? I looked on the project's home page and couldn't find that information. There's mention of druntime for D2 which makes me hopeful. Thanks, Andrei D2 support in LDC

Re: ldc 0.9.1 released

2009-05-27 Thread Frits van Bommel
bearophile wrote: Christian Kamm: The release 0.9.1 of LDC, the LLVM based compiler for the D programming language, contains the following major improvements: Very good. I'll try this too. * turn GC allocations to allocas if possible Phobos1 of DMD too has alloca, so can this

Re: ldc 0.9.1 released

2009-05-27 Thread Frits van Bommel
bearophile wrote: Frits van Bommel: Thank you for your answers. This one is only done for certain GC allocations by the way, not all of them. The ones currently implemented are: * new Struct/int/float/etc., * uninitialized arrays (used for arr1 ~ arr2, for instance), * zero-initialized

Re: ldc 0.9.1 released

2009-05-27 Thread Frits van Bommel
bearophile wrote: While this code: typedef int Int2 = 2; auto a = cast(int[])(new Int2[1000]); Produces: pushl %esi subl$8, %esp movl$1000, 4(%esp) movl$_D20TypeInfo_ATmain4Int26__initZ, (%esp) xorl%esi, %esi call

Re: enumerating member offsetofs via foreach over members-tuple

2008-11-14 Thread Frits van Bommel
Denis Koroskin wrote: Am I doing something wrong? As was mentioned, 'm' is just a local variable once inside the loop. This works though: - foreach (i, m; this.tupleof) { writefln(this.tupleof[i].offsetof); } -

Re: Forward declarations of template specilizations.

2008-11-16 Thread Frits van Bommel
Ryan Bloomfield wrote: According to http://www.digitalmars.com/d/1.0/templates-revisited.html(under Template Parameters) a template can be passed as a template argument. How does one do that? The compiler (gdc) give an error when I try to pass a template like a type(complains it isn't a

Re: Things that may be removed

2008-12-25 Thread Frits van Bommel
Jarrett Billingsley wrote: On Wed, Dec 24, 2008 at 5:24 PM, Yigal Chripun yigal...@gmail.com wrote: why not replace the current comma operator with tuple support? the comma op needs to be higher than assingment in precedence and instead of evaluating the expressions left to right and returning

Re: dmd platform support - poll

2008-12-27 Thread Frits van Bommel
Walter Bright wrote: What platforms for dmd would you be most interested in using? Linux 64 bit.

Re: Operator overloading -- lets collect some use cases

2008-12-30 Thread Frits van Bommel
Bill Baxter wrote: Merging might be useful there too --- A ~= b ~ c ~ d is probably more efficiently implemented as 3 ~= ops. Actually, it's probably most efficiently implemented as 1 ~= with multiple parameters. (DMD already does this for arrays)

Re: Operator overloading -- lets collect some use cases

2008-12-30 Thread Frits van Bommel
Don wrote: A straightforward first step would be to state in the spec that the compiler is entitled to assume that X+=Y yields the same result as X=X+Y That doesn't hold for reference types, does it? So perhaps this should only be the case for structs? (Shouldn't make much difference, I think

Re: Operator overloading -- lets collect some use cases

2008-12-30 Thread Frits van Bommel
Denis Koroskin wrote: On Tue, 30 Dec 2008 17:30:13 +0300, Frits van Bommel fvbom...@remwovexcapss.nl wrote: Bill Baxter wrote: Merging might be useful there too --- A ~= b ~ c ~ d is probably more efficiently implemented as 3 ~= ops. Actually, it's probably most efficiently implemented

Re: Operator overloading -- lets collect some use cases

2008-12-30 Thread Frits van Bommel
Don wrote: Frits van Bommel wrote: Don wrote: A straightforward first step would be to state in the spec that the compiler is entitled to assume that X+=Y yields the same result as X=X+Y That doesn't hold for reference types, does it? I thought it does? Got any counter examples? For any

Re: Operator overloading -- lets collect some use cases

2008-12-31 Thread Frits van Bommel
Don wrote: Andrei Alexandrescu wrote: Well I forgot whether BigInt is a class, is it? Anyhow, suppose it *is* a class and as such has reference semantics. Then a += b modifies an object in-situ, whereas a = a + b creates a whole new object and happens to bind a to that new object. You're

Re: Glibc hell

2009-01-21 Thread Frits van Bommel
dsimcha wrote: Apparently, DMD for Linux requires a non-ancient version of Glibc to work, and worse yet, all the stuff compiled by it requires a similarly non-ancient version. The problem is that I'm trying to run some jobs on a cluster that has an ancient version of Linux that my sysadmin

Re: Any chance to call Tango as Extended Standard Library

2009-01-22 Thread Frits van Bommel
Don wrote: Andrei Alexandrescu wrote: Don wrote: Can we work out the math stuff at least? There's no difference between Phobos and Tango there. All we need is an agreement on common module naming (eg, create core.math). That would be great. I don't think that's a major issue anyway. If I

Re: Could we get a LP64 version identifier?

2009-01-25 Thread Frits van Bommel
Jacob Carlborg wrote: Could we get a LP64 version identifier? I know that you can use this code: static if ((void*).sizeof int.sizeof) Shouldn't that be static if ((void*).sizeof == long.sizeof) or just static if ((void*).sizeof == 8)? (Note that in D long.sizeof is guaranteed to be 8) to

Re: Could we get a LP64 version identifier?

2009-01-26 Thread Frits van Bommel
Jacob Carlborg wrote: Walter Bright wrote: Jacob Carlborg wrote: Could we get a LP64 version identifier? I know that you can use this code: static if ((void*).sizeof int.sizeof) to do the same but that's not particular clear that the programmer wants to check for LP64. If so, I hope we

Re: Could we get a LP64 version identifier?

2009-01-27 Thread Frits van Bommel
Walter Bright wrote: Frits van Bommel wrote: Some testing shows that all DMD-frontend based compilers (i.e. DMD, GDC and LDC) seem to produce that error message for any version identifier starting with D_ (Including D_ itself). The point of that is to ensure that the D_ name space

Re: Could we get a LP64 version identifier?

2009-01-27 Thread Frits van Bommel
bearophile wrote: Walter Bright: Frits van Bommel: [1]: Hey, x86 technically has 6-byte pointers if you count segments as part of the pointer (which would be mostly useless on currently popular operating systems though). It does, but I know of no compiler that supports that (C, C++, or any

Re: ch-ch-update: series, closed-form series, and strides

2009-01-31 Thread Frits van Bommel
Michel Fortin wrote: On 2009-01-31 19:26:08 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org said: So I think in the future it's a good bet for both programmers and editors to consider q{} quotes as containing code. Hum, but since it's a string, shouldn't text editors highlight it

Re: Inline assembler in D and LDC, round 2

2009-02-05 Thread Frits van Bommel
Walter Bright wrote: Frits van Bommel wrote: Is it really that hard? Can't you just detect this case (non-void function without a 'return' at the end but with inline asm inside)? Since the compiler should know the calling convention[1], the register that will contain the return value

Re: Inline assembler in D and LDC, round 2

2009-02-06 Thread Frits van Bommel
Lionello Lunesu wrote: Frits van Bommel fvbom...@remwovexcapss.nl wrote in message news:gmeqbr$137...@digitalmars.com... LDC on the other hand needs to emit LLVM asm, which requires it to specify an explicit return value. My approach is a way to extract that return value from the inline asm

Re: Inline assembler in D and LDC, round 2

2009-02-06 Thread Frits van Bommel
Tomas Lindquist Olsen wrote: The approach Fritz mentions should still allow inlining. Having a fake Why do people keep performing s/s/z/ on my name? :(

Re: Inline assembler in D and LDC, round 2

2009-02-07 Thread Frits van Bommel
Chad J wrote: Frits van Bommel wrote: Lionello Lunesu wrote: Frits van Bommel fvbom...@remwovexcapss.nl wrote in message news:gmeqbr$137...@digitalmars.com... LDC on the other hand needs to emit LLVM asm, which requires it to specify an explicit return value. My approach is a way to extract

Re: Inline assembler in D and LDC, round 2

2009-02-07 Thread Frits van Bommel
Walter Bright wrote: Frits van Bommel wrote: Luckily, inline asm is treated as a function literal in LLVM, and it can return one or more values to the caller if the constraints string specifies which registers will contain them. So if LDC just specifies (e.g.) EAX/EDX:EAX/ST(0) to contain

Re: std.string and ranges

2009-02-08 Thread Frits van Bommel
Andrei Alexandrescu wrote: dsimcha wrote: Is std.string by any chance going to see any ripple effects from ranges? I want to write some patches to make it work with CTFE, which would be useful for some compile time mixin generation, but I don't want to waste time working on a module that

Re: Old problem with performance

2009-02-08 Thread Frits van Bommel
Walter Bright wrote: Weed wrote: Daniel Keep пишет: Weed wrote: [snip] If I had to take a guess, I'd say that it's six times slower because you're performing 100 million allocations. You aren't benchmarking class/struct overhead, you're benchmarking the overhead of doing 100 million

Re: Old problem with performance

2009-02-08 Thread Frits van Bommel
Walter Bright wrote: Weed wrote: Daniel Keep пишет: Weed wrote: [snip] If I had to take a guess, I'd say that it's six times slower because you're performing 100 million allocations. You aren't benchmarking class/struct overhead, you're benchmarking the overhead of doing 100 million

Re: Proposal : allocations made easier with non nullable types.

2009-02-09 Thread Frits van Bommel
Daniel Keep wrote: One option is the turn everything into an expression route. This is what Nemerle (think a functional superset of C#) did, and it's just BEAUTIFULLY expressive. X x = if( someCondition ) new SomeX(); else new SomeOtherX(); Failing that, there's always this (note: didn't do

Re: Why version() ?

2009-02-10 Thread Frits van Bommel
grauzone wrote: Some severe disadvantages of version(): 1. They can't contain expressions (like version(linux mac)). Unless Apple has plans to s/BSD/Linux/ in MacOS that I'm not aware of, version(linux || mac) would probably be more useful... Allowing boolean expressions (using only

Re: Some Ideas for Dynamic Vtables in D

2009-02-14 Thread Frits van Bommel
Michel Fortin wrote: http://michelf.com/weblog/2009/some-ideas-for-dynamic-vtables-in-d/ === In the current vtable system, each D object begins with a monitor pointer, followed by a pointer to the vtable, followed by the object’s members. === Isn't it { vtable, monitor, members } ?

Re: ref?

2009-02-15 Thread Frits van Bommel
Andrei Alexandrescu wrote: Frits van Bommel wrote: Andrei Alexandrescu wrote: Spot on. My ambitions are actually a tad higher. I want to implement containers as by-value structs defining value semantics and the needed primitives. Then, using introspection, I want to define a template Class

Re: std.locale

2009-03-02 Thread Frits van Bommel
Don wrote: there's no simple solution. (gripe They could at least recognize that outside the US, everyone uses A4-size paper, not that bizarro letter/legal stuff /gripe). Amen! It is usual that the user needs to write, say, in Swedish or in Russian, while in a Finnish setting. Or that one

Re: LLVM updates

2009-03-03 Thread Frits van Bommel
Daniel Keep wrote: bearophile wrote: There are some improvements in the last LLVM V.2.5, among them now LLVM provides intrinsics for (some) arithmetic with overflow operations: http://llvm.org/docs/LangRef.html#int_overflow Introducing such feature into D (LDC and more) is even simpler now

Re: Null references (oh no, not again!)

2009-03-06 Thread Frits van Bommel
Nick Sabalausky wrote: Georg Wrede georg.wr...@iki.fi wrote in message news:gosa0h$md...@digitalmars.com... And now the inevitable $1M question: when can we get D on it As soon as we get a fully-working C-backend for one of the D compilers ;) LLVM has a C backend, so as soon as LDC is

Re: const?? When and why? This is ugly!

2009-03-07 Thread Frits van Bommel
grauzone wrote: Walter Bright wrote: Burton Radons wrote: That's what we said about strings in 1.0. You modify it, you copy it, or you tell the user. The gentleman's agreement worked perfectly and that came without a mess of keywords, without implicit or explicit restrictions on behaviour,

Re: pure functions without invariant (a get-rid-of-const proposal)

2009-03-08 Thread Frits van Bommel
I'm pretty much in agreement with Andrei and BCS here, so I'll just comment on this bit: hasen wrote: When the coder marks a function as pure, the compiler must check that it actually is pure. I think the compiler can do this, in a way similar to how it can detect which functions can have

Re: Manual Deletion from Destructor

2009-03-14 Thread Frits van Bommel
BCS wrote: Hello dsimcha, I sometimes run into false pointer issues when using very large data structures in D. Often, these data structures are owned by a single class instance and do not escape. In these cases, is it safe to do something like: If you can be shure ~this will get called,

Re: Immutable + goto?

2009-03-19 Thread Frits van Bommel
dsimcha wrote: import std.stdio; uint bar = 0; void main() { start: immutable uint foo = bar; bar++; writeln(foo); goto start; } foo changes in this case. Is this a real bug, or is it considered undefined behavior to use goto in this way? I disagree: foo doesn't change

Re: crossplatform linking?

2009-03-23 Thread Frits van Bommel
Yigal Chripun wrote: it's not a platform issue but more of a linker issue. after all, mingw uses elf on windows, right? Actually, I'm pretty sure it uses a COFF variant. (Unless this has changed recently?)

Re: Eric S. Raymond on GPL and BSD licenses. Microsoft coming to Linux

2009-03-29 Thread Frits van Bommel
Jérôme M. Berger wrote: Now, how would you make money on free, as in libre, software? How would you make a free, single-player RPG and still stay in business? All you can under GPL is take payment for distribution, as long as nobody else starts to distribute it for free. This means giving

Re: Array Appenders

2009-04-08 Thread Frits van Bommel
Andrei Alexandrescu wrote: Denis Koroskin wrote: Well, actually I think that having an Appender object is an overkill. I never use, although I wrote a few implementations. Instead, I found the following method to be extemely handy, very fast and cover all my cases: void append(T)(T[] array,

Re: bigfloat

2009-04-08 Thread Frits van Bommel
dsimcha wrote: == Quote from Jarrett Billingsley (jarrett.billings...@gmail.com)'s article On Wed, Apr 8, 2009 at 3:39 PM, Walter Bright newshou...@digitalmars.com wrote: Paul D. Anderson wrote: b) the features and functions that should be included. I'd say NaNs and unordered comparisons. In

Re: Contract programming syntax

2009-04-08 Thread Frits van Bommel
Jarrett Billingsley wrote: On Wed, Apr 8, 2009 at 4:51 PM, Christopher Wright dhase...@gmail.com wrote: No. This proposed syntax change is quite misleading. Contracts cannot access the function's local variables, but it looks like they can. Contracts are executed at particular times, but that

Re: bigfloat

2009-04-08 Thread Frits van Bommel
Andrei Alexandrescu wrote: grauzone wrote: Sorry for the uninformed question, but do these types with with std.math? If you meant to ask whether they work with std.math, yes, but only in the sense that they are convertible from and to the built-in floating point types. I've been coquetting

Re: Latest news

2009-04-10 Thread Frits van Bommel
Vincent Richomme wrote: Hi, I am really sorry but I was following the newsgroups for a long time then I stopped 4 months ago and now there a too many news to read. So could someone tell me : 1) Have you merged the two libs tango and phobos, I mean does it use a common base ? Phobos for D2

Re: The new, new phobos sneak preview

2009-04-11 Thread Frits van Bommel
Andrei Alexandrescu wrote: alias TypeTuple!(GENERIC_READ, FILE_SHARE_READ, (SECURITY_ATTRIBUTES*).init, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, HANDLE.init) defaults; How is that a type-tuple? (As far as I can see, none

Re: Std Phobos 2 and logging library?

2009-04-13 Thread Frits van Bommel
Leandro Lucarella wrote: Christopher Wright, el 12 de abril a las 17:54 me escribiste: Absolutely. When writing parallel code to do large scale data mining in D, the lack of precision and multithreaded allocation are real killers. My interests are, in order of importance: 1. Being able to

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-13 Thread Frits van Bommel
Sean Kelly wrote: Leandro Lucarella wrote: But right now gc_malloc() doesn't take any TypeInfo argument. I can't see where I can get the TypeInfo in the first place =/ The call would have to be modified. Right now the best you can do is pass BlkAttr.NO_SCAN. And storing a pointer per block

Re: The great inapplicable attribute debate

2009-04-14 Thread Frits van Bommel
Michel Fortin wrote: On 2009-04-13 09:43:53 -0400, Frits van Bommel fvbom...@remwovexcapss.nl said: (How does this combine with the D ABI anyway? I know binary compatibility between the different compilers is a bit of a pipe dream at the moment, but the only way that could work would

Re: The great inapplicable attribute debate

2009-04-14 Thread Frits van Bommel
Stewart Gordon wrote: Don wrote: Stewart Gordon wrote: snip Surely, align isn't applicable to unions at all. IINM the members of a union, by design, start at the same offset. Not so, the alignment of each member should be respected. But the offset of a union member is always zero. So

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-14 Thread Frits van Bommel
Robert Jacques wrote: On Tue, 14 Apr 2009 06:04:01 -0400, Frits van Bommel fvbom...@remwovexcapss.nl wrote: Robert Jacques wrote: it instead. (You'd have to create a fake ClassInfo for structs and arrays.) Then the GC only has to track the start of each object (i.e. the beginning of a block

Re: The great inapplicable attribute debate

2009-04-14 Thread Frits van Bommel
Christopher Wright wrote: Frits van Bommel wrote: But the union's alignment needs to be sufficient for all members, so it depends on the maximum alignment of all members. Or the least common multiple, assuming that align accepts arguments that are not powers of 2. I have never seen

Re: error building on Syllable

2009-04-21 Thread Frits van Bommel
Rohan wrote: Hi! I try to build DMD under Syllable, but I get next error. I tried 12 versions and BSD port, and it didn't help. http://img95.imageshack.us/img95/5505/capturey.png Could anybody help? Looks like simple missing #includes. Figure out which header should declare each of those

Re: Few mixed things

2009-04-22 Thread Frits van Bommel
bearophile wrote: What is the advantage of having a separate /+ +/ nestable comment syntax? Can't the /+ +/ be removed to make the normal /* */ syntax nestable? (IS the different C semantics of /* */ a problem here? I don't think so.) Sometimes it's handy to have non-nesting comments. For

Re: D2 weak references

2009-04-22 Thread Frits van Bommel
Leandro Lucarella wrote: I think instead of a notification mechanism access to the mark bit can be provided. The mark phase is ran with all thread paused, so you don't need any notifications in that phase because nobody can ask the weak ref object for the underlaying pointer then. When threads

Re: D2 weak references

2009-04-22 Thread Frits van Bommel
Jason House wrote: Frits van Bommel Wrote: Leandro Lucarella wrote: I think instead of a notification mechanism access to the mark bit can be provided. The mark phase is ran with all thread paused, so you don't need any notifications in that phase because nobody can ask the weak ref object

Re: [OT?] Web NG archives updates

2009-04-27 Thread Frits van Bommel
Walter Bright wrote: Leandro Lucarella wrote: Hi, I don't who is in charge of the web NG archive[1], but is there any chance to update them at least once a day? Doing it once a day means getting the archiving program on the server, which is FreeBSD64. Unfortunately, that platform isn't

Re: Yet another strike against the current AA implementation

2009-04-27 Thread Frits van Bommel
Michel Fortin wrote: On 2009-04-27 00:50:23 -0400, dsimcha dsim...@yahoo.com said: Output: Direct: 2343 Virtual: 5695 opApply: 3014 Nice. Isn't there room for optimisation on the compiler side though? I mean, the compiler could inline opApply, and while doing so it could notice that

Re: Yet another strike against the current AA implementation

2009-04-27 Thread Frits van Bommel
dsimcha wrote: [snip] Output: Direct: 2343 Virtual: 5695 opApply: 3014 Bottom line is that these pretty much come in the order you would expect them to, but there are no particularly drastic differences between any of them. To put these timings in perspective, 5700 ms for 1 billion

Re: Fixing the imaginary/complex mess

2009-05-04 Thread Frits van Bommel
Don wrote: In the case complex = int/complex, there's no problem. It's the case int = int/complex that doesn't make sense. And that's fundamentally because cast(real)(2 + 3i) doesn't have a definite answer. Devil's advocate: one could argue it's the same as cast(int) of a float -- it returns

Re: Destructors and Deterministic Memory Management

2009-05-06 Thread Frits van Bommel
Daniel Keep wrote: When your class' dtor is called, you CANNOT say whether any of the references into GC-controlled memory you hold are still valid. You forgot to add: unless you know for a *fact* they're referenced from a GC root, for example from a global variable (directly or indirectly).

Re: Destructors and Deterministic Memory Management

2009-05-07 Thread Frits van Bommel
Daniel Keep wrote: Frits van Bommel wrote: Daniel Keep wrote: When your class' dtor is called, you CANNOT say whether any of the references into GC-controlled memory you hold are still valid. You forgot to add: unless you know for a *fact* they're referenced from a GC root, for example from

Re: What's the current state of D?

2009-05-11 Thread Frits van Bommel
Leandro Lucarella wrote: GDB people have spoken (I don't see you subscribed to the bug report so I transcribe the comment from GDB): -- For a patch this size we would need copyright assignments from all the authors of the

Re: What's the current state of D?

2009-05-12 Thread Frits van Bommel
Leandro Lucarella wrote: Isn't the demangle code taken from DMDFE? Why would DMDFE need a demangler? It can just not mangle in the first place :).

Re: What's the current state of D?

2009-05-12 Thread Frits van Bommel
dsimcha wrote: == Quote from Frits van Bommel (fvbom...@remwovexcapss.nl)'s article Leandro Lucarella wrote: Isn't the demangle code taken from DMDFE? Why would DMDFE need a demangler? It can just not mangle in the first place :). You need name mangling for templates and function

Re: Using DMD 1.045 breaks code

2009-05-16 Thread Frits van Bommel
Fractal wrote: Hello After I updated my installed DMD, to 1.045, when I try compile my code, many errors appears, like Error: class main.Program D compiler and phobos' object.d are mismatched. What I can do to fix these errors? (Im using Tango) Tango added support for 1.045 in r4653:

Re: OT: on IDEs and code writing on steroids

2009-05-18 Thread Frits van Bommel
Jacob Carlborg wrote: Daniel Keep wrote: Actually, Descent isn't perfect, either. For example, it mandates that cases in a switch MUST be aligned with the braces. What's more fun is that you can't override it until AFTER it's corrected YOU. Just file a ticket. The relevant ticket[1] is a

Re: The Final(ize) Challenge

2009-05-18 Thread Frits van Bommel
Andrei Alexandrescu wrote: Good point! Now define Unfinalize that opens the final methods of a class for method overriding. class A { final int foo(string) { ... } } class UnfinalizeA : A { int foo(string a) { return super.foo(a); } } DMD rightly doesn't allow this: --- test.d(8):

Re: OT: on IDEs and code writing on steroids

2009-05-20 Thread Frits van Bommel
Kagamin wrote: BCS Wrote: smaller object code? OTOH a good implementation will noice when I can fold together several template expansions That's the difference. You can't fold templates because they're binary incompatible as opposite to generics. They're not always binary-incompatible.

Re: OT: on IDEs and code writing on steroids

2009-05-20 Thread Frits van Bommel
Denis Koroskin wrote: On Wed, 20 May 2009 13:09:37 +0400, Kagamin s...@here.lot wrote: BCS Wrote: smaller object code? OTOH a good implementation will noice when I can fold together several template expansions That's the difference. You can't fold templates because they're binary

Re: OT: on IDEs and code writing on steroids

2009-05-20 Thread Frits van Bommel
bearophile wrote: Frits van Bommel: To do the latter transformation, the pass would need to be reimplemented to run when the code is closer to machine code. Can't this feature be asked to the LLVM developers? Sure, feel free to file a feature request: http://llvm.org/bugs/enter_bug.cgi

Re: OT: on IDEs and code writing on steroids

2009-05-20 Thread Frits van Bommel
Kagamin wrote: Frits van Bommel Wrote: That's the difference. You can't fold templates because they're binary incompatible as opposite to generics. They're not always binary-incompatible. For instance, if a template only works with pointers or references (this includes object references

Re: Finalizing D2

2009-05-23 Thread Frits van Bommel
Brad Roberts wrote: Don wrote: bearophile wrote: Andrei Alexandrescu: there's been a sharp increase in bug reports and patches recently. Walter and I are still scratching our head over that (it's not like dmd got much crappier overnight). I can only infer that more people have started using

Re: how to use GC as a leak detector? i.e. get some help info from GC?

2009-05-24 Thread Frits van Bommel
nobody wrote: == Quote from Jason House (jason.james.ho...@gmail.com)'s article Why not use valgrind? With the GC disabled, it should give accurate results. Strange enough, indeed I have tried valgrind with the GC disabled version. It didn't report anything useful. That's why I'm puzzled,

Re: !in operator?

2009-05-25 Thread Frits van Bommel
Stewart Gordon wrote: Jason House wrote: snip Method 1: if (x !in y) foo(); else{ auto z = x in y; bar(z); } Method 2: auto z = x in y; if (z is null) foo; else bar(z); Method 1 essentially calls in twice while method 2 calls in once. snip But there's no requirement to look it

Re: [OT] n-way union

2009-05-26 Thread Frits van Bommel
Andrei Alexandrescu wrote: Jason House wrote: This conversation made me realize a simple optimization (forgive me if it's what Don was implying) Instead of storing m ranges in a heap, store only m-1 ranges. The range that would be the min if the heap is kept separate. Each pop operation will

Re: [OT] Convention of Communication

2009-05-28 Thread Frits van Bommel
Denis Koroskin wrote: FWIW, NNTP (which is used in newsgroups like this) falls into Usenet category: Wikipedia quote (http://en.wikipedia.org/wiki/Usenet#Technical_details): On the Internet, Usenet is typically served via NNTP ... Just because NNTP is used for Usenet doesn't mean every NNTP

Re: Source control for all dmd source

2009-05-29 Thread Frits van Bommel
Sean Kelly wrote: Jason House wrote: Over in D.anounce, the LDC devs said they would have an easier time upgrading to newer dmd (fe) versions if the source was in source control. Even if Walter is the only one with write access, it's still be helpful. It's helpful for more than just the LDC

Re: Source control for all dmd source

2009-05-29 Thread Frits van Bommel
Frits van Bommel wrote: Thomas Lindquist Sorry about the misspelling there, Tomas. I get annoyed when people misspell my name, and now I'm doing it too... :(

Re: D compiler as a C++ preprocessor

2009-05-30 Thread Frits van Bommel
bearophile wrote: Dmitry Sychov: Can D compiler be used only as a C++ preprocessor, that it to generate C++ output (platform independent) to be later compiled via the target platform C++ compiler? It may be possible to induce LDC to output C code. With the LLVM C backend linked in it

Re: forward ranges must offer a save() function

2009-05-30 Thread Frits van Bommel
bearophile wrote: Andrei Alexandrescu: If we want to allow people to create ranges that are classes (as opposed to structs) the requirement for a save() function is a must. This is because copying class ranges with Range copy = original; only creates a new alias for original; the two share

Re: Automatic void initialization

2009-06-02 Thread Frits van Bommel
Jarrett Billingsley wrote: On Tue, Jun 2, 2009 at 8:10 AM, bearophile bearophileh...@lycos.com wrote: Walter Bright: Dead assignment elimination is compiler technology from the 70's ! I'd like to see this technology used for arrays too. So in the following two adjacent lines of code a

Re: Automatic void initialization

2009-06-02 Thread Frits van Bommel
Jarrett Billingsley wrote: I thought I remember seeing a runtime function to allocate an array without initializing it.. maybe it's just not used yet? Oh, the function's there. It's just not used for that purpose :P. It's used for array concatenations and array literals, where the compiler

Re: LDC predefined identifiers

2009-06-07 Thread Frits van Bommel
Brad Roberts wrote: I'm in the process of updating the version.html list of predefined identifiers. I'd like to include the identifiers that are produced by LDC as well as validate that there aren't conflicts or contradictions between the compilers. I know there was a thread about this a while

Re: Fractal

2009-06-08 Thread Frits van Bommel
Fractal wrote: Jarrett Billingsley Wrote: Because those are the three string encodings D supports, and only supporting one is a dumb idea. Why? wchar is full compatible with all languages (if it is not please tell me)... also when I have many strings in different types, I need to convert it

Re: Count your blessings!

2009-06-10 Thread Frits van Bommel
Andrei Alexandrescu wrote: bearophile wrote: One of those five precios things is the Elvis operator: Exp1 ?: Exp2 That means: If Exp1 is non-null, use that, otherwise evaluate and use Exp2 Adding it to D looks easy, but is such operator so important to be in the list of the only 5 things to

Re: Inlining asm functions

2009-06-11 Thread Frits van Bommel
Brad Roberts wrote: On Thu, 11 Jun 2009, Frits van Bommel wrote: Note that for LDC, an even more optimal arrangement is something like[1]: - version(LDC) import ldc.llvmasm; creal expi(real y) { return __asm!(creal)(fsincos, ={st(0)},={st(1)},0, y); } - My appologies if I cut

Re: why implicitly allowing compare ubyte and byte sucks

2009-06-11 Thread Frits van Bommel
Don wrote: For bonus points: [end of message] I guess nobody'll be getting those bonus points then... :P

Re: Reading a File That is Being Written To From Phobos

2009-06-15 Thread Frits van Bommel
dsimcha wrote: It seems that Phobos won't allow opening a file that is being written to by another program. I understand that this is unsafe behavior. However, for my purposes, I don't care and want to do it anyhow. (My purposes are that I have a program periodically dumping data to a file

  1   2   >