Re: Leaving a pointer to it on the stack

2020-08-13 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 13 August 2020 at 21:10:57 UTC, Steven Schveighoffer wrote: On 8/13/20 4:51 PM, Andre Pany wrote: [...] So in your real world scenario, a non-D thread/program is calling sample, and it controls the location of *i? If so, then no, you can't depend on D not collecting that data, b

Re: Leaving a pointer to it on the stack

2020-08-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/13/20 4:51 PM, Andre Pany wrote: On Thursday, 13 August 2020 at 20:11:50 UTC, Steven Schveighoffer wrote: The garbage collector scans all of the stack as if it were an array of pointers. So if you have a pointer to it anywhere on the stack, it won't be collected. However, it only scans t

Re: generating random numbers

2020-08-13 Thread Andy Balba via Digitalmars-d-learn
On Monday, 10 August 2020 at 15:43:04 UTC, Andy Balba wrote: On Monday, 10 August 2020 at 15:13:51 UTC, bachmeier wrote: On Monday, 10 August 2020 at 14:20:23 UTC, bachmeier wrote: On Monday, 10 August 2020 at 05:51:07 UTC, Andy Balba wrote: generating random numbers using https://dlang.org/li

Re: Leaving a pointer to it on the stack

2020-08-13 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 13 August 2020 at 20:11:50 UTC, Steven Schveighoffer wrote: On 8/13/20 4:04 PM, Andre Pany wrote: Hi, in the specification https://dlang.org/spec/interfaceToC.html#storage_allocation there is this paragraph: "Leaving a pointer to it on the stack (as a parameter or automatic vari

Re: Leaving a pointer to it on the stack

2020-08-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/13/20 4:04 PM, Andre Pany wrote: Hi, in the specification https://dlang.org/spec/interfaceToC.html#storage_allocation there is this paragraph: "Leaving a pointer to it on the stack (as a parameter or automatic variable), as the garbage collector will scan the stack." I have some troubl

Re: Leaving a pointer to it on the stack

2020-08-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 13 August 2020 at 20:04:59 UTC, Andre Pany wrote: Hi, in the specification https://dlang.org/spec/interfaceToC.html#storage_allocation there is this paragraph: "Leaving a pointer to it on the stack (as a parameter or automatic variable), as the garbage collector will scan the st

Leaving a pointer to it on the stack

2020-08-13 Thread Andre Pany via Digitalmars-d-learn
Hi, in the specification https://dlang.org/spec/interfaceToC.html#storage_allocation there is this paragraph: "Leaving a pointer to it on the stack (as a parameter or automatic variable), as the garbage collector will scan the stack." I have some trouble to understand what does this mean. G

Re: Reading from stdin significantly slower than reading file directly?

2020-08-13 Thread methonash via Digitalmars-d-learn
Thank you all very much for your detailed feedback! I wound up pulling the "TREE_GRM_ESTN.csv" file referred to by Jon and used it in subsequent tests. Created D-programs for reading directly through a File() structure, versus reading byLine() from the stdin alias. After copying the large CS

Re: DMD: how to restore old unittest+main

2020-08-13 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Aug 13, 2020 at 08:30:44AM +, Jonathan via Digitalmars-d-learn wrote: [...] > Is there a reason you need to run all unittests every time you want to > run the program? During development, this is a valuable time-saver: instead of compiling twice, once with -unittest and once without,

Re: Reading from stdin significantly slower than reading file directly?

2020-08-13 Thread Jon Degenhardt via Digitalmars-d-learn
On Thursday, 13 August 2020 at 14:41:02 UTC, Steven Schveighoffer wrote: But for sure, reading from stdin doesn't do anything different than reading from a file if you are using the File struct. A more appropriate test might be using the shell to feed the file into the D program: dprogram <

Re: vibe.d and my first web service

2020-08-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/13/20 3:28 AM, WebFreak001 wrote: On Wednesday, 12 August 2020 at 21:11:54 UTC, Daniel Kozak wrote: [...] Unfortunately, I think vibe-d is dead. With every release it is worse than before and it seems there is almost no activity. So D really need new champion here maybe hunt will be next

Re: DMD: how to restore old unittest+main

2020-08-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/13/20 5:02 AM, Nils Lankila wrote: On Thursday, 13 August 2020 at 08:49:21 UTC, WebFreak001 wrote: On Thursday, 13 August 2020 at 07:52:07 UTC, novice3 wrote: Hello. I don't use dub. I use Windows and *.d file association to compile small apps by dmd with "-i -unittest -g" switches. Now

Re: Reading from stdin significantly slower than reading file directly?

