shorthand template and static conditionals?

2009-07-29 Thread Jeremie Pelletier
Could it be a valid option to have a shorthand template syntax if the template body has only one statement? Something like: template Tuple(A...) alias Tuple = A; Another suggestion would be to have the ?: syntax supported for static statements, as we're currently forced to use static ifs. It re

Compile time float binary representation

2009-07-31 Thread Jeremie Pelletier
Is there a way to convert a float (or double/real) to an integral number without changing its binary representation at compile time? I need to extract the sign, exponent and mantissa yet I cant use bit shifting. "Error: 'R' is not of integral type, it is a real" is the error I get. The usual *ca

Re: Compile time float binary representation

2009-07-31 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Jeremie Pelletier wrote: > > Is there a way to convert a float (or double/real) to an integral number > > without changing its binary representation at compile time? > > > > I need to extract the sign, exponent and mantissa yet I

Re: Compile time float binary representation

2009-07-31 Thread Jeremie Pelletier
Jeremie Pelletier Wrote: > Andrei Alexandrescu Wrote: > > > Jeremie Pelletier wrote: > > > Is there a way to convert a float (or double/real) to an integral number > > > without changing its binary representation at compile time? > > > > > > I

Re: Compile time float binary representation

2009-07-31 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Jeremie Pelletier wrote: > > Jeremie Pelletier Wrote: > > > >> Andrei Alexandrescu Wrote: > >> > >>> Jeremie Pelletier wrote: > >>>> Is there a way to convert a float (or double/real) to an integral number

Re: reddit.com: first Chapter of TDPL available for free

