Re: Linking C++ standard library works with GDC... but not DMD. (Linux)

2015-04-16 Thread Dicebot via Digitalmars-d-learn
On Thursday, 16 April 2015 at 08:51:15 UTC, TheGag96 wrote: Hi, I've got this project that requires me to link into a C++ backend. It works just fine when using GDC: gdc *.d [client libraries] However, this command using DMD does not work: dmd -L-lstdc++ *.d [client libraries] I still get

Linking C++ standard library works with GDC... but not DMD. (Linux)

2015-04-16 Thread TheGag96 via Digitalmars-d-learn
Hi, I've got this project that requires me to link into a C++ backend. It works just fine when using GDC: gdc *.d [client libraries] However, this command using DMD does not work: dmd -L-lstdc++ *.d [client libraries] I still get errors involving the standard library not being added like:

Re: Linking C++ standard library works with GDC... but not DMD. (Linux)

2015-04-16 Thread FreeSlave via Digitalmars-d-learn
On Thursday, 16 April 2015 at 08:51:15 UTC, TheGag96 wrote: Hi, I've got this project that requires me to link into a C++ backend. It works just fine when using GDC: gdc *.d [client libraries] However, this command using DMD does not work: dmd -L-lstdc++ *.d [client libraries] I still get

Re: Linking C++ standard library works with GDC... but not DMD. (Linux)

2015-04-16 Thread John Colvin via Digitalmars-d-learn
On Thursday, 16 April 2015 at 08:51:15 UTC, TheGag96 wrote: Hi, I've got this project that requires me to link into a C++ backend. It works just fine when using GDC: gdc *.d [client libraries] However, this command using DMD does not work: dmd -L-lstdc++ *.d [client libraries] I still get

Re: CT-String as a Symbol

2015-04-16 Thread via Digitalmars-d-learn
On Wednesday, 15 April 2015 at 23:02:32 UTC, Ali Çehreli wrote: struct I { alias T = size_t; this(T ix) { this._ix = ix; } T opCast(U : T)() const { return _ix; } private T _ix = 0; } How is this possible?

Re: CT-String as a Symbol

2015-04-16 Thread John Colvin via Digitalmars-d-learn
On Thursday, 16 April 2015 at 10:27:20 UTC, Per Nordlöw wrote: On Wednesday, 15 April 2015 at 16:21:59 UTC, Nordlöw wrote: Help please. I'm quite satisfied with the current state now. Is anybody interested in having this in typecons.d in Phobos? I would be, yes. Have you considered what

What is the memory usage of my app?

2015-04-16 Thread Adil via Digitalmars-d-learn
I've written a simple socket-server app that securities (stock market shares) data and allows clients to query over them. The app starts by loading instrument information from a CSV file into some structs, then listens on a socket responding to queries. It doesn't mutate the data or allocate

Re: CT-String as a Symbol

2015-04-16 Thread via Digitalmars-d-learn
On Thursday, 16 April 2015 at 10:24:05 UTC, Per Nordlöw wrote: How is this possible? Shouldn't it CT-evaluate to struct Index { ... } !? Ahh, in the case when I is I. Ok I get it. That's the reason. Thx

Re: CT-String as a Symbol

2015-04-16 Thread via Digitalmars-d-learn
On Wednesday, 15 April 2015 at 16:21:59 UTC, Nordlöw wrote: Help please. I'm quite satisfied with the current state now. Is anybody interested in having this in typecons.d in Phobos?

Re: Linking C++ standard library works with GDC... but not DMD. (Linux)

2015-04-16 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-16 11:56, Dicebot wrote: Simple issue but unpleasant fix. You always must use C++ library that matches base C++ compiler. For GDC it is GCC (which is used by default). For DMD it is DMC (Digital Mars C compiler). For LDC it is whatever Clang standard library is called. All those are

Re: Linking C++ standard library works with GDC... but not DMD. (Linux)

2015-04-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/16/15 4:51 AM, TheGag96 wrote: Hi, I've got this project that requires me to link into a C++ backend. It works just fine when using GDC: gdc *.d [client libraries] However, this command using DMD does not work: dmd -L-lstdc++ *.d [client libraries] I still get errors involving the

Re: CURL to get/set cookies

2015-04-16 Thread Benjamin via Digitalmars-d-learn
Vladimir Adam Thank you! This was my last roadblock I needed to overcome to finish my prototype project for the company I work for. After a successful presentation and demo - the company I work for is taking a serious look into the D language for future projects. Thanks! Ben. On

Re: Linking C++ standard library works with GDC... but not DMD. (Linux)

