Re: Give me a break

2009-06-29 Thread Tom S
Jarrett Billingsley wrote: 2009/6/29 MIURA Masahiro : Yigal Chripun wrote: do not tell other people what to think and what to write. this is not china and you are not the great firewall. grow up. Apparently you don't share Jarrett's consciousness of the problem that more important issues are l

Re: Give me a break

2009-06-29 Thread Tom S
Yigal Chripun wrote: > MIURA Masahiro wrote: >> Yigal Chripun wrote: >>> do not tell other people what to think and what to write. this is not >>> china and you are not the great firewall. >>> grow up. >> Apparently you don't share Jarrett's consciousness of the problem >> that more important issu

Re: Give me a break

2009-06-29 Thread Tom S
Yigal Chripun wrote: Jarrett Billingsley wrote: 2009/6/29 MIURA Masahiro : Yigal Chripun wrote: do not tell other people what to think and what to write. this is not china and you are not the great firewall. grow up. Apparently you don't share Jarrett's consciousness of the problem that more

Re: Give me a break

2009-06-29 Thread Tom S
Yigal Chripun wrote: Tom S wrote: Yigal Chripun wrote: thirdly, D has a dictator, Walter Bright, which decides its fate and we have almost zero influence on this. I thought "The needs and contributions of the D programming community form the direction it goes.". who tol

Re: Give me a break

2009-06-29 Thread Tom S
Lutger wrote: Tom S wrote: Yigal Chripun wrote: (snip) IMHO, the Tango vs. Phobos licensing issue is the biggest bikeshed color problem in the D realm and the only people that can solve it are the tango devs and walter and co. of which Neither are willing to budge. Uhhh... try listening to

Re: Give me a break

2009-06-30 Thread Tom S
Sean Kelly wrote: == Quote from Tom S (h3r3...@remove.mat.uni.torun.pl)'s article IIRC, Tango devs claim that its runtime is better than druntime, which also only supports DMD at the moment. How is it better? I vaguely recall at least one change in Tango's runtime that actually vi

Re: Give me a break

2009-06-30 Thread Tom S
Don wrote: Tom S wrote: Lutger wrote: Tom S wrote: Yigal Chripun wrote: (snip) IMHO, the Tango vs. Phobos licensing issue is the biggest bikeshed color problem in the D realm and the only people that can solve it are the tango devs and walter and co. of which Neither are willing to budge

Re: Give me a break

2009-06-30 Thread Tom S
Don wrote: Tom S wrote: Don wrote: Tom S wrote: Lutger wrote: Tom S wrote: Yigal Chripun wrote: (snip) IMHO, the Tango vs. Phobos licensing issue is the biggest bikeshed color problem in the D realm and the only people that can solve it are the tango devs and walter and co. of which

Re: finding help for D game engine

2009-06-30 Thread Tom S
Tanukisan wrote: Hi guys I introduce myself, I'm a french student in Appliyed mathematics and one of my biggest dream was to create a small racing game My project is designed to be a Trackmania-like not more not less in a more simpliest way since it's a demo. The modelization part is do

Re: Give me a break

2009-07-01 Thread Tom S
Sean Kelly wrote: == Quote from Tom S (h3r3...@remove.mat.uni.torun.pl)'s article Sean Kelly wrote: == Quote from Tom S (h3r3...@remove.mat.uni.torun.pl)'s article And apparently, there's been very little contact with Sean lately, so it's a case of 'us' vs 

Re: Give me a break

2009-07-02 Thread Tom S
Walter Bright wrote: For a more recent example, 3122 contained a patch that was marked as complete and tested, but it had two serious bugs (did not check that a filename was supplied, and did not check for file write errors) and an unnecessary hardcoded OS dependency (on path lengths). These ar