2009-08-04 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > KennyTM~ wrote: > > Andrei Alexandrescu wrote: > >> http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ > >> > >> > >> > >> (Don't tell anyone, but I plan to rewrite it.) > >> > >> Andrei > > > > What's a "so-called IEEE 7

Re: Triggers

2009-08-05 Thread Jeremie Pelletier
Sjoerd van Leent Wrote: > OK, to make matters worse. > > As I was reading so many things about properties, keywords and a bunch of > other interesting things, perhaps triggers. > > Triggers are, in my opinion, functions that act as delegates, and are called > before or after one or more other

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Michel Fortin wrote: > > Alternatively, "writefln" could be an exception to the rules, but then > > the exception would need a better rationale than "it shouldn't look like > > Java". I mean, if Phobos makes unjustified exceptions to its naming > > conventions here

Global operator overloading?

2009-08-06 Thread Jeremie Pelletier
Are there any plans to have global operator overloading in D? It would be terribly useful with ranges, since std.array already define range primitives for arrays, I tried to implement array primitives to ranges the same way, ie: --- bool opEquals(T, U)(T t, U, u) if(isInputRange!T && isInputRan

Re: Global operator overloading?

2009-08-06 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Jeremie Pelletier wrote: > > Are there any plans to have global operator overloading in D? > > > > It would be terribly useful with ranges, since std.array already define > > range primitives for arrays, I tried to implement array primiti

Re: Templates - Numeric Types only

2009-08-07 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Jarrett Billingsley wrote: > > On Thu, Aug 6, 2009 at 9:53 PM, Andrei > > Alexandrescu wrote: > >> Jarrett Billingsley wrote: > >>> On Thu, Aug 6, 2009 at 9:19 PM, Andrei > >>> Alexandrescu wrote: > Kevin wrote: > > Hi, > > simple Question: > > Is it p

Re: delete and references?

2009-08-07 Thread Jeremie Pelletier
Jarrett Billingsley Wrote: > On Fri, Aug 7, 2009 at 1:20 PM, Aaron Watters wrote: > > Hi guys.  D looks cool.  A couple of things confuse me. > > The first is: what happens if I do a > > > > delete cl; > > > > after storing a reference to cl somewhere?  Can I use the stored > > reference?  Is it i

Re: delete and references?

2009-08-08 Thread Jeremie Pelletier
Jarrett Billingsley Wrote: > On Sat, Aug 8, 2009 at 9:42 AM, Andrei > Alexandrescu wrote: > > Jarrett Billingsley wrote: > >> > >> On Sat, Aug 8, 2009 at 9:17 AM, Andrei > >> Alexandrescu wrote: > >>> > >>> FWIW, I am trying to convince Walter to not reclaim memory in delete, but > >>> instead onl

Re: delete and references?

2009-08-08 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Michel Fortin wrote: > > On 2009-08-08 09:17:28 -0400, Andrei Alexandrescu > > said: > > > >> Great description. > >> > >> FWIW, I am trying to convince Walter to not reclaim memory in delete, > >> but instead only call destructors. D continues C++'s mistake of >

Re: delete and references?

2009-08-08 Thread Jeremie Pelletier
bearophile Wrote: > Jeremie Pelletier: > >It's impossible to know if a pointer is unique without scanning the entire > >heap and pausing all threads to scan their stacks.< > > Are you saying this after reading Bartoz blog posts? > > Bye, > bearophile No I haven't, do you have a link?

unittext extension proposal

2009-08-08 Thread Jeremie Pelletier
I just had an idea to help keep track of unittests, right now we're turning on printf's at the beginning of a test to know which one fails, and adding printfs everywhere quickly becomes redundant. Also if the test succeeds and execution fails at some other point, the last printf is then misleadi

Re: Memory allocation problem

2009-08-08 Thread Jeremie Pelletier
bearophile Wrote: > In a small program on Windows XP I have to allocate a large chunk of RAM, > about 1847 MB of RAM. This PC has 2 GB RAM. So I use std.c.stdio.malloc(), > with DMD v1.042 (or v2.031). But it's not able to allocate it, and produces > at runtime: > Error: Access Violation > > A

Re: YAPP - reminder

2009-08-08 Thread Jeremie Pelletier
aarti_pl Wrote: > Hello! > > This is just another reminder about ongoing voting about properties: > > http://www.igsoft.net/dpolls/index.php > > Current results: > > * about 68% of responders want to have special syntax for properties > * from people wanting new syntax most people want C# synt

Compile time code paths

2009-08-08 Thread Jeremie Pelletier
If a function has both an asm and D implementations inside its body, and the D version can be executed at compile time, but the asm one is much faster at runtime. Is it possible to have the compiler use the D code path at compile time (ie to fill in enums and whatnot), and have the asm version a

Re: T[new]

2009-08-09 Thread Jeremie Pelletier
bearophile Wrote: > grauzone: > > > I see two things a dotnet implementation of D could have over native D: > > - better garbage collector (the D one barely does its job...) > > The dotnet GC is probably better than the current D GC, but I think it's > designed for mostly movable objects. Curre

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Jeremie Pelletier
Daniel Keep Wrote: > > > Andrei Alexandrescu wrote: > > Michel Fortin wrote: > >> On 2009-08-09 11:10:48 -0400, Andrei Alexandrescu > >> said: > >> > It's also arguable that all functions in std.string should take > const(char)[]. Or, you know, const(T)[], since D supports encodings >

Re: unittext extension proposal

2009-08-10 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Leandro Lucarella wrote: > > Sergey Gromov, el 10 de agosto a las 16:32 me escribiste: > >> Sat, 08 Aug 2009 17:32:30 -0400, Jeremie Pelletier wrote: > >> > >>> I just had an idea to help keep track of unittests, right now

Re: Compile time code paths

2009-08-10 Thread Jeremie Pelletier
David Gileadi Wrote: > Daniel Keep wrote: > > Jeremie Pelletier wrote: > >> If a function has both an asm and D implementations inside its body, and > >> the D version can be executed at compile time, but the asm one is much > >> faster at runtime. Is it pos

Re: Unit test practices in Phobos

2009-08-10 Thread Jeremie Pelletier
Lars T. Kyllingstad Wrote: > I just filed a bug report (3240) that describes a case where IFTI is > used in Phobos, and where this causes errors when the function is used > with a different type than the one used in the unittest. (The well known > "IFTI doesn't work with implicit conversions" p

Re: T[new]

2009-08-10 Thread Jeremie Pelletier
Lars T. Kyllingstad Wrote: > Walter Bright wrote: > > Lars T. Kyllingstad wrote: > >> I've always wondered: Why are strings of type immutable(char)[], and > >> not immutable(char[])? > > > > So: > > > >string a = "hello"; > >a = "foo"; > > > > works. > > > Ah, of course. :) Thanks. >

Re: Memory allocation problem

2009-08-10 Thread Jeremie Pelletier
bearophile Wrote: > Robert Fraser: > > I agree it's a bug, and probably a rather major one. However in a real > > use case, any program that needs 1800+ MB arrays should be 64-bit only. > > In that program there's essentially just that large array. > What is the size of biggest array you suggest

Re: Unit test practices in Phobos

2009-08-10 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Jeremie Pelletier wrote: > > Lars T. Kyllingstad Wrote: > > > >> I just filed a bug report (3240) that describes a case where IFTI is > >> used in Phobos, and where this causes errors when the function is used > >> with

Re: reddit.com: first Chapter of TDPL available for free

2009-08-10 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Steven Schveighoffer wrote: > > On Mon, 03 Aug 2009 18:00:59 -0400, Andrei Alexandrescu > > wrote: > > > >> http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ > >> > >> > >> > >> (Don't tell anyone, but I plan to rewrit

Re: Unit test practices in Phobos

2009-08-10 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Jeremie Pelletier wrote: > > Andrei Alexandrescu Wrote: > > > >> Jeremie Pelletier wrote: > >>> Lars T. Kyllingstad Wrote: > >>> > >>>> I just filed a bug report (3240) that describes a case where IFTI i

Re: GPU/CPU roadmaps

2009-08-10 Thread Jeremie Pelletier
davidl Wrote: > ÔÚ Tue, 11 Aug 2009 08:54:07 +0800£¬bearophile > дµÀ: > > > D2/D3 may become a good language to create video games, this is a new > > interesting document that shows some of the things D2 users may want to > > use it for: > > http://graphics.cs.williams.edu/archive/Sweeney

Re: GPU/CPU roadmaps

2009-08-11 Thread Jeremie Pelletier
language_fan Wrote: > Tue, 11 Aug 2009 00:37:46 -0400, Jeremie Pelletier thusly wrote: > > > I wouldn't be surprised to see major games releases built in D in a few > > years. > > It's quite optimistic to think that the toolchain will be usable and > robu

Re: Compile time code paths

2009-08-11 Thread Jeremie Pelletier
Don Wrote: > Jeremie Pelletier wrote: > > David Gileadi Wrote: > > > >> Daniel Keep wrote: > >>> Jeremie Pelletier wrote: > >>>> If a function has both an asm and D implementations inside its body, and > >>>> the D version can b

Re: Explicitly saying ref or out when invoking a function

2009-08-11 Thread Jeremie Pelletier
Ary Borenszweig Wrote: > In C# when you define a function that takes an out or ref parameter, > when invoking that function you must also specify ref or out. For example: > > void fun(ref uint x, double y); > > uint a = 1; > double b = 2; > fun(ref a, b); > > When I first started using C# it r

shared class constructor

2009-08-13 Thread Jeremie Pelletier
Just came across this while porting my code to enforce the use of shared. --- module test; shared class Foo { this() {} } --- Error: cannot implicitly convert expression (this) of type shared(Foo) to test.Foo Of course I could just use new shared(Foo) but that would allow non-shared instance

Re: I don't think this is a bug but...

2009-08-14 Thread Jeremie Pelletier
Jesse Phillips Wrote: > Benjamin Shropshire Wrote: > > > The same expression twice gets different results > > > > code: > > > > import std.stdio; > > > > bool Fn(float i){ return true; } > > const bool b = Fn(cast(int)0); > > > > static if(b) bool Fn(int i){ return false; } > > const bool c =

Re: I don't think this is a bug but...

2009-08-14 Thread Jeremie Pelletier
BCS Wrote: > Reply to Jesse, > > > Benjamin Shropshire Wrote: > > > >> The same expression twice gets different results > >> > >> code: > >> > >> import std.stdio; > >> > >> bool Fn(float i){ return true; } > >> const bool b = Fn(cast(int)0); > >> static if(b) bool Fn(int i){ return false; }

Re: The future of D 1.x

2009-08-15 Thread Jeremie Pelletier
Dominik Wrote: > Is there any or there will be a "big switch" to 2.x once it is considered > final/stable? I already made the switch to D2 almost a year ago, and definitely wont be going back to D1. I didn't need to make many changes to my custom runtime either, the ABI between the two versio

Re: The future of D 1.x

2009-08-16 Thread Jeremie Pelletier
Dominik Wrote: > > "Lutger" wrote in message > news:h68ngs$1ef...@digitalmars.com... > > Though they overlap, phobos and tango do have different scopes and > > somewhat > > different programming styles. > > I understand taht completeley. I was more making a general statement that > one of th

Re: It's awfully quiet

2009-08-17 Thread Jeremie Pelletier
Paul D. Anderson Wrote: > It's awfully quiet on the newsgroup today. Does that mean Walter is busy > getting the new release ready? > > Or does it only mean I'm not getting new posts :( > > Suspiciously, > > Paul It IS awfully quiet this week. I hope a new release is soon, I can't wait for

Re: It's awfully quiet

2009-08-17 Thread Jeremie Pelletier
Jason House Wrote: > Jeremie Pelletier Wrote: > > > Paul D. Anderson Wrote: > > > > > It's awfully quiet on the newsgroup today. Does that mean Walter is busy > > > getting the new release ready? > > > > > > Or does it only m

Re: OT - Which Linux?

2009-08-19 Thread Jeremie Pelletier
Jason House Wrote: > Paul D. Anderson Wrote: > > > I'm going to add Linux to my PC to get a dual-boot configuration. (I'm > > tired of slw start ups and want to tap into the great tools available.) > > The tutorial I'm looking at suggests Ubuntu. Is there a significant > > difference in Li

Reference value of structs not optimized or inlined?

2009-08-26 Thread Jeremie Pelletier
I just noticed that when a method has a ref parameter for a struct, it doesn't get inlined: union Matrix4x4 { struct { float _11, _12, ...} float[4][4] m; float[16] v; Matrix4x4 opMul(const ref Matrix4x4 m) const { ... } void opMulAssign(const ref Matrix4x4 m) { this = opMul(

Re: Reference value of structs not optimized or inlined?

2009-08-26 Thread Jeremie Pelletier
Bill Baxter Wrote: > On Wed, Aug 26, 2009 at 11:01 AM, Jeremie Pelletier wrote: > > I just noticed that when a method has a ref parameter for a struct, it > > doesn't get inlined: > > Here's the bug you want to vote up: > > http://d.puremagic.com/issues/sho

Re: Reference value of structs not optimized or inlined?

2009-08-26 Thread Jeremie Pelletier
Jeremie Pelletier Wrote: > Bill Baxter Wrote: > > > On Wed, Aug 26, 2009 at 11:01 AM, Jeremie Pelletier > > wrote: > > > I just noticed that when a method has a ref parameter for a struct, it > > > doesn't get inlined: > > > &

Re: Reference value of structs not optimized or inlined?

2009-08-26 Thread Jeremie Pelletier
bearophile Wrote: > Jeremie Pelletier: > > > Just to stress out how important this is; I have a small loop calculating a > > 3x2 rotation matrix used with either Direct2D or Cairo every 10ms which > > transform the text "Hello World" in a window. CPU usag

Does dmd have SSE intrinsics?

2009-08-26 Thread Jeremie Pelletier
While writing SSE assembly by hand in D is fun and works well, I'm wondering if the compiler has intrinsics for its instruction set, much like xmmintrin.h in C. The reason is that the compiler can usually reorder the intrinsics to optimize performance. I could always use C code to implement my

Re: Reference value of structs not optimized or inlined?

2009-08-27 Thread Jeremie Pelletier
Walter Bright Wrote: > Jeremie Pelletier wrote: > > Isn't there a way to implement RVO to work on parameters (PVO?) too > > if the storage is const? > > No, and it doesn't work for C++ either. Consider: > > struct S { int a; } > > void foo(const ref S

Re: Reference value of structs not optimized or inlined?

2009-08-28 Thread Jeremie Pelletier
downs Wrote: > Walter Bright wrote: > > Jeremie Pelletier wrote: > >> Isn't it possible to make 'const ref S' or 'in S' generate the same > >> machine code as 'in S*'? To me it would seem the semantics of the two > >>

Re: Reference value of structs not optimized or inlined?

2009-08-29 Thread Jeremie Pelletier
Walter Bright Wrote: > Ary Borenszweig wrote: > > Walter Bright escribió: > >> Ary Borenszweig wrote: > >>> Walter Bright escribió: > There are a lot of D specific optimization opportunities that are > left undone for now. > >>> Why? > >> > >> Which of the thousand things people want do

Re: OT: What's your favorite codeline?

2009-08-29 Thread Jeremie Pelletier
Manfred_Nowak Wrote: > incognito wrote: > > > foreach(Problem p; World.problems) find_answer_to(p); > > > > It just always seems to get stuck. > > ... because it doesn't have `World.plan' to its disposal. You are lacking a world context, cultural semantics, a problem solver, and a very very l

Re: How Nested Functions Work, part 1

2009-08-30 Thread Jeremie Pelletier
Walter Bright Wrote: > http://www.reddit.com/r/programming/comments/9fk6g/how_nested_functions_work_part_1/ I really like the way nested functions and closures are done in D. Especially because they are the same thing as delegate and closures. But speaking of closures, I did notice something th

Re: const and immutable objects

2009-08-30 Thread Jeremie Pelletier
Graham St Jack Wrote: > I have been trying (again) to start using const and immutable objects in > a project, and found I kept getting stuck with the need to change the > value of object references, which isn't allowed. I don't quite follow the > arguments that mean that this has to be the case

Re: How Nested Functions Work, part 1

2009-08-30 Thread Jeremie Pelletier
Jarrett Billingsley Wrote: > On Sun, Aug 30, 2009 at 9:00 PM, Jeremie Pelletier wrote: > > Walter Bright Wrote: > > > >> http://www.reddit.com/r/programming/comments/9fk6g/how_nested_functions_work_part_1/ > > > > I really like the way nested functions and clo

Re: How Nested Functions Work, part 1

2009-08-31 Thread Jeremie Pelletier
Walter Bright Wrote: > That's very nice, could you post that on reddit? Just did, I even changed "D" to "the D programming language" because I know you like it for search engine referencing :) http://www.reddit.com/r/programming/comments/9fk6g/how_nested_functions_work_part_1/c0cm3bk

Re: const and immutable objects

2009-08-31 Thread Jeremie Pelletier
Graham St Jack Wrote: > On Sun, 30 Aug 2009 21:28:18 -0400, Jeremie Pelletier wrote: > > > > I agree that D lacks a mechanism to separate the object from it's > > reference. Maybe syntax like the following could be used to apply the > > storage class to the obj

Re: [OT] Haxe "if" context-sensitive? (Q for Grammar Experts)

2009-08-31 Thread Jeremie Pelletier
Nick Sabalausky Wrote: > "Nick Sabalausky" wrote in message > news:h7fl1o$f8...@digitalmars.com... > > I've been trying to make a grammar for the Haxe langauge, and I've been > > having a hell of a time emulating it's expression-based if/if-else (as > > opposed to statement-based as in D). I'm

Re: How Nested Functions Work, part 1

2009-08-31 Thread Jeremie Pelletier
Walter Bright Wrote: > language_fan wrote: > > This seems more like an advertisement of D than practical new information > > for compiler construction. Nesting functions is the basic feature of > > functional languages. Moreover even procedural Algol based languages such > > as Pascal have alwa

Re: const and immutable objects

2009-08-31 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Jeremie Pelletier wrote: > > Graham St Jack Wrote: > > > >> On Sun, 30 Aug 2009 21:28:18 -0400, Jeremie Pelletier wrote: > >> > >> > >>> I agree that D lacks a mechanism to separate the object from it's

Re: const and immutable objects

2009-08-31 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Jeremie Pelletier wrote: > > Graham St Jack Wrote: > > > >> On Sun, 30 Aug 2009 21:28:18 -0400, Jeremie Pelletier wrote: > >> > >> > >>> I agree that D lacks a mechanism to separate the object from it's

Re: How Nested Functions Work, part 1

2009-08-31 Thread Jeremie Pelletier
Walter Bright Wrote: > language_fan wrote: > > For what it's worth, they also seem somewhat buggy in D. Hopefully > > writing the articles motivates fixing those issues :) For example one > > can't call symbols before their declaration on non-global scope. > > That's actually not a bug. In func

Re: How Nested Functions Work, part 1

2009-08-31 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Jarrett Billingsley wrote: > > On Mon, Aug 31, 2009 at 1:14 PM, Walter > > Bright wrote: > >> Thanks! > >> > > > > I don't mean to pull a Stewart, but please be sure to quote a bit of > > the post you're responding to. If you don't, it's virtually impossible > > to te

Re: Grand Central Dispatch & Blocks in Apple's C

2009-09-01 Thread Jeremie Pelletier
Michel Fortin Wrote: > > Plus, they have OpenCL. I've seen about a half dozen OpenCL examples > > specifically for non-Mac machines, but none bother to tell you how to > > actually GET an OpenCL implementation, or if they're even available. *sigh* > > OpenCL is Apple's baby, no wonder they're a

Re: Apple Blocks added to C++?

2009-09-02 Thread Jeremie Pelletier
Michel Fortin Wrote: > On 2009-09-02 00:27:46 -0400, S. said: > > > Been awhile since I posted. > > > > I was wondering what other people thought about this addition to C++ by > > Apple. Heh. > > > > http://arstechnica.com/apple/reviews/2009/08/mac-os-x-10-6.ars/10 > > I don't find the syn

Re: How Nested Functions Work, part 1

2009-09-02 Thread Jeremie Pelletier
Nick Sabalausky Wrote: > "Jeremie Pelletier" wrote in message > news:h7h5i1$5m...@digitalmars.com... > > > > While D is not the first place I see closures and nested functions, it is > > the first language I come across that blends delegates, closures and

Re: Nullable or Optional? Or something else?

2009-09-02 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > I plan to add a Nullable struct to Phobos (akin to C#'s Nullable, > Boost's Optional). > > Apparently a good design is to define Optional!T with a minimum of > member functions (ideally none) and have it use the "alias this" feature > to masquerade as a T. That way

Re: dmd 1.047 and 2.032 releases

2009-09-03 Thread Jeremie Pelletier
Brad Roberts Wrote: > Walter Bright wrote: > > This will probably be the last OSX 10.5 release, the next should be 10.6. > > > > http://www.digitalmars.com/d/1.0/changelog.html > > http://ftp.digitalmars.com/dmd.1.047.zip > > > > > > http://www.digitalmars.com/d/2.0/changelog.html > > http://ft

Re: The Linker is not a Magical Program

2009-09-03 Thread Jeremie Pelletier
Walter Bright Wrote: > A rant I wrote a few months ago: > > http://programmer.97things.oreilly.com/wiki/index.php/The_Linker_Is_not_a_Magical_Program Great read, reminded me of my first weeks in C/C++ land, back when I couldn't tell the compiler from the linker :) These days only the OMF form

Re: The Linker is not a Magical Program

2009-09-03 Thread Jeremie Pelletier
Walter Bright Wrote: > Jeremie Pelletier wrote: > > Now if I only can find enough documentation about OMF to write a COFF > > to OMF converter.. > > > http://www.azillionmonkeys.com/qed/Omfg.pdf Sweet, you're the man Walter!

Compiled dmd2.032 in VC++ 2009!

2009-09-03 Thread Jeremie Pelletier
Well I've decided to get a look at the dmd2 source and see what I can contribute to it, only to notice it is very VC++ unfriendly. After a few hours of work, I finally got it to compile, and it works great, for the most part. VC++ has no real support for long double; it supports the syntax as di

Re: The Linker is not a Magical Program

2009-09-03 Thread Jeremie Pelletier
Christopher Wright Wrote: > Walter Bright wrote: > > A rant I wrote a few months ago: > > > > http://programmer.97things.oreilly.com/wiki/index.php/The_Linker_Is_not_a_Magical_Program > > > > For reference, GNU ld has to be compiled with -linvisible-pink-unicorn. How can you know its pink if

Re: Compiled dmd2.032 in VC++ 2009!

2009-09-04 Thread Jeremie Pelletier
Jason House Wrote: > Don Wrote: > > > Interestingly since DMD has extern(C++), it ought to be possible to > > convert a single module to D, and still link it in... > > extern(C++) support in D is nearly a joke. There are some big areas for > improvement, such as support for non-virtual functio

Re: Compiled dmd2.032 in VC++ 2009!

2009-09-04 Thread Jeremie Pelletier
Jarrett Billingsley Wrote: > On Fri, Sep 4, 2009 at 10:22 AM, Jeremie Pelletier wrote: > > Jason House Wrote: > > > >> Don Wrote: > >> > >> > Interestingly since DMD has extern(C++), it ought to be possible to > >> > convert a singl

Re: Compiled dmd2.032 in VC++ 2009!

2009-09-04 Thread Jeremie Pelletier
Don Wrote: > Jeremie Pelletier wrote: > > Well I've decided to get a look at the dmd2 source and see what I can > > contribute to it, only to notice it is very VC++ unfriendly. After a > > few hours of work, I finally got it to compile, and it works great, > > for

Re: Compiled dmd2.032 in VC++ 2009!

2009-09-05 Thread Jeremie Pelletier
Walter Bright Wrote: > Jeremie Pelletier wrote: > > Well I've decided to get a look at the dmd2 source and see what I can > > contribute to it, only to notice it is very VC++ unfriendly. After a > > few hours of work, I finally got it to compile, and it works gr

Re: Compiled dmd2.032 in VC++ 2009!

2009-09-05 Thread Jeremie Pelletier
Jeremie Pelletier Wrote: > Walter Bright Wrote: > > > Jeremie Pelletier wrote: > > > Well I've decided to get a look at the dmd2 source and see what I can > > > contribute to it, only to notice it is very VC++ unfriendly. After a > > > few hours of wor

Re: Compiled dmd2.032 in VC++ 2009!

2009-09-05 Thread Jeremie Pelletier
bearophile Wrote: > Jeremie Pelletier: > > I also made a simple D script to rename all c files to cpp: > > Generally I suggest to use a scripting language to do a similar task (or a > simper linux shell script, probably one or two lines), but I agree that doing > this

Re: Compiled dmd2.032 in VC++ 2009!

2009-09-05 Thread Jeremie Pelletier
div0 Wrote: > Jeremie Pelletier wrote: > > > Sweet. If dmd can compile w/ VS outa the box, I'll start poking around > in it. Hey you can knock mirco-soft all you like, but VS is the nuts. Yeah, I side with you here. I may not be a fan of the business model Microsoft uses,

Re: D naming style?

2009-09-05 Thread Jeremie Pelletier
bearophile Wrote: > Jarrett Billingsley: > > I'm consistently confused by D (and Java and C#) code that doesn't > > indicate member names, especially when they're named really common > > things that often conflict with local variables, like "len" or "src" > > or such. Unless the type is small enou

Re: D naming style?

2009-09-05 Thread Jeremie Pelletier
Michel Fortin Wrote: > On 2009-09-04 21:07:01 -0400, Jarrett Billingsley > said: > > > On Fri, Sep 4, 2009 at 8:42 PM, Ali Cehreli wrote: > >> Is there a common(-ish) naming style for D? > >> > >> - camel case or underscores within words of names? > >> > >> - type names begin with capital? >

Re: Compiled dmd2.032 in VC++ 2009!

2009-09-05 Thread Jeremie Pelletier
Rainer Deyke Wrote: > Jeremie Pelletier wrote: > > bearophile Wrote: > >> - if(de.name[$-2 .. $] == ".c") is a bit unsafe, (...) > > I don't see how unsafe that is in this context. > > Potential buffer underrun. > http://www.digitalmars.com/d/1.0

Re: Compiled dmd2.032 in VC++ 2009!

2009-09-06 Thread Jeremie Pelletier
div0 Wrote: > Jeremie Pelletier wrote: > > div0 Wrote: > >> Jeremie Pelletier wrote: > >> > >> > >> Sweet. If dmd can compile w/ VS outa the box, I'll start poking around > >> in it. Hey you can knock mirco-soft all you like, but VS is th

Re: D 2.00 official spec

2009-09-06 Thread Jeremie Pelletier
Justin Johansson Wrote: > Having trolled all over DM site in search for an official D 2.0 spec similar > to that as exists for D 1.0 (spec_DMD_1.00.pdf), I seem to be out of luck. > > Does such a document exist and would someone please point me to it? > > Thanks for all help. > D2 is still in

Re: Template Metaprogramming Made Easy (Huh?)

2009-09-08 Thread Jeremie Pelletier
Justin Johansson Wrote: > I really really hope that my current excitement with D continues and that > another 30-60 days down the track I don't end up becoming disillusioned with > D as I did with Scala. > > -- Justin Johansson I've been using D for over 2 years now, and my excitement about it

Re: Compiled dmd2.032 in VC++ 2009!

2009-09-08 Thread Jeremie Pelletier
negerns Wrote: > Jeremie, > > I tried compiling the sources using VS2008 SP1. I did run into some of > what you mentioned but got stuck midway. Could you elaborate on how you > dealt with the missing header #ifndef _MSC_VER #include #endif You don't need this header on VS.

Re: Compiled dmd2.032 in VC++ 2009!

2009-09-09 Thread Jeremie Pelletier
negerns Wrote: > I ran into the __pascal calling convention. VS2008 no longer support > > The __pascal calling convention is no longer supported in VS2008. How > did you resolve this? I assumed these were remainders of older code, and removed the __pascal from both the prototypes and declarati

Re: Modern Windows GUI visual styles

2009-09-09 Thread Jeremie Pelletier
Valery Wrote: > Recently I spent a few hours to find a way to enable a new styles of Windows > XP controls from the code (without manual created external manifest files, > resource files, ...). The only solution I found in DFL library and it looks > quite complicated. > > Maybe should create t

Re: Template Metaprogramming Made Easy (Huh?)

2009-09-10 Thread Jeremie Pelletier
Justin Johansson Wrote: > 5. Newcomers to the language will find it's type system concepts overwhelming > - co-variance and contra-variance etc. (don't know how D2 will address this > better though). Yes these issues are important for OO libraries but feel > there must be a more practical way o

shared adventures in the realm of thread-safety.

2009-09-11 Thread Jeremie Pelletier
I decided to play once again with shared and see what 2.032 is capable of. Turns out a lot of the previous issues I was having last time are gone, however, there are still a few things left which prevent me from rewriting my code. The first issue that jumped to my face straight away was how 'sh

Re: shared adventures in the realm of thread-safety.

2009-09-13 Thread Jeremie Pelletier
Jason House Wrote: > I'm glad to see I'm not the only one trying to use shared. I tried to use it > with 2.031 and rapidly hit bug after bug... I submitted several bug reports > for basic functionality, and none of it appeared in the changelog. > > http://d.puremagic.com/issues/show_bug.cgi?id=

Re: shared adventures in the realm of thread-safety.

2009-09-13 Thread Jeremie Pelletier
Graham St Jack Wrote: > I'm also having the same problems. > > As Jeremie said, as soon as you start introducing shared methods (via > synchronized for example), you rapidly get into trouble that can only be > overcome by excessive casting. > > It may be possible to contain the problem by refa

Re: shared adventures in the realm of thread-safety.

2009-09-13 Thread Jeremie Pelletier
Robert Jacques Wrote: > On Sun, 13 Sep 2009 15:04:57 -0400, Jeremie Pelletier > wrote: > [snip] > > Unique data could only be used for aggregate properties, const/immutable > > data would also be implicitly unique. This qualifier alone would > > simplify share

Re: Template Metaprogramming Made Easy (Huh?)

2009-09-13 Thread Jeremie Pelletier
bearophile Wrote: > Justin Johansson: > > >would you mind saying what salient things there are about D that presumably > >attracts to the language. It just helps to know why others are here as one > >ventures into new territory.< > > That's not an easy question. This is a personal answer, oth

Re: Template Metaprogramming Made Easy (Huh?)

2009-09-13 Thread Jeremie Pelletier
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 m

Re: Template Metaprogramming Made Easy (Huh?)

2009-09-13 Thread Jeremie Pelletier
Tom S Wrote: > 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

Re: Template Metaprogramming Made Easy (Huh?)

2009-09-13 Thread Jeremie Pelletier
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. &g

Re: Template Metaprogramming Made Easy (Huh?)

2009-09-14 Thread Jeremie Pelletier
Nick B Wrote: > Jeremie Pelletier wrote: > > Tom S Wrote: > > > >> Jeremie Pelletier wrote: > >>> Tom S Wrote: > >>> > >>>> Jeremie Pelletier wrote: > >>>>> I myself allocate all my meshes and textures directly

Re: shared adventures in the realm of thread-safety.

2009-09-14 Thread Jeremie Pelletier
Robert Jacques Wrote: > On Sun, 13 Sep 2009 18:08:57 -0400, Jeremie Pelletier > wrote: > > > Robert Jacques Wrote: > > > >> On Sun, 13 Sep 2009 15:04:57 -0400, Jeremie Pelletier > >> > >> wrote: > >> [snip] > >> >

Re: Template Metaprogramming Made Easy (Huh?)

2009-09-14 Thread Jeremie Pelletier
Lutger Wrote: > language_fan wrote: > > > Mon, 14 Sep 2009 07:33:59 -0400, bearophile thusly wrote: > > > >> But lot of people will judge D against more modern languages like C#, > >> Scala or Java) and not against C. > > > > Programmers often belong to three kinds of groups. First come the fan

Re: Compile-time AAs

2009-09-15 Thread Jeremie Pelletier
Don Wrote: > bearophile wrote: > > Don has recently said that adding dynamic arrays at compile-time looks > > easy. I'd also like to have compile-time associative arrays. So you can > > fill them inside a CT function (the compiler may try to do the same for AAs > > created inside a static this(

Re: Type unions in D

2009-09-15 Thread Jeremie Pelletier
Justin Johansson Wrote: > What's the best way of emulating a system of quantified type unions in D > (D1)? > > By type unions (sometimes called algebraic sums in the literature), I don't > mean the C/C++ "union" facility. > > Suppose there is some class X, I'd like to have a first class type

  1   2   3   4   >