2015-04-16 Thread TheGag96 via Digitalmars-d-learn
On Thursday, 16 April 2015 at 09:46:40 UTC, John Colvin wrote: On Thursday, 16 April 2015 at 08:51:15 UTC, TheGag96 wrote: Hi, I've got this project that requires me to link into a C++ backend. It works just fine when using GDC: gdc *.d [client libraries] However, this command using DMD does

Re: Invalid Floating Point Operation (DMD 2067)

2015-04-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/16/15 10:23 AM, ref2401 wrote: Hi Everyone, After I switched to DMD 2067 my code that previously worked began crashing. If I change the return statement in the matrixOrtho function from: return Matrix(...); to: Matrix m = Matrix(...); return m; then the error won't occur

Re: What is the memory usage of my app?

2015-04-16 Thread via Digitalmars-d-learn
On Thursday, 16 April 2015 at 12:17:24 UTC, Adil wrote: Calling Securities.bytes shows 188 MB, but ps shows about 591 MB of Resident memory. Where is the memory usage coming from? What am i missing? I'd say this is memory allocated while you load the CSV file. I can't tell much more without

Re: Invalid Floating Point Operation (DMD 2067)

2015-04-16 Thread ref2401 via Digitalmars-d-learn
Builds and runs fine for me. What is your OS and build command? -Steve Win 8.1 dmd main.d -ofmain.exe -debug -unittest -wi if %errorLevel% equ 0 (main.exe)

Re: What is the memory usage of my app?

2015-04-16 Thread Laeeth Isharc via Digitalmars-d-learn
Fwiw, I have been working on something similar. Others will have more experience on the GC, but perhaps you might find this interesting. For CSV files, what I found is that parsing is quite slow (and memory intensive). So rather than parse the same data every time, I found it helpful to do

Invalid Floating Point Operation (DMD 2067)

2015-04-16 Thread ref2401 via Digitalmars-d-learn
Hi Everyone, After I switched to DMD 2067 my code that previously worked began crashing. If I change the return statement in the matrixOrtho function from: return Matrix(...); to: Matrix m = Matrix(...); return m; then the error won't occur anymore. What is going on?

Re: Linking C++ standard library works with GDC... but not DMD. (Linux)

