Re: Hello, folks! Newbie to D, have some questions!

2017-02-22 Thread timmyjose via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 07:48:42 UTC, Steve Biedermann wrote: On Tuesday, 21 February 2017 at 17:13:30 UTC, timmyjose wrote: I would upvote you if I could! :-) ... that's not only an interesting read, but also fodder for mini-projects of my own! If you need more details about a

Re: Hello, folks! Newbie to D, have some questions!

2017-02-21 Thread Steve Biedermann via Digitalmars-d-learn
On Tuesday, 21 February 2017 at 17:13:30 UTC, timmyjose wrote: I would upvote you if I could! :-) ... that's not only an interesting read, but also fodder for mini-projects of my own! If you need more details about a specific topic, just post it in the forum and we will try to help :) If

Re: Hello, folks! Newbie to D, have some questions!

2017-02-21 Thread timmyjose via Digitalmars-d-learn
On Tuesday, 21 February 2017 at 19:55:37 UTC, Ali Çehreli wrote: On 02/21/2017 09:13 AM, timmyjose wrote: On Tuesday, 21 February 2017 at 14:17:39 UTC, Steve Biedermann wrote: On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: [...] I'm using D for small tools for about a year

Re: Hello, folks! Newbie to D, have some questions!

2017-02-21 Thread Ali Çehreli via Digitalmars-d-learn
On 02/21/2017 09:13 AM, timmyjose wrote: On Tuesday, 21 February 2017 at 14:17:39 UTC, Steve Biedermann wrote: On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: [...] I'm using D for small tools for about a year now and I never had to mess with GC. Most of the tools don't need

Re: Hello, folks! Newbie to D, have some questions!

2017-02-21 Thread timmyjose via Digitalmars-d-learn
On Monday, 20 February 2017 at 17:36:32 UTC, H. S. Teoh wrote: On Mon, Feb 20, 2017 at 03:00:05PM +, timmyjose via Digitalmars-d-learn wrote: [...] Just one question about the compilers though - I read on the Wiki that there are three main compiler distros - dmd, ldc, and gdc. I code

Re: Hello, folks! Newbie to D, have some questions!

2017-02-21 Thread timmyjose via Digitalmars-d-learn
On Monday, 20 February 2017 at 17:43:22 UTC, Ali Çehreli wrote: On 02/20/2017 07:00 AM, timmyjose wrote: > slice can be spawned off into a brand new array upon assigning data to > it (in the book "Learning D", which I find very nice so far). It's not assigning data to a slice, but adding

Re: Hello, folks! Newbie to D, have some questions!

2017-02-21 Thread timmyjose via Digitalmars-d-learn
On Tuesday, 21 February 2017 at 14:17:39 UTC, Steve Biedermann wrote: On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: [...] I'm using D for small tools for about a year now and I never had to mess with GC. Most of the tools don't need to work on GBs of data and performance

Re: Hello, folks! Newbie to D, have some questions!

