April 19, 2014
> BTW it now has a cover image, that's a painting my brother did called "View from Phobos", seemed appropriate :P

Wow! :)
April 19, 2014
On Friday, 18 April 2014 at 23:03:54 UTC, Jason King wrote:
> Packt is having a 1/2 price ebooks sale, so if you haven't gotten this yet, now would be the time.  I just did.

Yes, I did it too.
May 05, 2014
On Monday, 3 March 2014 at 16:37:49 UTC, Adam D. Ruppe wrote:
> As some of you might know, I've been working on a D book over the last few months. It is now available as "coming soon" on the publisher's website:
>
> http://www.packtpub.com/discover-advantages-of-programming-in-d-cookbook/book
>

Congrats. Is there a early access option, like Manning Early Access Program, instead of just pre-order?

Thanks
Dan
May 05, 2014
We're publishing in about two weeks now so it won't be long until the real thing is out anyway!
May 06, 2014
On Monday, 5 May 2014 at 12:34:18 UTC, Adam D. Ruppe wrote:
> We're publishing in about two weeks now so it won't be long until the real thing is out anyway!

Any way to see the TOC?

May 06, 2014
On Tuesday, 6 May 2014 at 12:40:48 UTC, Szymon Gatner wrote:
> Any way to see the TOC?