2015-04-16 Thread TheGag96 via Digitalmars-d-learn
On Thursday, 16 April 2015 at 12:57:12 UTC, Steven Schveighoffer wrote: /usr/include/c++/4.8/iostream:74: undefine reference to `std::ios_base::Init::Init()' (etc.) Try dmd -v to tell you exactly what command it is running for link. Then play around with the link line to see if you can

Re: Invalid Floating Point Operation (DMD 2067)

2015-04-16 Thread rumbu via Digitalmars-d-learn
Thanks, please file a bug, make it Windows specific, as I did not get the exception on OSX. -Steve Done: https://issues.dlang.org/show_bug.cgi?id=14452

Re: Printing an std.container.Array

2015-04-16 Thread Dennis Ritchie via Digitalmars-d-learn
On Thursday, 16 April 2015 at 20:34:19 UTC, Steven Schveighoffer wrote: On 4/16/15 4:18 PM, Panke wrote: Yep, but problem is almost no one expect this, or know this. We definitely should do better. How? By doing what is expected. Print the array contents. See my new comment in that PR.

Re: Printing an std.container.Array

2015-04-16 Thread Daniel Kozak via Digitalmars-d-learn
On Thu, 16 Apr 2015 19:55:52 + Bayan Rafeh via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Executing this code: import std.container.array; import std.stdio; int main() { writeln(Array!int([1, 2])); return 0; } outputs the following:

Re: GC: Memory keeps growing

2015-04-16 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 15 April 2015 at 12:03:49 UTC, Chris wrote: There might be some low-hanging fruit there. However, before I change anything, maybe you guys have some suggestions. See if switching to 64-bit mode changes anything.

Re: Printing an std.container.Array

2015-04-16 Thread Daniel Kozak via Digitalmars-d-learn
On Thu, 16 Apr 2015 13:05:48 -0700 H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Thu, Apr 16, 2015 at 07:55:52PM +, Bayan Rafeh via Digitalmars-d-learn wrote: Executing this code: import std.container.array; import std.stdio; int main() {

basic question about text file encodings

2015-04-16 Thread Laeeth Isharc via Digitalmars-d-learn
What is the best way to figure out and then decode a file of unknown coding to dchar? 2½% Index-linked Treasury Stock 2016,GB0009075325,26-Jul-2016,28-Feb-2014,8 month,337.81,338.577874,0.76787400,-1.953546,2.37 Eg I am not sure what encoding the 1/2 is in above, but treating it as

Re: Printing an std.container.Array

2015-04-16 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Apr 16, 2015 at 07:55:52PM +, Bayan Rafeh via Digitalmars-d-learn wrote: Executing this code: import std.container.array; import std.stdio; int main() { writeln(Array!int([1, 2])); return 0; } outputs the following: Array!int(RefCounted!(Payload,

Re: About @ and UDA

2015-04-16 Thread Vlad Levenfeld via Digitalmars-d-learn
On Wednesday, 15 April 2015 at 16:59:12 UTC, ketmar wrote: or make safe and company context keywords. along with body (oh, how i hate the unabilily to declare body member!) Ugh, yeah. Makes physics code awkward.

Re: Invalid Floating Point Operation (DMD 2067)

2015-04-16 Thread rumbu via Digitalmars-d-learn
On Thursday, 16 April 2015 at 15:00:39 UTC, ref2401 wrote: Builds and runs fine for me. What is your OS and build command? -Steve Win 8.1 dmd main.d -ofmain.exe -debug -unittest -wi if %errorLevel% equ 0 (main.exe) Reduced case: struct S { float f; }

Re: Invalid Floating Point Operation (DMD 2067)

2015-04-16 Thread rumbu via Digitalmars-d-learn
On Thursday, 16 April 2015 at 20:27:46 UTC, rumbu wrote: Hit send by accident :) Reduced case: struct S { float f; //or double or real this(float f) { this.f = f; } } S foo() { return S(0f); } void main() { auto s = foo(); } Win 8.1 also, 32 and 64 bit, debug or

Re: What is the memory usage of my app?

2015-04-16 Thread via Digitalmars-d-learn
On Thursday, 16 April 2015 at 17:13:25 UTC, Laeeth Isharc wrote: For CSV files, what I found is that parsing is quite slow (and memory intensive). If your sure that CSV reading is the culprit, writing a custom parser could help. It's possible to load a CSV file with almost no memory

Re: basic question about text file encodings

2015-04-16 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 16 April 2015 at 19:22:41 UTC, Laeeth Isharc wrote: What is the best way to figure out and then decode a file of unknown coding to dchar? You generally can't, though some statistical analysis can sometimes help. The encoding needs to be known through some other means to have a

Printing an std.container.Array

2015-04-16 Thread Bayan Rafeh via Digitalmars-d-learn
Executing this code: import std.container.array; import std.stdio; int main() { writeln(Array!int([1, 2])); return 0; } outputs the following: Array!int(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)(RefCountedStore(B694B0))) The strange thing is that this works

Re: Printing an std.container.Array

2015-04-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/16/15 4:18 PM, Panke wrote: Yep, but problem is almost no one expect this, or know this. We definitely should do better. How? By doing what is expected. Print the array contents. See my new comment in that PR. -Steve

Re: Invalid Floating Point Operation (DMD 2067)

2015-04-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/16/15 4:32 PM, rumbu wrote: On Thursday, 16 April 2015 at 20:27:46 UTC, rumbu wrote: Hit send by accident :) Reduced case: struct S { float f; //or double or real this(float f) { this.f = f; } } S foo() { return S(0f); } void main() { auto s = foo(); }

Re: basic question about text file encodings

2015-04-16 Thread Kagamin via Digitalmars-d-learn
First try utf-8, if it doesn't work, then use some fallback encoding like latin1.

Re: Printing an std.container.Array

2015-04-16 Thread Panke via Digitalmars-d-learn
On Thursday, 16 April 2015 at 19:55:53 UTC, Bayan Rafeh wrote: How am I supposed to interpret this? The array contains two elements. The first equals one and the second equals two. What happens under the hood is that Array does no provide a toString method, instead a default is used. This

Re: About @ and UDA

2015-04-16 Thread via Digitalmars-d-learn
On Thursday, 16 April 2015 at 20:09:07 UTC, Vlad Levenfeld wrote: On Wednesday, 15 April 2015 at 16:59:12 UTC, ketmar wrote: or make safe and company context keywords. along with body (oh, how i hate the unabilily to declare body member!) Ugh, yeah. Makes physics code awkward. And DOM.

Re: Printing an std.container.Array

2015-04-16 Thread Panke via Digitalmars-d-learn
Yep, but problem is almost no one expect this, or know this. We definitely should do better. How?

Re: CT-String as a Symbol

2015-04-16 Thread Nordlöw
On Thursday, 16 April 2015 at 10:46:25 UTC, John Colvin wrote: On Thursday, 16 April 2015 at 10:27:20 UTC, Per Nordlöw wrote: On Wednesday, 15 April 2015 at 16:21:59 UTC, Nordlöw wrote: Help please. I'm quite satisfied with the current state now. Is anybody interested in having this in