2017-02-21 Thread Steve Biedermann via Digitalmars-d-learn
On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: 2. I am more interested in learning D as a pure systems programming language so that I can develop my own tools (not looking to develop an OS, just some grep-scale tools to start off with). In that regard, I have a few concerns

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread ketmar via Digitalmars-d-learn
"H. S. Teoh via Digitalmars-d-learn" wrote: On Mon, Feb 20, 2017 at 05:39:30PM +, ketmar via Digitalmars-d-learn wrote: foreach (auto n; arr) oops. good job, auto! Haha... in this case you want to actually just drop `auto` completely. :-D But yeah, there are some funny inconsistencies

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Feb 20, 2017 at 05:39:30PM +, ketmar via Digitalmars-d-learn wrote: > Ali Çehreli wrote: > > > Correction: It's actually the 'auto attribute' in D with the > > venerable responsibility of "The auto attribute is used when there > > are no other attributes and type inference is

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread Ali Çehreli via Digitalmars-d-learn
On 02/20/2017 07:00 AM, timmyjose wrote: > slice can be spawned off into a brand new array upon assigning data to > it (in the book "Learning D", which I find very nice so far). It's not assigning data to a slice, but adding elements to it: It *may* spawn off a new array. You can use .capacity

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Feb 20, 2017 at 03:00:05PM +, timmyjose via Digitalmars-d-learn wrote: [...] > Just one question about the compilers though - I read on the Wiki that > there are three main compiler distros - dmd, ldc, and gdc. I code > primarily on a mac, and I have installed both dmd and ldc. A lot

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread ketmar via Digitalmars-d-learn
Ali Çehreli wrote: Correction: It's actually the 'auto attribute' in D with the venerable responsibility of "The auto attribute is used when there are no other attributes and type inference is desired." Good job, auto! :o) foreach (auto n; arr) oops. good job, auto!

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread Ali Çehreli via Digitalmars-d-learn
On 02/20/2017 06:44 AM, timmyjose wrote: > 3). Not so much a fan of "auto", but it does have its uses, of course. For completeness, D's 'auto' does not have the same meaning as C++'s auto. Wait... it actually has! :) But with the meaning of the 'auto' keyword from the olden C days: automatic

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread timmyjose via Digitalmars-d-learn
On Monday, 20 February 2017 at 15:27:16 UTC, ag0aep6g wrote: On 02/20/2017 03:44 PM, timmyjose wrote: Things I don't like so much: 1). The std.range: iota function(?) is pretty nice, but the naming seems a bit bizarre, but quite nice to use. Yeah, the name is weird. A little googling

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread ag0aep6g via Digitalmars-d-learn
On 02/20/2017 03:44 PM, timmyjose wrote: Things I don't like so much: 1). The std.range: iota function(?) is pretty nice, but the naming seems a bit bizarre, but quite nice to use. Yeah, the name is weird. A little googling suggests it comes from C++ [1] which took it from APL. 2). The

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread timmyjose via Digitalmars-d-learn
On Monday, 20 February 2017 at 14:54:58 UTC, Adam D. Ruppe wrote: On Monday, 20 February 2017 at 14:44:41 UTC, timmyjose wrote: My confusion is this - the declaration of the array is arr [last-dimension]...[first-dimension], but the usage is arr[first-dimension]...[last-dimension]. Am I

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread timmyjose via Digitalmars-d-learn
On Monday, 20 February 2017 at 14:52:43 UTC, ketmar wrote: timmyjose wrote: Suppose I have a simple 2 x 3 array like so: import std.stdio; import std.range: iota; void main() { // a 2 x 3 array int [3][2] arr; foreach (i; iota(0, 2)) { foreach(j; iota(0, 3)) {

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread ketmar via Digitalmars-d-learn
timmyjose wrote: Very interesting reading about your experiences! tnx. ;-) one thing I've observed is that so far (very very early of course) D appears to be a lot more intuitive than C++ yeah. i almost finished writing my own nntp/email client (actually, i'm writing this post with it).

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread timmyjose via Digitalmars-d-learn
On Sunday, 19 February 2017 at 12:45:49 UTC, ketmar wrote: timmyjose wrote: a). So the GC is part of the runtime even if we specify @nogc yes. GC is basically just a set of functions and some supporting data structures, it is compiled in druntime. @nogc doesn't turn it off, if says that

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 20 February 2017 at 14:44:41 UTC, timmyjose wrote: My confusion is this - the declaration of the array is arr [last-dimension]...[first-dimension], but the usage is arr[first-dimension]...[last-dimension]. Am I missing something here? I've never understood how anyone could

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread ketmar via Digitalmars-d-learn
timmyjose wrote: Suppose I have a simple 2 x 3 array like so: import std.stdio; import std.range: iota; void main() { // a 2 x 3 array int [3][2] arr; foreach (i; iota(0, 2)) { foreach(j; iota(0, 3)) { arr[i][j] = i+j; }

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread timmyjose via Digitalmars-d-learn
On Sunday, 19 February 2017 at 12:31:51 UTC, ag0aep6g wrote: On 02/19/2017 12:51 PM, timmyjose wrote: a). So the GC is part of the runtime even if we specify @nogc Yup. @nogc is per function, not per program. Other functions are allowed to use the GC. b). Do we manually trigger the GC

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread timmyjose via Digitalmars-d-learn
On Sunday, 19 February 2017 at 03:17:08 UTC, Seb wrote: On Saturday, 18 February 2017 at 21:09:20 UTC, ag0aep6g wrote: 5. Supposing I devote the time and energy and get up to speed on D, would the core language team be welcoming if I feel like I can contribute? Absolutely. Anyone is welcome

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread timmyjose via Digitalmars-d-learn
On Sunday, 19 February 2017 at 12:40:10 UTC, Guillaume Piolat wrote: On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: My rudimentary knowledge of the D ecosystem tells me that there is a GC in D, but that can be turned off. Is this correct? Also, some threads online mention that

