Re: threading issues with D -> C -> Python

2014-12-02 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2014-12-03 at 01:07 +, Michael via Digitalmars-d-learn wrote: > Hi. I'm new here and this is my first post. I'm not sure this is > the right subforum for it, but wasn't sure where else to put it > either. > > I've written a library to talk to some external hardware using a > socket.

Re: threading issues with D -> C -> Python

2014-12-02 Thread Ellery Newcomer via Digitalmars-d-learn
On 12/02/2014 05:07 PM, Michael wrote: Hi. I'm new here and this is my first post. I'm not sure this is the right subforum for it, but wasn't sure where else to put it either. I've written a library to talk to some external hardware using a socket. It uses the std.concurrency threads to send mes

Re: threading issues with D -> C -> Python

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 01:07:42 + Michael via Digitalmars-d-learn wrote: btw, Adam Ruppe's "D Cookbook" has a chapter which describes how to call D library from C code. don't remember if it describes threading, though. signature.asc Description: PGP signature

Re: threading issues with D -> C -> Python

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 01:07:42 + Michael via Digitalmars-d-learn wrote: all in all, you'd better not mixing D code with "alien" mulththreaded code and not using .a/.so libraries written in D in another language until you are familiar with D runtime and GC. those mixes are very fragile. signat

Re: threading issues with D -> C -> Python

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 02:52:27 + Michael via Digitalmars-d-learn wrote: by "using from C code" i mean that your main program is not written in D, it has no D `main()` and so on. i.e. you wrote, for example, some .a library in D and now you want to use that library in C code. signature.asc Des

Re: threading issues with D -> C -> Python

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 02:52:27 + Michael via Digitalmars-d-learn wrote: > Okay. Well I am already not passing any D-allocated data. I'm > specifically creating variables/arrays on the C-stack, and then > passing the pointer of that to D and overwriting the data of the > C-stack pointer for a

Re: threading issues with D -> C -> Python

2014-12-02 Thread Michael via Digitalmars-d-learn
On Wednesday, 3 December 2014 at 02:41:11 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 03 Dec 2014 02:21:45 + Michael via Digitalmars-d-learn wrote: Thanks for this. Its definitely a step in the right direction. Would you mind explaining a bit more about the problem here, if you c

Re: Why the DMD Backend?

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 3 Dec 2014 08:14:53 +0530 Shriramana Sharma via Digitalmars-d-learn wrote: > Heh -- fine for whatever compiler tools *you* create, but if someone > else creates it, and is willing to distribute it under a more liberal > license, why should you find it unacceptable, I'm not sure! 'cause BS

Re: Why the DMD Backend?

2014-12-02 Thread Shriramana Sharma via Digitalmars-d-learn
On Wed, Dec 3, 2014 at 8:03 AM, ketmar via Digitalmars-d-learn wrote: > > that is exactly the reason i'm against LLVM: it's license. i believe > that compiler and compiler construction tools must be [L]GPLed or > proprietary, but not MITed/BSDLed/SIMILARed. Heh -- fine for whatever compiler tools

Re: threading issues with D -> C -> Python

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 02:21:45 + Michael via Digitalmars-d-learn wrote: > Thanks for this. Its definitely a step in the right direction. > Would you mind explaining a bit more about the problem here, if > you can? I don't fully understand why the garbage collector needs > to know about the t

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Shriramana Sharma via Digitalmars-d-learn
On Tue, Dec 2, 2014 at 10:45 PM, Mayuresh Kathe via Digitalmars-d-learn wrote: > Okay, if that is the case, I'll dive into Mr. Alexandrescu's book as soon as > I get my copy. > BTW, how come all of you address him as Andrei? Heh -- possibly you haven't interacted on international technical mailin

Re: Why the DMD Backend?

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 01:48:53 + MachineCode via Digitalmars-d-learn wrote: > On Sunday, 30 November 2014 at 02:07:16 UTC, ketmar via > Digitalmars-d-learn wrote: > > On Sat, 29 Nov 2014 22:57:52 -0300 > > Ary Borenszweig via Digitalmars-d-learn > > wrote: > > > >> > besides, i don't want to