Comma expressions must die [Was: Reddit: why aren't people using D?]

2009-07-23 Thread Tom S
Walter Bright wrote: Of course that's true, but why is a dedicated syntax better than Tuple!( ...) ? Why is dedicated syntax for comma expressions better than commaExpr(...) ? I take it most folks on this NG would prefer to have shorter syntax for tuples instead the virtually never used comma

Re: Comma expressions must die [Was: Reddit: why aren't people using D?]

2009-07-23 Thread Tom S
Adam D. Ruppe wrote: On Fri, Jul 24, 2009 at 12:03:37AM +0200, Michiel Helvensteijn wrote: Would you look at this page and give me your opinion? Looking at it quickly, the big difference seems to be you leave the tuple word off, and use them in more places. Is Tuple!(int, bool) A = tuple(a,

Re: Comma expressions must die [Was: Reddit: why aren't people using D?]

2009-07-23 Thread Tom S
Adam D. Ruppe wrote: (...) It is two brief lines longer to copy them to a local x and y if you want to. Remember delegate literals? They were just a few more tokens, but it wasn't until the shorthand syntax was introduced that everyone started using them. I mean, how hard is it to type the e

Re: Developing a plan for D2.0: Getting everything on the table

2009-07-27 Thread Tom S
Andrei Alexandrescu wrote: yigal chripun wrote: Andrei Alexandrescu Wrote: yigal chripun wrote: Andrei Alexandrescu Wrote: Is it appropriate to define multiple classes, structs, templates, etc within a single module? What considerations should inform the decision regarding the placement of

Re: OT: What's your favorite codeline?

2009-08-30 Thread Tom S
A Bothe wrote: What's your favorite line of D code? I like my recent: c.resFunc = cast(void function(void*))(*cast(void***)proto.resources[origResIdx].init().ptr)[ Command.Type.ResAcquire == c.type ? 1 : 2 ]; Sure, it's 3 lines, but still one statement and if I were downs, that wou

Re: How Nested Functions Work, part 1

2009-08-31 Thread Tom S
Walter Bright wrote: language_fan wrote: This information is also taught in basic university level compiler courses. I bet only a tiny fraction of programmers have taken university compiler classes. (Also, they were not covered in compiler classes I took.) Consider also that the Java JVM doe

Incremental compilation with DMD

2009-09-11 Thread Tom S
Short story: DMD probably needs an option to output template instances to all object files that need them. Long story: I've been trying to make incremental compilation in xfBuild reliable, but it turns out that it's really tricky with DMD. Consider the following example: * module A instanti

Re: Incremental compilation with DMD

2009-09-12 Thread Tom S
Walter Bright wrote: Tom S wrote: Thus my suggestion of adding an option to DMD so it may emit template instances to all object files that use them. If anyone has alternative ideas, I'd be glad to hear them, because I'm running out of options. Try compiling with -lib, which wil

Re: Incremental compilation with DMD

2009-09-12 Thread Tom S
Tom S wrote: Walter Bright wrote: Tom S wrote: Thus my suggestion of adding an option to DMD so it may emit template instances to all object files that use them. If anyone has alternative ideas, I'd be glad to hear them, because I'm running out of options. Try compiling with -

Re: Incremental compilation with DMD

2009-09-12 Thread Tom S
Walter Bright wrote: Tom S wrote: As for my own impressions of this idea, its biggest drawback probably is that the multitude of object files created via -multiobj strains the filesystem. Sure, but -multiobj and -lib generate exactly the same object files, it's just that -lib puts the

Re: Incremental compilation with DMD

2009-09-12 Thread Tom S
Walter Bright wrote: I don't really understand why the -lib approach is not working for your needs. I'm not sure what you mean by "the -lib approach". Just how do you exactly apply it to incremental compilation? If my project has a few hundred modules and I change just one line in one functio

Re: Incremental compilation with DMD

2009-09-13 Thread Tom S
Walter Bright wrote: Tom S wrote: Walter Bright wrote: I don't really understand why the -lib approach is not working for your needs. I'm not sure what you mean by "the -lib approach". Just how do you exactly apply it to incremental compilation? If my project has a few

Re: Incremental compilation with DMD

2009-09-13 Thread Tom S
Walter Bright wrote: What you can try is creating a database that is basically a lib (call it A.lib) of all the modules compiled with -lib. Then recompile all modules that depend on changed modules in one command, also with -lib, call it B.lib. Then for all the obj's in B, replace the correspon

Re: Incremental compilation with DMD

2009-09-13 Thread Tom S
Don wrote: Walter Bright wrote: Tom S wrote: Walter Bright wrote: What you can try is creating a database that is basically a lib (call it A.lib) of all the modules compiled with -lib. Then recompile all modules that depend on changed modules in one command, also with -lib, call it B.lib

Re: Template Metaprogramming Made Easy (Huh?)

2009-09-13 Thread Tom S
Jeremie Pelletier wrote: I haven't had to use the C heap whatsoever so far in D, could you give me an example of where you need it? In fact, the *only* place I use the C heap is in my garbage collector's internals, for pool structs and mark ranges. I use pointers to GC memory all the time too,

Re: Template Metaprogramming Made Easy (Huh?)

2009-09-13 Thread Tom S
Jeremie Pelletier wrote: Tom S Wrote: Jeremie Pelletier wrote: I haven't had to use the C heap whatsoever so far in D, could you give me an example of where you need it? In fact, the *only* place I use the C heap is in my garbage collector's internals, for pool structs and mark

Re: Template Metaprogramming Made Easy (Huh?)

2009-09-13 Thread Tom S
Jeremie Pelletier wrote: Tom S Wrote: Jeremie Pelletier wrote: I myself allocate all my meshes and textures directly on the GC and I'm pretty sure its faster than C's malloc and much safer. Hm, why would it be faster with the GC than malloc? I'm pretty sure it's the

Re: Template Metaprogramming Made Easy (Huh?)

2009-09-13 Thread Tom S
Jeremie Pelletier wrote: Tom S Wrote: Jeremie Pelletier wrote: Tom S Wrote: Jeremie Pelletier wrote: I myself allocate all my meshes and textures directly on the GC and I'm pretty sure its faster than C's malloc and much safer. Hm, why would it be faster with the GC than m

Re: Incremental compilation with DMD

2009-09-15 Thread Tom S
Walter Bright wrote: What you can try is creating a database that is basically a lib (call it A.lib) of all the modules compiled with -lib. Then recompile all modules that depend on changed modules in one command, also with -lib, call it B.lib. Then for all the obj's in B, replace the correspon

Re: Incremental compilation with DMD

2009-09-17 Thread Tom S
Walter Bright wrote: Tom S wrote: Personally I'm of the opinion that functions should be explicitly marked for CTFE, and this is just another reason for such. I'm using a patched DMD with added pragma(ctfe) which instructs the compiler not to run any codegen or generate debug info

Re: Incremental compilation with DMD

2009-09-17 Thread Tom S
Walter Bright wrote: Tom S wrote: When building my second largest project, DMD eats up about 1.2GB of memory and dies (even without -g). Luckily, xfBuild allows me to set the limit of modules to be compiled at a time, so when I cap it to 200, it compiled... but didn't link :( Somewhere i

Re: Incremental compilation with DMD

2009-09-17 Thread Tom S
Walter Bright wrote: Tom S wrote: Walter Bright wrote: Tom S wrote: Personally I'm of the opinion that functions should be explicitly marked for CTFE, and this is just another reason for such. I'm using a patched DMD with added pragma(ctfe) which instructs the compiler not

Re: Incremental compilation with DMD

2009-09-18 Thread Tom S
Walter Bright wrote: Also, if you specify a .obj file directly to the linker, it will put all of the symbols and data in that .obj file into the executable. The linker does NOT remove functions. What it DOES do is pull obj files out of a library to resolve unresolved symbols from other obj fi

Re: Why not move cast to the standard library?

2009-09-24 Thread Tom S
language_fan wrote: Thu, 24 Sep 2009 13:47:21 -0400, Steven Schveighoffer thusly wrote: I actually prefer the compiler to handle the casting versus templates to cut down on template instantiation bloat. I wonder how D scales to 100 MLOC programs as the template instantiations can be troubles

Re: Null references redux

2009-09-26 Thread Tom S
Andrei Alexandrescu wrote: [snip] The problem is you keep on insisting on one case "I have a non-null reference that I don't have an initializer for, but the compiler forces me to find one, so I'll just throw a crappy value in." This focus on one situation comes straight with your admitted bad

Re: Null references redux

2009-09-26 Thread Tom S
Jeremie Pelletier wrote: Ary Borenszweig wrote: Walter Bright wrote: Daniel Keep wrote: "But the user will just assign to something useless to get around that!" You mean like how everyone wraps every call in try{...}catch(Exception e){} to shut the damn exceptions up? They do just that in

Re: scope class members -> in-situ

2009-10-02 Thread Tom S
Andrei Alexandrescu wrote: I think this has been discussed in this group already. An object storing another object needs two allocations: class A { ... } class B { A a; this() { a = new A; } } auto b = new B; // two allocations I'm thinking of using "scope" in this situation to

Re: Arrays template arguments and CT data structures

2009-10-02 Thread Tom S
bearophile wrote: (after a small discussion on IRC) Tuples may be used for similar purposes, but fixed-sized arrays are simpler to use, simpler to define, and they don't induce compilation/code bloat. (...) What do you mean by that? So parametrizing a template with a static array would cause

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Tom S
Andrei Alexandrescu wrote: It's a rough rough draft, but one for the full chapter on arrays, associative arrays, and strings. http://erdani.com/d/thermopylae.pdf Any feedback is welcome. Thanks! Thanks for the excerpt! I've only had the time to give it a brief skim so far, but it's looking

Structs implementing interfaces in D1

2009-02-09 Thread Tom S
/** Just a simple hack to have interfaces implemented by structs ... because I can :P Tested on DMD 1.039 [win32], GDC (various versions) [linux32] and codepad.org Output: Entering main Foo.func1 called ; val1 = 3.141590, val2 = Hello, world! Foo.func2 called ; val1 = 3.141590, val2 = Hello, w

Re: Structs implementing interfaces in D1

2009-02-09 Thread Tom S
Chad J wrote: Hawt! I take it this can be done without assembly? Should be doable, but with more pain and overhead (the generated functions would need to pass all parameters to the real ones and you'd have to take care of ref-ness). -- Tomasz Stachowiak http://h3.team0xf.com/ h3/h3r3tic o

Re: Structs implementing interfaces in D1

2009-02-09 Thread Tom S
BCS wrote: Hello Tom, The concept is pretty simple. The mixin creates a vtable which points to a set of generated functions of the form { adjust the 'this' ptr; jump to the real function; }. Finally, the "InterfaceName asInterfaceName()" functions generated inside the struct return pointers to

Re: Structs implementing interfaces in D1

2009-02-09 Thread Tom S
BCS wrote: Hello Tom, BCS wrote: Hello Tom, The concept is pretty simple. The mixin creates a vtable which points to a set of generated functions of the form { adjust the 'this' ptr; jump to the real function; }. Finally, the "InterfaceName asInterfaceName()" functions generated inside the

Re: Structs implementing interfaces in D1

2009-02-10 Thread Tom S
Steven Schveighoffer wrote: "Tom S" wrote /** The concept is pretty simple. The mixin creates a vtable which points to a set of generated functions of the form { adjust the 'this' ptr; jump to the real function; }. Finally, the "InterfaceName asInterfaceName()"

Re: Structs implementing interfaces in D1

2009-02-10 Thread Tom S
Tim M wrote: Is there a reason to have structs instead of classes/objects to do whatever you use them for or is that besides the point? Structs are more lightweight because they don't carry the 'monitor' and vtable pointer. It's also easier to create them on the stack e.g. in arrays. But my c

Re: Structs implementing interfaces in D1

2009-02-10 Thread Tom S
BCS wrote: struct S { int i; int j; int k; int n; } S[5] sArr; ca I make an inerface out of sArr[2] ? The new version of my code can do it. Of course you'd still need some functions in S and an actual interface there ;) -- Tomasz Stachowiak http://h3.team0xf.com/ h3/h3r3tic on #D freenod

Re: Structs implementing interfaces in D1

2009-02-10 Thread Tom S
BCS wrote: Hello Tom, if you want I can get you access to add this to scrapple. I guess that would be cool :) My dsource user name is, as usual, 'h3r3tic'. -- Tomasz Stachowiak http://h3.team0xf.com/ h3/h3r3tic on #D freenode

Re: Old problem with performance

2009-02-12 Thread Tom S
Rainer Deyke wrote: Christopher Wright wrote: What mechanism for sharing state is available to by-reference objects but not by-value objects? struct C { T t; } C c1; C c2 = c1; If T was a reference type, 'c1' and 'c2' now share state, and it's up to the programmer to write code to prevent

Re: Old problem with performance

2009-02-12 Thread Tom S
Rainer Deyke wrote: Because unintentional object aliasing a problem orders of magnitude more common than unintentional object slicing, and at least an order of magnitude harder to detect and fix. Because you can't correctly duplicate a multi-dimensional dynamic array in D by using the built-in '

Re: OPTLINK needs to die.

2009-02-16 Thread Tom S
Jarrett Billingsley wrote: That's it -- I'm finished. I'm tired of constantly rearranging code to appease OPTLINK and its outdated object format. This is, for me, the number one blocker of most of my more complex code on Windows. More than any DMD bug. Tom S can vouch for it

Re: OPTLINK needs to die.

2009-02-16 Thread Tom S
Tim M wrote: Just checking you are aware of objconv which can be found here http://www.agner.org/optimize/. Have you successfully used it to convert all OMF obj files of some application to another format and link them? It gives me a lot of: "Error 2316: Incompatible relocation method: 16+32

Re: OPTLINK needs to die.

2009-02-16 Thread Tom S
Walter Bright wrote: Jarrett Billingsley wrote: http://d.puremagic.com/issues/show_bug.cgi?id=424 I just added this to the bug report: == The compiler already has a switch to generate multiple obj files from one source file: -multiobj. I use it for debugging. But it woul

Re: OPTLINK needs to die.

2009-02-17 Thread Tom S
Walter Bright wrote: Tom S wrote: I've tried it before and unfortunately there's a problem with this approach: static ctors from modules linked from a .lib don't get executed: Not everything is linked in from a library, just referenced things (that's the whole point of

Re: OPTLINK needs to die.

2009-02-17 Thread Tom S
Walter Bright wrote: Tom S wrote: So it seems that Main.d would have to reference symbols from each module in the program. Ouch. I found that problem, and fixed it. Cool, thanks :) Additionally, using such an approach breaks any possibility to use incremental compilation. It depends

Re: OPTLINK needs to die.

2009-02-17 Thread Tom S
Max Samukha wrote: On Tue, 17 Feb 2009 04:16:35 -0800, Walter Bright wrote: Tom S wrote: So there's also the option of having a .lib per .d file and linking that all together. So I've just tried it: dmd -c Main.d dmd -lib Mod.d dmd -lib Mod2.d dmd Main.obj Mod.lib Mod2.d ... a

Re: OPTLINK needs to die.

2009-02-19 Thread Tom S
Walter Bright wrote: The problem appears to be that optlink cannot deal correctly with weak references. I've modified the compiler to not emit weak references, and the problem goes away. It's not a perfect fix, but it works. With the modified compiler, does the following link? If so, is the o

Re: OPTLINK needs to die.

2009-02-19 Thread Tom S
Walter Bright wrote: Tom S wrote: Walter Bright wrote: The problem appears to be that optlink cannot deal correctly with weak references. I've modified the compiler to not emit weak references, and the problem goes away. It's not a perfect fix, but it works. With the modifie

Re: std.bind documentation sucks hard

2009-02-22 Thread Tom S
Georg Wrede wrote: Another smarta** might say that "it says References: boost" so read that. Well, one could say this about every single doc page on the site. Well, I'll be that smarta** then. I've mostly implemented Bind for fun and I hate writing docs. I'm not sure if I actually use it in mo

Re: D, so it happend...

2009-04-06 Thread Tom S
How is compilar formed? How is compilar formed? How executable get maked?

Re: Needing templates/compile-time functions for debugging

2009-05-26 Thread Tom S
Ary Borenszweig wrote: Hi! ohai! I'm in need of heavy (long, complicated, interesting, whatever) templates and/or compile-time functions to help me debug the compile-time debugger I'm writing. Can you paste/attach some here, or give me links? xpose2 is pretty mad: http://team0xf.com:1024

Re: Stack-allocated arrays

2008-11-14 Thread Tom S
Andrei Alexandrescu wrote: enum Uninitialized { yeahIKnow } Hahaha, brilliant! :D Is there interest for such a thing? Yes, absolutely. I use lots of stack allocations and the vision of an overflow is always lurking somewhere in the shadows... EASTL has a stack allocator, so we must have

Re: Good complexity

2008-11-21 Thread Tom S
bearophile wrote: 6) Static if and static asserts seem a little more complex that the ways to do similar things in C, but they seem a good complexity. Static if and static asserts in C? Good joke. I think that most of the complexity of D is good, but there are many corners/things can be im

Re: Good complexity

2008-11-21 Thread Tom S
Denis Koroskin wrote: On Fri, 21 Nov 2008 19:19:58 +0300, Tom S <[EMAIL PROTECTED]> wrote: bearophile wrote: 6) Static if and static asserts seem a little more complex that the ways to do similar things in C, but they seem a good complexity. Static if and static asserts in C? Goo

Re: Matrix mul

2008-11-22 Thread Tom S
Don wrote: bearophile wrote: While writing code that works on matrices I have found something curious... Here's what I think is going on. AFAIK, D hasn't got any special code for initializing jagged arrays. So auto A = new double[][](N, N); involves N+1 memory allocations. As well as

Re: Matrix mul

2008-11-23 Thread Tom S
Andrei Alexandrescu wrote: Tom S wrote: Don wrote: bearophile wrote: While writing code that works on matrices I have found something curious... Here's what I think is going on. AFAIK, D hasn't got any special code for initializing jagged arrays. So auto A = new doubl

Re: Profiler Speed

2009-01-16 Thread Tom S
dsimcha wrote: I'm working on optimizing some code now, and a nagging issue that I've been meaning to bring up is how slow stuff runs when profiling is turned on. It seems that, given any code that's slow enough to be worth profiling/optimizing, the DMD profiler slows it down further, to the poi