Hmm, not on the website yet but here it is. Each one is shown through examples (with a few exceptions where I couldn't think of a good example but wanted to discuss the principle behind it anyway):

Chapter 1: "Core Tasks", has a brief introduction to D then gets into using modules, libraries, immutability, classes, basic stuff to get you acquainted with the core language.

BTW the book assumes you already know basic programming stuff, so I don't explain what variables are and stuff like that.

Chapter 2: "Phobos", goes over some phobos modules to show you the basic idea. Covers files and directories, socket clients and servers, zlib, random numbers, and a bit more. It isn't comprehensive, there's the documentation for that, but it covers a few important points you'll need to know throughout through representative examples.

Chapter 3: "Ranges" goes over how to create a range, use a range (including something I had to ask the group: what is a "generic input range"?), transform ranges, and use some of the algorithms. Also goes into why the efficiency rules are important (don't emulate range features you don't really support) by showing a bad sort result with a linked list that pretends to be an array.

Chapter 4: "Integration" talks about how to integrate with outside code, including calling C functions (including doing your own bindings and using implib on Windows), C++ interfaces, Windows API and Linux system calls in asm, C functions calling D, using COM, cross-language resource management (briefly) and I show some convenient scripting bindings using opDispatch with my script.d

Chapter 5: "Resource Management" gives tips on avoiding the GC, writing your own reference counted objects, using owned pointers, and stuff like how not to use class destructors.

Chapter 6: "Wrapped Types" goes into a bunch of struct features you can use to wrap other things. Includes a cute trick to make a gettext translation file in D alone, operator overloading, disabling default construction, etc.

Chapter 7: "Correctness Checking" talks about bug catching. Includes an introduction to ddoc, static assert, throw vs assert, @safe, and more.

Chapter 8: "Reflection" goes into compile time and runtime reflection including TypeInfo, __traits, is(), std.traits, and using module constructors to extend typeinfo. Culminates in an automatic function caller from the command line, showing how to get functions by name, convert strings to their arguments, and their return values back to strings, all generically with CT reflection.

Chapter 9: "Code Generation" talks about user-defined literals (including showing a disassembly to you can prove it did what it was supposed to do), template value parameters, string mixins, domain-specific language converters (including a relatively traditional programming language and an ASCII art diagram conversion to a struct), and talks about doing more efficient generation with the right statements so the optimizer can do its magic.

Chapter 10: "Multitasking" introduces you to threads, fibers, pipe process, and std.parallelism. I don't go too deeply into all this since I think the documentation and Andrei's book both did a good job and I didn't have a lot to add.

(generally, I wanted my book to be a nice complement to Andrei's book and avoid repeating documentation, so it is genuinely something new that you might not have seen before. Though much of it is stuff I've talked about on the forums, stack overflow, or IRC, so it won't be all new if you've seen my posts over the last couple years.)

Chapter 11: "Kernel coding in D" gets you started using D on bare metal x86; booting your PC to a D program without an operating system. Shows how to remove druntime then add back the minimal parts to get hello world to compile, how to easily compile and link the program so it can run without the OS (a simpler process can be used to make a minimal tiny binary that works on an OS btw, it would be like using D as C), then kinda dumps some code on you to get keyboard interrupt handling working.

I didn't go into the details of how the hardware specific code works; I didn't explain what an interrupt table actually is or why its format is so weird, but I did give you the pieces to make it work and discuss the D features that are helpful in this environment (and some pitfalls) like naked asm functions.

Chapter 12: "Web and GUI programming" shows how to get some fun stuff started with my misc github libraries including a dynamic website, a desktop graphics demo, some image file manipulation, an OpenGL window, and my dom.d for HTML parsing and manipulation.

The main focus isn't so much how to use the libraries though, there's the [s]docs[/s] lol, the source and emailing me with questions for that. Instead, I talked more about how I implemented them and some lessons learned in the process so you see more practical application of stuff the book talked about before and can hopefully use that to extend your own libraries.

Each thing also has a See Also section pointing to other D libraries.

Appendix A: has a small assortment of things that didn't fit elsewhere like bare metal ARM getting started, Raspberry Pi coding, getting a stack trace without an exception, the exponent operator, and finally, how to get more help and resources about D.
May 06, 2014
On Tuesday, 6 May 2014 at 13:12:01 UTC, Adam D. Ruppe wrote:
> On Tuesday, 6 May 2014 at 12:40:48 UTC, Szymon Gatner wrote:
>> Any way to see the TOC?
>
> Hmm, not on the website yet but here it is. Each one is shown through examples (with a few exceptions where I couldn't think of a good example but wanted to discuss the principle behind it anyway):
>
> Chapter 1: "Core Tasks", has a brief introduction to D then gets into using modules, libraries, immutability, classes, basic stuff to get you acquainted with the core language.
>
> BTW the book assumes you already know basic programming stuff, so I don't explain what variables are and stuff like that.
>
> Chapter 2: "Phobos", goes over some phobos modules to show you the basic idea. Covers files and directories, socket clients and servers, zlib, random numbers, and a bit more. It isn't comprehensive, there's the documentation for that, but it covers a few important points you'll need to know throughout through representative examples.
>
> Chapter 3: "Ranges" goes over how to create a range, use a range (including something I had to ask the group: what is a "generic input range"?), transform ranges, and use some of the algorithms. Also goes into why the efficiency rules are important (don't emulate range features you don't really support) by showing a bad sort result with a linked list that pretends to be an array.
>
> Chapter 4: "Integration" talks about how to integrate with outside code, including calling C functions (including doing your own bindings and using implib on Windows), C++ interfaces, Windows API and Linux system calls in asm, C functions calling D, using COM, cross-language resource management (briefly) and I show some convenient scripting bindings using opDispatch with my script.d
>
> Chapter 5: "Resource Management" gives tips on avoiding the GC, writing your own reference counted objects, using owned pointers, and stuff like how not to use class destructors.
>
> Chapter 6: "Wrapped Types" goes into a bunch of struct features you can use to wrap other things. Includes a cute trick to make a gettext translation file in D alone, operator overloading, disabling default construction, etc.
>
> Chapter 7: "Correctness Checking" talks about bug catching. Includes an introduction to ddoc, static assert, throw vs assert, @safe, and more.
>
> Chapter 8: "Reflection" goes into compile time and runtime reflection including TypeInfo, __traits, is(), std.traits, and using module constructors to extend typeinfo. Culminates in an automatic function caller from the command line, showing how to get functions by name, convert strings to their arguments, and their return values back to strings, all generically with CT reflection.
>
> Chapter 9: "Code Generation" talks about user-defined literals (including showing a disassembly to you can prove it did what it was supposed to do), template value parameters, string mixins, domain-specific language converters (including a relatively traditional programming language and an ASCII art diagram conversion to a struct), and talks about doing more efficient generation with the right statements so the optimizer can do its magic.
>
> Chapter 10: "Multitasking" introduces you to threads, fibers, pipe process, and std.parallelism. I don't go too deeply into all this since I think the documentation and Andrei's book both did a good job and I didn't have a lot to add.
>
> (generally, I wanted my book to be a nice complement to Andrei's book and avoid repeating documentation, so it is genuinely something new that you might not have seen before. Though much of it is stuff I've talked about on the forums, stack overflow, or IRC, so it won't be all new if you've seen my posts over the last couple years.)
>
> Chapter 11: "Kernel coding in D" gets you started using D on bare metal x86; booting your PC to a D program without an operating system. Shows how to remove druntime then add back the minimal parts to get hello world to compile, how to easily compile and link the program so it can run without the OS (a simpler process can be used to make a minimal tiny binary that works on an OS btw, it would be like using D as C), then kinda dumps some code on you to get keyboard interrupt handling working.
>
> I didn't go into the details of how the hardware specific code works; I didn't explain what an interrupt table actually is or why its format is so weird, but I did give you the pieces to make it work and discuss the D features that are helpful in this environment (and some pitfalls) like naked asm functions.
>
> Chapter 12: "Web and GUI programming" shows how to get some fun stuff started with my misc github libraries including a dynamic website, a desktop graphics demo, some image file manipulation, an OpenGL window, and my dom.d for HTML parsing and manipulation.
>
> The main focus isn't so much how to use the libraries though, there's the [s]docs[/s] lol, the source and emailing me with questions for that. Instead, I talked more about how I implemented them and some lessons learned in the process so you see more practical application of stuff the book talked about before and can hopefully use that to extend your own libraries.
>
> Each thing also has a See Also section pointing to other D libraries.
>
> Appendix A: has a small assortment of things that didn't fit elsewhere like bare metal ARM getting started, Raspberry Pi coding, getting a stack trace without an exception, the exponent operator, and finally, how to get more help and resources about D.

Holy s**t, that is a lot! How did you manage to fit all this in 337 pages?! I assume it has standard PACKT format ("give it a go hero" etc)? Bought it and waiting for a release :) Congratz!
May 06, 2014
On Tuesday, 6 May 2014 at 13:19:09 UTC, Szymon Gatner wrote:
> Holy s**t, that is a lot! How did you manage to fit all this in 337 pages?!

Each individual item tended to only be about 3 pages, some shorter, a few longer (I had a fair chunk to say about ranges and reflection, not so much to say about threads and phobos) and in some cases I kinda ask the reader to take things on faith.

Mostly, I explain the faith stuff on the following page, but in the bare metal thing, like i said before, some of it is just "that interacts with the hardware, trust me". So that chapter was only about 15 pages.... a lot for two "recipes" ("hello world" and "handling interrupts"), but certainly not a comprehensive covering of the subject.

I gotta writing my dconf talk next though that will go a bit more into it, but again, with a focus on druntime functions more than on how the hardware actually works.

> I assume it has standard PACKT format ("give it a go hero" etc)? Bought it and waiting for a release :) Congratz!