Re: Hello, folks! Newbie to D, have some questions!

2017-02-20 Thread timmyjose via Digitalmars-d-learn
On Sunday, 19 February 2017 at 15:22:50 UTC, bachmeier wrote: On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: 4. I have heard good reports of D's metaprogramming capabilities (ironically enough, primarily from a thread on the Rust user group), and coming from a Common Lisp (and

Re: Hello, folks! Newbie to D, have some questions!

2017-02-19 Thread bachmeier via Digitalmars-d-learn
On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: 4. I have heard good reports of D's metaprogramming capabilities (ironically enough, primarily from a thread on the Rust user group), and coming from a Common Lisp (and some Racket) background, I am deeply interested in this

Re: Hello, folks! Newbie to D, have some questions!

2017-02-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-02-19 13:45, ketmar wrote: nogc doesn't turn it off, if says that compiler must ensure that *your* *code* doesn't allocate, Just to clarify, allocate using the GC. It's perfectly fine to allocate using malloc in a @nogc function. -- /Jacob Carlborg

Re: Hello, folks! Newbie to D, have some questions!

2017-02-19 Thread ketmar via Digitalmars-d-learn
timmyjose wrote: I can't help here because I am using D for a long time, so I do not remember how I have learned it. Hahaha! Yes, thanks for the honesty. It does make sense because once you've been working in some field for some time, it does make it harder to explain how exactly you reached

Re: Hello, folks! Newbie to D, have some questions!

2017-02-19 Thread ketmar via Digitalmars-d-learn
timmyjose wrote: a). So the GC is part of the runtime even if we specify @nogc yes. GC is basically just a set of functions and some supporting data structures, it is compiled in druntime. @nogc doesn't turn it off, if says that compiler must ensure that *your* *code* doesn't allocate, at

Re: Hello, folks! Newbie to D, have some questions!

2017-02-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: My rudimentary knowledge of the D ecosystem tells me that there is a GC in D, but that can be turned off. Is this correct? Also, some threads online mention that if we do turn off GC, some of the core std libraries may not fully

Re: Hello, folks! Newbie to D, have some questions!

2017-02-19 Thread ag0aep6g via Digitalmars-d-learn
On 02/19/2017 12:51 PM, timmyjose wrote: a). So the GC is part of the runtime even if we specify @nogc Yup. @nogc is per function, not per program. Other functions are allowed to use the GC. b). Do we manually trigger the GC (like Java's System.gc(), even though that's not guaranteed), or

Re: Hello, folks! Newbie to D, have some questions!

2017-02-19 Thread timmyjose via Digitalmars-d-learn
On Sunday, 19 February 2017 at 11:51:02 UTC, timmyjose wrote: On Saturday, 18 February 2017 at 21:58:15 UTC, ketmar wrote: [...] No, you're quite right indeed! First of all, those sound like very interesting project! :-), and you're right about the GC part. I have some experience in systems

Re: Hello, folks! Newbie to D, have some questions!

2017-02-19 Thread timmyjose via Digitalmars-d-learn
On Saturday, 18 February 2017 at 21:58:15 UTC, ketmar wrote: timmyjose wrote: Thanks for the very comprehensive response! I think most of my doubts are cleared now. You're right though that I'm probably worrying too much about GC with my current use case. i can tell you that i'm doing things

Re: Hello, folks! Newbie to D, have some questions!

2017-02-19 Thread timmyjose via Digitalmars-d-learn
On Saturday, 18 February 2017 at 21:51:34 UTC, Daniel Kozak wrote: Dne 18.2.2017 v 21:15 timmyjose via Digitalmars-d-learn napsal(a): [...] Hi, welcome in D community Thank you! I'm glad to be part of this excellent community! [...] Yes, by default D use GC. And yes there is a some

Re: Hello, folks! Newbie to D, have some questions!