Re: threading issues with D -> C -> Python

2014-12-02 Thread Michael via Digitalmars-d-learn
Thanks for this. Its definitely a step in the right direction. Would you mind explaining a bit more about the problem here, if you can? I don't fully understand why the garbage collector needs to know about the threads, and if so for how long does it need to know? If I put in "thread_attachThi

Re: Why the DMD Backend?

2014-12-02 Thread MachineCode via Digitalmars-d-learn
On Sunday, 30 November 2014 at 02:07:16 UTC, ketmar via Digitalmars-d-learn wrote: On Sat, 29 Nov 2014 22:57:52 -0300 Ary Borenszweig via Digitalmars-d-learn wrote: > besides, i don't want to use anything llvm-related. Why not? let's say that there is some "ideological" reasons. but do you

Re: threading issues with D -> C -> Python

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 01:07:42 + Michael via Digitalmars-d-learn wrote: > I'm fairly sure I have tackled both of these issues, but it still > seems like Python threads and D threads don't mix well. When > running the same functions from D, I am able to get no errors, > but when run from Pyth

threading issues with D -> C -> Python

2014-12-02 Thread Michael via Digitalmars-d-learn
Hi. I'm new here and this is my first post. I'm not sure this is the right subforum for it, but wasn't sure where else to put it either. I've written a library to talk to some external hardware using a socket. It uses the std.concurrency threads to send messages between the main D-object for

Re: regular expression engine and ranges

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Tue, 02 Dec 2014 22:47:05 + MrSmith via Digitalmars-d-learn wrote: > IIRC, there was a request for ranged regex in phobos somewhere. > Is there anything simple that can be easily ported? i don't think so. i.e. there are either very simple and barely usable engines, or complex and hard to p

Re: regular expression engine and ranges

