Re: DSO with DMD 2.052 on Linux?

2011-05-03 Thread Jacob Carlborg
On 2011-05-02 23:10, Jonathan M Davis wrote: Is dynamic linking supported on Linux with DMD 2.052 (and D2 in general)? I am not talking about Phobos, just modules which I want to compile as DSO. There is -fPIC switch to DMD - does it work as intended? PS: gdc is not an option... The short

Re: A few general thoughts

2011-05-03 Thread lenochware
== Quote from KennyTM~ (kenn...@gmail.com)'s article It's very *unportable* to write a string in your way. Yes, that's probably true. If D allowed non-UTF encoding without error, it's possible that a string in those settings got misinterpreted, but it's not easy to determine when. Could be

Re: DSO with DMD 2.052 on Linux?

2011-05-03 Thread Alexander
On 03.05.2011 09:15, Jacob Carlborg wrote: This is a showstopper for shared libraries on Linux: http://d.puremagic.com/issues/show_bug.cgi?id=4583 A few things in the runtime need to be changed as well. OK, I see. But isn't simple linking to DSO (no dlopen calls) should be handled by the

Context sensitivity

2011-05-03 Thread bearophile
I was away. This is D code adapted from a blog post about C language: http://eli.thegreenplace.net/2011/05/02/the-context-sensitivity-of-c%E2%80%99s-grammar-revisited/ http://www.reddit.com/r/programming/comments/h23h3/the_context_sensitivity_of_cs_grammar_revisited/ Three little D2 programs

Re: std.parallelism is accepted into Phobos (OT)

2011-05-03 Thread Bruno Medeiros
On 27/04/2011 07:13, Russel Winder wrote: For people who have full-time jobs and therefore secure income who use some of their work time or spare time to work on projects such as D, there is the safety of having secure income. For those of us who have no full-time job it is a matter of all time

Re: Executable semantics in C

2011-05-03 Thread Bruno Medeiros
On 27/04/2011 22:20, Timon Gehr wrote: Quiz: What does the following code compute? import std.stdio; import core.exception; void main(){ int a,b; int[int] aa; scanf(%d %d,a,b); try{aa[a]=aa[b];printf(Y\n);}catch(RangeError){printf(N\n);} } What was your point

Re: Linus with some good observations on garbage collection

2011-05-03 Thread Bruno Medeiros
On 29/04/2011 17:30, Andrei Alexandrescu wrote: On 4/29/11 10:40 AM, Bruno Medeiros wrote: On 23/04/2011 15:45, Andrei Alexandrescu wrote: On 4/23/11 8:57 AM, dsimcha wrote: BTW, since when does the ternary operator work with functions, as opposed to variables? And that's since the C days

Re: DSO with DMD 2.052 on Linux?

2011-05-03 Thread Jacob Carlborg
On 2011-05-03 11:14, Alexander wrote: On 03.05.2011 09:15, Jacob Carlborg wrote: This is a showstopper for shared libraries on Linux: http://d.puremagic.com/issues/show_bug.cgi?id=4583 A few things in the runtime need to be changed as well. OK, I see. But isn't simple linking to DSO (no

Re: Ceylon language

2011-05-03 Thread Bruno Medeiros
On 13/04/2011 13:34, bearophile wrote: The first description of the Ceylon language, designed for business computing (for large teams developing multi-user applications) and meant to replace Java, from Red Hat, that will run on the Java Virtual Machine itself:

Re: OOP, faster data layouts, compilers

2011-05-03 Thread bearophile
Sean Cavanaugh: In many ways the biggest thing I use regularly in game development that I would lose by moving to D would be good built-in SIMD support. Don has given a nice answer about how D2 plans to face this. To focus more what Don was saying I think a small exaple will help. This is a C

Re: Linus with some good observations on garbage collection

2011-05-03 Thread Jérôme M. Berger
Bruno Medeiros wrote: On 29/04/2011 17:30, Andrei Alexandrescu wrote: On 4/29/11 10:40 AM, Bruno Medeiros wrote: On 23/04/2011 15:45, Andrei Alexandrescu wrote: On 4/23/11 8:57 AM, dsimcha wrote: BTW, since when does the ternary operator work with functions, as opposed to variables? And

Re: too early for D2 and too late for D1

2011-05-03 Thread Jerry
jasonw u...@webmails.org writes: Don't get me wrong, D is already much faster than many toy languages. Faster than Java and C# in some applications. What's relevant is that the C/C++/Fortran users will only switch if D provides concrete performance improvements over their *existing*