2017-02-19 Thread timmyjose via Digitalmars-d-learn
On Saturday, 18 February 2017 at 22:17:30 UTC, berni wrote: I'm new here too (never heard of D before 2017). Glad to meet someone else new here! :-) c). The whole community seems infused with both the Feminism/SJW I didn't tried out Rust, but that would draw me away too. (Incidentally it

Re: Hello, folks! Newbie to D, have some questions!

2017-02-18 Thread Seb via Digitalmars-d-learn
On Saturday, 18 February 2017 at 21:09:20 UTC, ag0aep6g wrote: 5. Supposing I devote the time and energy and get up to speed on D, would the core language team be welcoming if I feel like I can contribute? Absolutely. Anyone is welcome to contribute. D is very much a volunteer effort. Also

Re: Hello, folks! Newbie to D, have some questions!

2017-02-18 Thread berni via Digitalmars-d-learn
I'm new here too (never heard of D before 2017). c). The whole community seems infused with both the Feminism/SJW I didn't tried out Rust, but that would draw me away too. (Incidentally it was a comment on alternatives for Rust, that pointed me to D.) 2. I am also curious as to what would

Re: Hello, folks! Newbie to D, have some questions!

2017-02-18 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: My rudimentary knowledge of the D ecosystem tells me that there is a GC in D, but that can be turned off. Is this correct? Technically yes; you will lose core functionality, though, if you do. I don't have the complete list at

Re: Hello, folks! Newbie to D, have some questions!

2017-02-18 Thread ketmar via Digitalmars-d-learn
timmyjose wrote: Thanks for the very comprehensive response! I think most of my doubts are cleared now. You're right though that I'm probably worrying too much about GC with my current use case. i can tell you that i'm doing things like, for example, ZX Spectrum emulator and hobbyst

Re: Hello, folks! Newbie to D, have some questions!

2017-02-18 Thread Daniel Kozak via Digitalmars-d-learn
Dne 18.2.2017 v 21:15 timmyjose via Digitalmars-d-learn napsal(a): Hello folks, I am interested in learning D (just starting out, did a few of the exercises on the D tour), and had some questions before I decide to jump right in. My questions are genuinely motivated by my experiences and

Re: Hello, folks! Newbie to D, have some questions!

2017-02-18 Thread timmyjose via Digitalmars-d-learn
On Saturday, 18 February 2017 at 21:27:55 UTC, sarn wrote: On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: [...] Hi :) [...] Okay, yes, it's easy to turn off or control the GC. It's also easy to control memory allocation in general (unlike, say, Java, where it's

Re: Hello, folks! Newbie to D, have some questions!

2017-02-18 Thread sarn via Digitalmars-d-learn
On Saturday, 18 February 2017 at 21:09:20 UTC, ag0aep6g wrote: Also, some threads online mention that if we do turn off GC, some of the core std libraries may not fully work. Is this presumption also correct? Yes. Whenever a std function returns a new string or some such it's going to be

Re: Hello, folks! Newbie to D, have some questions!

2017-02-18 Thread sarn via Digitalmars-d-learn
On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: Hello folks, Hi :) 2. I am more interested in learning D as a pure systems programming language so that I can develop my own tools (not looking to develop an OS, just some grep-scale tools to start off with). In that regard, I

Re: Hello, folks! Newbie to D, have some questions!

2017-02-18 Thread timmyjose via Digitalmars-d-learn
Thanks for the very comprehensive response! I think most of my doubts are cleared now. You're right though that I'm probably worrying too much about GC with my current use case. Also thanks for the links - they should also come in very handy indeed. I managed to find some book recommendations

Re: Hello, folks! Newbie to D, have some questions!

2017-02-18 Thread ag0aep6g via Digitalmars-d-learn
On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: 2. I am more interested in learning D as a pure systems programming language so that I can develop my own tools (not looking to develop an OS, just some grep-scale tools to start off with). In that regard, I have a few concerns

Hello, folks! Newbie to D, have some questions!

2017-02-18 Thread timmyjose via Digitalmars-d-learn
Hello folks, I am interested in learning D (just starting out, did a few of the exercises on the D tour), and had some questions before I decide to jump right in. My questions are genuinely motivated by my experiences and expectations, so please forgive me if some questions don't come across