2014-12-02 Thread MrSmith via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 19:17:43 UTC, ketmar via Digitalmars-d-learn wrote: Hello. is there any decent regular expression engine which works with input ranges? under "decent" i mean "good D code", "[t]nfa" and "no backtracking". support for captures and greedy/non-greedy modes are mus

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Meta via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 16:38:34 UTC, Mayuresh Kathe wrote: While I have been a programmer for close to 23 years, it's been mostly API level code cobbling work. Would like to learn "D", but am a bit intimidated by the fact that I don't have much of a grasp over the foundational stuff (

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Ali Çehreli via Digitalmars-d-learn
On 12/02/2014 09:15 AM, Mayuresh Kathe wrote: > BTW, how come all of you address him as Andrei? > Is this group that informal? First name is the normal way of referring to colleagues here in the US, at least in Silicon Valley. Even the CEOs, board members, and all the other "top" people are re

Re: Adding days to std.datetime.Date

2014-12-02 Thread via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 19:21:35 UTC, Steven Schveighoffer wrote: On 12/2/14 2:14 PM, Steven Schveighoffer wrote: Not an oversight. Date.add and Date.roll are for adding units that are variable. For example, how many days are in a month? Answer: depends on the month. How many days in

Re: Adding days to std.datetime.Date

2014-12-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/2/14 2:14 PM, Steven Schveighoffer wrote: Not an oversight. Date.add and Date.roll are for adding units that are variable. For example, how many days are in a month? Answer: depends on the month. How many days in a year? Answer: depends on the year. But days are NOT variable, there are

regular expression engine and ranges

2014-12-02 Thread ketmar via Digitalmars-d-learn
Hello. is there any decent regular expression engine which works with input ranges? under "decent" i mean "good D code", "[t]nfa" and "no backtracking". support for captures and greedy/non-greedy modes are must. i found that some popular regex libraries and std.regex are sure that the only data l

Re: Adding days to std.datetime.Date

2014-12-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/2/14 2:00 PM, H. S. Teoh via Digitalmars-d-learn wrote: On Tue, Dec 02, 2014 at 06:49:54PM +, via Digitalmars-d-learn wrote: But still, why this method http://dlang.org/phobos/std_datetime.html#.Date.add only supports "month" or "years" while this one http://dlang.org/phobos/std_dateti

Re: Adding days to std.datetime.Date

2014-12-02 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Dec 02, 2014 at 06:49:54PM +, via Digitalmars-d-learn wrote: > >But still, why this method > >http://dlang.org/phobos/std_datetime.html#.Date.add only supports "month" > >or "years" while this one > >http://dlang.org/phobos/std_datetime.html#.Date.roll does ? > > But still, why this me

Re: Adding days to std.datetime.Date

2014-12-02 Thread via Digitalmars-d-learn
But still, why this method http://dlang.org/phobos/std_datetime.html#.Date.add only supports "month" or "years" while this one http://dlang.org/phobos/std_datetime.html#.Date.roll does ? But still, why this method http://dlang.org/phobos/std_datetime.html#.Date.add only supports "month" or "

Re: Adding days to std.datetime.Date

2014-12-02 Thread via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 18:00:14 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Tue, Dec 02, 2014 at 05:21:27PM +, via Digitalmars-d-learn wrote: On Thursday, 7 April 2011 at 19:10:40 UTC, Piotr Szturmaj wrote: >Is it possible to add a particular number of days to a Date? > >I hav

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Dec 02, 2014 at 05:46:04PM +, Mayuresh Kathe via Digitalmars-d-learn wrote: > On Tuesday, 2 December 2014 at 17:33:18 UTC, Gary Willoughby wrote: > >On Tuesday, 2 December 2014 at 17:15:28 UTC, Mayuresh Kathe wrote: > >>Okay, if that is the case, I'll dive into Mr. Alexandrescu's book

Re: Adding days to std.datetime.Date

2014-12-02 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Dec 02, 2014 at 05:21:27PM +, via Digitalmars-d-learn wrote: > On Thursday, 7 April 2011 at 19:10:40 UTC, Piotr Szturmaj wrote: > >Is it possible to add a particular number of days to a Date? > > > >I have number of days since 1 Jan 2000 and I want to convert it to > >Date: > > > >int d

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Mayuresh Kathe via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 17:33:18 UTC, Gary Willoughby wrote: On Tuesday, 2 December 2014 at 17:15:28 UTC, Mayuresh Kathe wrote: Okay, if that is the case, I'll dive into Mr. Alexandrescu's book as soon as I get my copy. No need to wait that long. I second H.S. Teoh's suggestion to reco

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Gary Willoughby via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 17:15:28 UTC, Mayuresh Kathe wrote: Okay, if that is the case, I'll dive into Mr. Alexandrescu's book as soon as I get my copy. No need to wait that long. I second H.S. Teoh's suggestion to recommend reading this book too: http://ddili.org/ders/d.en/intro.html

Re: Adding days to std.datetime.Date

2014-12-02 Thread via Digitalmars-d-learn
On Thursday, 7 April 2011 at 19:10:40 UTC, Piotr Szturmaj wrote: Is it possible to add a particular number of days to a Date? I have number of days since 1 Jan 2000 and I want to convert it to Date: int days = read!int; // number of days since 1 Jan 2000 Date x = Date(2000, 1, 1); x.add!"days

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Mayuresh Kathe via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 17:10:57 UTC, Tobias Pankrath wrote: Thanks for the welcome. :) I think I'll just work through Discrete Mathematics and Machine Organization before approaching Mr. Alexandrescu's book, would take up only 6 ~ 8 months of my time, and would be really good for me i

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 17:15:28 UTC, Mayuresh Kathe wrote: BTW, how come all of you address him as Andrei? Is this group that informal? Asking, just so that I don't become the odd man. :) This group is definitely that informal. First names are the norm here.

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread CraigDillabaugh via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 17:04:57 UTC, Mayuresh Kathe wrote: On Tuesday, 2 December 2014 at 16:54:50 UTC, CraigDillabaugh wrote: On Tuesday, 2 December 2014 at 16:38:34 UTC, Mayuresh Kathe wrote: clip Thanks for the welcome. :) I think I'll just work through Discrete Mathematics and Ma

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Tobias Pankrath via Digitalmars-d-learn
Thanks for the welcome. :) I think I'll just work through Discrete Mathematics and Machine Organization before approaching Mr. Alexandrescu's book, would take up only 6 ~ 8 months of my time, and would be really good for me in the long term. No! If you know how to program and want to learn D

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Mayuresh Kathe via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 16:54:50 UTC, CraigDillabaugh wrote: On Tuesday, 2 December 2014 at 16:38:34 UTC, Mayuresh Kathe wrote: While I have been a programmer for close to 23 years, it's been mostly API level code cobbling work. Would like to learn "D", but am a bit intimidated by the f

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread CraigDillabaugh via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 16:38:34 UTC, Mayuresh Kathe wrote: While I have been a programmer for close to 23 years, it's been mostly API level code cobbling work. Would like to learn "D", but am a bit intimidated by the fact that I don't have much of a grasp over the foundational stuff (

Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Dec 02, 2014 at 04:38:33PM +, Mayuresh Kathe via Digitalmars-d-learn wrote: > While I have been a programmer for close to 23 years, it's been mostly > API level code cobbling work. > > Would like to learn "D", but am a bit intimidated by the fact that I > don't have much of a grasp ov

Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Mayuresh Kathe via Digitalmars-d-learn
While I have been a programmer for close to 23 years, it's been mostly API level code cobbling work. Would like to learn "D", but am a bit intimidated by the fact that I don't have much of a grasp over the foundational stuff (discrete mathematics, machine organization, etc.) and hence am prep

Re: curl: catching exception on connect.

2014-12-02 Thread Suliman via Digitalmars-d-learn
connect() sends a "CONNECT" request to the server, as defined by HTTP [1]. This method is only used when you're working with proxies and the like. What you most likely want, however, is a "GET" request. Use get() for that. So what is the best way to check status server response (400, 404 et

Re: Why the DMD Backend?

2014-12-02 Thread Temtaime via Digitalmars-d-learn
Setting up LLVM infrastructure is only needed when you is a LDC developer. I think for ordinary users it's not their business.

Re: Why the DMD Backend?

2014-12-02 Thread Chris via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 10:57:20 UTC, Temtaime wrote: It's only words. If we speak about LDC it can compile fast in debug mode with performance average to DMD's backend but with much great performance in release mode thanks to vectorization and other techniques. Also LDC thanks to LLVM

Re: Why the DMD Backend?

2014-12-02 Thread Temtaime via Digitalmars-d-learn
It's only words. If we speak about LDC it can compile fast in debug mode with performance average to DMD's backend but with much great performance in release mode thanks to vectorization and other techniques. Also LDC thanks to LLVM supports X86, X86-64, PowerPC, PowerPC-64, ARM, Thumb, SPARC,

Re: Why the DMD Backend?

2014-12-02 Thread Chris via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 10:37:18 UTC, bearophile wrote: Chris: As others have said already, the reasons why I use dmd are: Walter has developed the back-end of DMD and he wants to keep using it no matter what. But I love the very small compilation time of dmd sources. Bye, bearophi

Re: Why the DMD Backend?

2014-12-02 Thread bearophile via Digitalmars-d-learn
Chris: As others have said already, the reasons why I use dmd are: Walter has developed the back-end of DMD and he wants to keep using it no matter what. But I love the very small compilation time of dmd sources. Bye, bearophile

Re: curl: catching exception on connect.

2014-12-02 Thread via Digitalmars-d-learn
On Monday, 1 December 2014 at 19:44:56 UTC, Suliman wrote: My guess is that you have to use HTTPS for CONNECT and that you have to have credentials for it. (?) Ali dlang.org should work on HTTP, but not HTTPS. Also I do not think that when I connect to HTTPS I should have any credentials. I

Re: Why the DMD Backend?

2014-12-02 Thread Chris via Digitalmars-d-learn
On Friday, 28 November 2014 at 19:59:40 UTC, Xinok wrote: Given that we have GDC with the GCC backend and LDC with the LLVM backend, what are the benefits of keeping the DMD compiler backend? It seems to me that GCC and LLVM are far more developed and better supported by their respective commun