Re: too early for D2 and too late for D1

2011-05-03 Thread Walter Bright
On 5/3/2011 7:58 PM, Jerry wrote: I would challenge this statement somewhat. I do high-performance programming in C++. I don't expect D compilers to generate faster code than C++, but to rather that they will achieve parity. What I do expect is that D will make it significantly easier to

Re: too early for D2 and too late for D1

2011-05-03 Thread dsimcha
On 5/3/2011 10:58 PM, Jerry wrote: What I do expect is that D will make it significantly easier to write and maintain this fast code. That is worth quite a bit. Developer time is important even when writing high-performance code. +1000. IMHO one of D's biggest accomplishments is how far it

Re: too early for D2 and too late for D1

2011-05-03 Thread Adam D. Ruppe
Walter Bright wrote: My experience in tuning D code for speed is that if you write C++ code in D, you will get the same performance as C++. However, D makes it a *lot* easier to reorganize/refactor code to try and make it run faster, and this makes for better algorithms and hence faster code.

Re: Difference between stack-allocated class and struct

2011-05-03 Thread Sean Cavanaugh
Here is my prototype COM compile-time reflection based wrapper mixin (which I have abandoned in favor of alias this since it covers 95% of my use cases even though it isn't perfectly safe). I am new at D so you have been warned, though this part of the language seems pretty straightforward

Four things

2011-05-03 Thread bearophile
Do you know if the following four problems are already present in Bugzilla? I don't remember (the only problem I am more sure is not present in Bugzilla is the missed priting in the first program). import std.algorithm, std.stdio; void main() { int[int] hash =

Re: traits and class protection

2011-05-03 Thread Lutger Blijdestijn
Adam D. Ruppe wrote: Is there a way in today's D to exclude members marked private and protected from processing in the __traits(allMembers) family of functions? I thought if I at least put it in a separate module, trying to get a private member would fail to compile, but I tried it and

Re: Linux: How to statically link against system libs?

2011-05-03 Thread Lutger Blijdestijn
Alexander wrote: On 29.04.2011 11:41, Spacen Jasset wrote: You still *cannot* link statically to kernel32.dll. That's the difference. Linux glibc contains the C library functions *and* the syscalls, which is the bit that causes the problems. But at least I know, that no matter where I

Re: Linux: How to statically link against system libs?

2011-05-03 Thread Alexander
On 03.05.2011 16:29, Lutger Blijdestijn wrote: A syscall is generally understood to be a call into the kernel for doing something that can't be done with user level privileges. Not really. syscalls are interface of user space to the OS kernel, and obviously, they can be made with user

Re: Four things

2011-05-03 Thread Andrej Mitrovic
On 5/3/11, bearophile bearophileh...@lycos.com wrote: struct Foo { int x; this(int xx) { this.x = xx; } } void main() { enum f = Foo(10); } Perhaps a relevant bug is where a struct-typed enum doesn't call the struct ctor if it has one, but uses field-by-field

Coroutines in D

2011-05-03 Thread Andrej Mitrovic
I'm trying to figure out how to use coroutines in D. First, I think I've run into some kind of bug. I've followed this C++ example: http://www.subatomicglue.com/secret/coro/readme.html, and came up with this: import std.stdio; import core.thread; void fiberFunc(size_t arg) { int i = 0;

Re: Coroutines in D

2011-05-03 Thread Andrej Mitrovic
Ok,I've found a post that could be useful: http://www.digitalmars.com/d/archives/digitalmars/D/yield_C_etc_74821.html and there's a Generator mixin in generators.d, from the libs_d library: http://www.fantascienza.net/leonardo/so/index.html I'll give these a try soon.

std.parallism

2011-05-03 Thread jdrewsen
Hi, Does anyone know how unshared parameters are handled when executing a task in std.parallelism. Most of the examples uses them e.g. when iterating over an unshared array (parallelSort example). I did give the source a quick look but couldn't find a cast to shared for parameters

Re: Coroutines in D

2011-05-03 Thread Robert Clipsham
On 03/05/2011 19:06, Andrej Mitrovic wrote: I'm trying to figure out how to use coroutines in D. First, I think I've run into some kind of bug. I've followed this C++ example: http://www.subatomicglue.com/secret/coro/readme.html, and came up with this: I'm not entirely sure what it is you

AA.get() problem

2011-05-03 Thread bearophile
This gives me compilation errors, is this a bug, or is my code wrong? import std.stdio; void main() { string[char] tab = ['e': red, 'b': blue]; string r; foreach (c; aba) { // if (c in tab) r ~= tab[c]; // OK r ~= tab.get(c, ); // ERR } writeln(r); } Thank

[Issue 5919] New: The declaration of static members depend in the order

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5919 Summary: The declaration of static members depend in the order Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Keywords: rejects-valid

[Issue 5920] New: Cannot create std.algorithm.Array of structs with custom destructor (hasElaborateDestructor).

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5920 Summary: Cannot create std.algorithm.Array of structs with custom destructor (hasElaborateDestructor). Product: D Version: D2 Platform: Other OS/Version: Mac OS X

[Issue 5921] New: No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921 Summary: No mismatched nested comments Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: major

[Issue 5923] New: .ptr property is not const for const arrays

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5923 Summary: .ptr property is not const for const arrays Product: D Version: D1 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2

[Issue 5924] New: schwartzSort of Tuple!(char)[]

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5924 Summary: schwartzSort of Tuple!(char)[] Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal

[Issue 5920] Cannot create std.algorithm.Array of structs with custom destructor (hasElaborateDestructor).

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5920 --- Comment #1 from kenn...@gmail.com 2011-05-03 05:49:55 PDT --- Pull request #35. https://github.com/D-Programming-Language/phobos/pull/35 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are

[Issue 5921] No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921 kenn...@gmail.com changed: What|Removed |Added CC||kenn...@gmail.com

[Issue 5920] Cannot create std.algorithm.Array of structs with custom destructor (hasElaborateDestructor).

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5920 Andrei Alexandrescu and...@metalanguage.com changed: What|Removed |Added Status|NEW |ASSIGNED

[Issue 5924] schwartzSort of Tuple!(char)[]

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5924 Andrei Alexandrescu and...@metalanguage.com changed: What|Removed |Added Status|NEW |ASSIGNED

[Issue 5792] Tuple!(real,string) fails

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5792 Andrei Alexandrescu and...@metalanguage.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 5920] Cannot create std.algorithm.Array of structs with custom destructor (hasElaborateDestructor).

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5920 Andrei Alexandrescu and...@metalanguage.com changed: What|Removed |Added Status|ASSIGNED|RESOLVED

[Issue 5921] No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921 --- Comment #2 from bearophile_h...@eml.cc 2011-05-03 09:54:41 PDT --- (In reply to comment #1) Cannot reproduce the error message. Please show your dmd options. I've got Thank you, you are right, I've seen that the error message I see is

[Issue 5921] No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 5921] No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921 --- Comment #4 from bearophile_h...@eml.cc 2011-05-03 10:39:30 PDT --- (In reply to comment #3) Not a dmd issue, marked as invalid. But isn't it a DMD problem still? Maybe we have discussed this same problem in past, but the comments are not

[Issue 5921] No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921 --- Comment #5 from kenn...@gmail.com 2011-05-03 10:58:33 PDT --- (In reply to comment #4) (In reply to comment #3) Not a dmd issue, marked as invalid. But isn't it a DMD problem still? Maybe we have discussed this same problem in past,

[Issue 5664] Cannot compile static synchronized member function.

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5664 wolfwood transmethyl+...@gmail.com changed: What|Removed |Added AssignedTo|nob...@puremagic.com

[Issue 5664] Cannot compile static synchronized member function.

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5664 --- Comment #5 from wolfwood transmethyl+...@gmail.com 2011-05-03 11:40:23 PDT --- fixed in this pull request. https://github.com/D-Programming-Language/dmd/pull/48 (In reply to comment #3) (In reply to comment #2) static sychronized is

[Issue 5921] No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921 --- Comment #6 from Walter Bright bugzi...@digitalmars.com 2011-05-03 12:13:25 PDT --- Kenny's right. This is not a dmd bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail

[Issue 5925] New: Comparing associative array with a storage class (const/shared/immutable) causes segfault

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5925 Summary: Comparing associative array with a storage class (const/shared/immutable) causes segfault Product: D Version: D2 Platform: All OS/Version: All Status: NEW

[Issue 5664] Cannot compile static synchronized member function.

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5664 wolfwood transmethyl+...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 5664] Cannot compile static synchronized member function.

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5664 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added CC|

[Issue 5560] unittests add code size when compiling with -lib and without -unittest

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5560 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added CC|

[Issue 5560] unittests add code size when compiling with -lib and without -unittest

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5560 Steven Schveighoffer schvei...@yahoo.com changed: What|Removed |Added Status|NEW |RESOLVED