yeah, it starts with a list of steps, then usually shows code (not always a complete program but usually), then some talk about how it works and covering details.

the code should also be available as a separate download for each thing so you can run it more easily and play with it that way.
May 06, 2014
On Tuesday, 6 May 2014 at 13:12:01 UTC, Adam D. Ruppe wrote:
> On Tuesday, 6 May 2014 at 12:40:48 UTC, Szymon Gatner wrote:
>> Any way to see the TOC?
>
> Hmm, not on the website yet but here it is. Each one is shown through examples (with a few exceptions where I couldn't think of a good example but wanted to discuss the principle behind it anyway):
>
> Chapter 1: "Core Tasks", has a brief introduction to D then gets into using modules, libraries, immutability, classes, basic stuff to get you acquainted with the core language.
>
> BTW the book assumes you already know basic programming stuff, so I don't explain what variables are and stuff like that.
>
> Chapter 2: "Phobos", goes over some phobos modules to show you the basic idea. Covers files and directories, socket clients and servers, zlib, random numbers, and a bit more. It isn't comprehensive, there's the documentation for that, but it covers a few important points you'll need to know throughout through representative examples.
>
> Chapter 3: "Ranges" goes over how to create a range, use a range (including something I had to ask the group: what is a "generic input range"?), transform ranges, and use some of the algorithms. Also goes into why the efficiency rules are important (don't emulate range features you don't really support) by showing a bad sort result with a linked list that pretends to be an array.
>
> Chapter 4: "Integration" talks about how to integrate with outside code, including calling C functions (including doing your own bindings and using implib on Windows), C++ interfaces, Windows API and Linux system calls in asm, C functions calling D, using COM, cross-language resource management (briefly) and I show some convenient scripting bindings using opDispatch with my script.d
>
> Chapter 5: "Resource Management" gives tips on avoiding the GC, writing your own reference counted objects, using owned pointers, and stuff like how not to use class destructors.
>
> Chapter 6: "Wrapped Types" goes into a bunch of struct features you can use to wrap other things. Includes a cute trick to make a gettext translation file in D alone, operator overloading, disabling default construction, etc.
>
> Chapter 7: "Correctness Checking" talks about bug catching. Includes an introduction to ddoc, static assert, throw vs assert, @safe, and more.
>
> Chapter 8: "Reflection" goes into compile time and runtime reflection including TypeInfo, __traits, is(), std.traits, and using module constructors to extend typeinfo. Culminates in an automatic function caller from the command line, showing how to get functions by name, convert strings to their arguments, and their return values back to strings, all generically with CT reflection.
>
> Chapter 9: "Code Generation" talks about user-defined literals (including showing a disassembly to you can prove it did what it was supposed to do), template value parameters, string mixins, domain-specific language converters (including a relatively traditional programming language and an ASCII art diagram conversion to a struct), and talks about doing more efficient generation with the right statements so the optimizer can do its magic.
>
> Chapter 10: "Multitasking" introduces you to threads, fibers, pipe process, and std.parallelism. I don't go too deeply into all this since I think the documentation and Andrei's book both did a good job and I didn't have a lot to add.
>
> (generally, I wanted my book to be a nice complement to Andrei's book and avoid repeating documentation, so it is genuinely something new that you might not have seen before. Though much of it is stuff I've talked about on the forums, stack overflow, or IRC, so it won't be all new if you've seen my posts over the last couple years.)
>
> Chapter 11: "Kernel coding in D" gets you started using D on bare metal x86; booting your PC to a D program without an operating system. Shows how to remove druntime then add back the minimal parts to get hello world to compile, how to easily compile and link the program so it can run without the OS (a simpler process can be used to make a minimal tiny binary that works on an OS btw, it would be like using D as C), then kinda dumps some code on you to get keyboard interrupt handling working.
>
> I didn't go into the details of how the hardware specific code works; I didn't explain what an interrupt table actually is or why its format is so weird, but I did give you the pieces to make it work and discuss the D features that are helpful in this environment (and some pitfalls) like naked asm functions.
>
> Chapter 12: "Web and GUI programming" shows how to get some fun stuff started with my misc github libraries including a dynamic website, a desktop graphics demo, some image file manipulation, an OpenGL window, and my dom.d for HTML parsing and manipulation.
>
> The main focus isn't so much how to use the libraries though, there's the [s]docs[/s] lol, the source and emailing me with questions for that. Instead, I talked more about how I implemented them and some lessons learned in the process so you see more practical application of stuff the book talked about before and can hopefully use that to extend your own libraries.
>
> Each thing also has a See Also section pointing to other D libraries.
>
> Appendix A: has a small assortment of things that didn't fit elsewhere like bare metal ARM getting started, Raspberry Pi coding, getting a stack trace without an exception, the exponent operator, and finally, how to get more help and resources about D.

Wow! I'm really looking forward to reading it. I'll probably first have a look at the Ranges chapter and dom.d.
May 06, 2014
On Tuesday, 6 May 2014 at 13:39:51 UTC, Adam D. Ruppe wrote:
> On Tuesday, 6 May 2014 at 13:19:09 UTC, Szymon Gatner wrote:
>> Holy s**t, that is a lot! How did you manage to fit all this in 337 pages?!
>
> Each individual item tended to only be about 3 pages, some shorter, a few longer (I had a fair chunk to say about ranges and reflection, not so much to say about threads and phobos) and in some cases I kinda ask the reader to take things on faith.
>
> Mostly, I explain the faith stuff on the following page, but in the bare metal thing, like i said before, some of it is just "that interacts with the hardware, trust me". So that chapter was only about 15 pages.... a lot for two "recipes" ("hello world" and "handling interrupts"), but certainly not a comprehensive covering of the subject.
>
> I gotta writing my dconf talk next though that will go a bit more into it, but again, with a focus on druntime functions more than on how the hardware actually works.
>
>> I assume it has standard PACKT format ("give it a go hero" etc)? Bought it and waiting for a release :) Congratz!
>
> yeah, it starts with a list of steps, then usually shows code (not always a complete program but usually), then some talk about how it works and covering details.
>
> the code should also be available as a separate download for each thing so you can run it more easily and play with it that way.

Everything sounds great, really can't wait. Coming from C++ I am really interested in resource management. I still can't find myself in non-deterministic d-tor / GC world (and recent discussion on removal of d-tors entirely isn't helping ;P).