2020-08-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/12/20 6:44 PM, methonash wrote: Hi, Relative beginner to D-lang here, and I'm very confused by the apparent performance disparity I've noticed between programs that do the following: 1) cat some-large-file | D-program-reading-stdin-byLine() 2) D-program-directly-reading-file-byLine() us

Re: Reading from stdin significantly slower than reading file directly?

2020-08-13 Thread wjoe via Digitalmars-d-learn
On Thursday, 13 August 2020 at 07:08:21 UTC, Jon Degenhardt wrote: Test Elapsed System User --- -- tsv-select -f 2,3 FILE 10.280.42 9.85 cat FILE | tsv-select -f 2,311.101.45 10.23 cut -f 2,3 FILE

Re: vibe.d and my first web service

2020-08-13 Thread Mr. Backup via Digitalmars-d-learn
On Wednesday, 12 August 2020 at 13:46:06 UTC, James Blachly wrote: Unfortunately the problem still occurs with Vibe.d 0.9.0 IMO **this is the single most important problem to fix** for vibe.d -- if the most basic of examples (indeed, supplied by dub itself) fails so spectacularly, the casual

Re: DMD: how to restore old unittest+main

2020-08-13 Thread novice3 via Digitalmars-d-learn
On Thursday, 13 August 2020 at 09:02:28 UTC, Nils Lankila wrote: programmatically, in a way it is already, but by calling function Better with compiler switch, may be...

Re: DMD: how to restore old unittest+main

2020-08-13 Thread Nils Lankila via Digitalmars-d-learn
On Thursday, 13 August 2020 at 08:49:21 UTC, WebFreak001 wrote: On Thursday, 13 August 2020 at 07:52:07 UTC, novice3 wrote: Hello. I don't use dub. I use Windows and *.d file association to compile small apps by dmd with "-i -unittest -g" switches. Now i update dmd, and found, that apps compil

Re: DMD: how to restore old unittest+main

2020-08-13 Thread novice3 via Digitalmars-d-learn
On Thursday, 13 August 2020 at 08:30:44 UTC, Jonathan wrote: Is there a reason you need to run all unittests every time you want to run the program? Starting app with unittests while develop - frequent event for me. Releasing app - rare event for me. I want do frequent action without efforts (j

Re: DMD: how to restore old unittest+main

2020-08-13 Thread novice3 via Digitalmars-d-learn
On Thursday, 13 August 2020 at 08:49:21 UTC, WebFreak001 wrote: Try version (unittest) extern(C) __gshared string[] rt_options = ["testmode=run-main" ]; Thanks! It works as needed.

Re: DMD: how to restore old unittest+main

2020-08-13 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 13 August 2020 at 07:52:07 UTC, novice3 wrote: Hello. I don't use dub. I use Windows and *.d file association to compile small apps by dmd with "-i -unittest -g" switches. Now i update dmd, and found, that apps compiled with "-unittest" not runs main(). How i can restore old beh

Re: DMD: how to restore old unittest+main

2020-08-13 Thread novice3 via Digitalmars-d-learn
On Thursday, 13 August 2020 at 08:30:44 UTC, Jonathan wrote: Is there a reason you need to run all unittests every time you want to run the program? App will be used by other peoples, and i will release it after developing without unittests. Release is rare action for me. Running while developi

Re: DMD: how to restore old unittest+main

2020-08-13 Thread Jonathan via Digitalmars-d-learn
On Thursday, 13 August 2020 at 07:52:07 UTC, novice3 wrote: Hello. I don't use dub. I use Windows and *.d file association to compile small apps by dmd with "-i -unittest -g" switches. Now i update dmd, and found, that apps compiled with "-unittest" not runs main(). How i can restore old beh

DMD: how to restore old unittest+main

2020-08-13 Thread novice3 via Digitalmars-d-learn
Hello. I don't use dub. I use Windows and *.d file association to compile small apps by dmd with "-i -unittest -g" switches. Now i update dmd, and found, that apps compiled with "-unittest" not runs main(). How i can restore old behaviour (run all unittests then main()) *without use "--DRT-te

Re: vibe.d and my first web service

2020-08-13 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 12 August 2020 at 21:11:54 UTC, Daniel Kozak wrote: [...] Unfortunately, I think vibe-d is dead. With every release it is worse than before and it seems there is almost no activity. So D really need new champion here maybe hunt will be next champion. Can you give an example ho

Re: Reading from stdin significantly slower than reading file directly?

2020-08-13 Thread Jon Degenhardt via Digitalmars-d-learn
On Wednesday, 12 August 2020 at 22:44:44 UTC, methonash wrote: Hi, Relative beginner to D-lang here, and I'm very confused by the apparent performance disparity I've noticed between programs that do the following: 1) cat some-large-file | D-program-reading-stdin-byLine() 2) D-program-direct