January 15, 2015
On Thursday, 15 January 2015 at 15:38:05 UTC, Adam D. Ruppe wrote:
> I could totally fill in the "project spotlight" with stuff from that repo for at least a year, not even kidding. But I don't want it to be all about me!

Right, and it is more fun if you get response on reddit etc, so something short and useful that the reader can expand for her/his own cute little gadget is probably a good choice?

I've noticed that some blogs have links back to reddit with the link "discuss this article on reddit" at the bottom.

> (and oauth.d isn't new, i wrote that like three years ago... it had to be updated a while ago because twitter deprecated v1 of their api, but other than that, it hasn't changed much)

Oauth2.0 is not so complicated, but it is annoying to wade through all the irrelvant stuff on the web... So I'd say that would be a nice topic. A cut'n'paste solution of how to connect to "famous" services.

> a year ago). Soon to be replaced by the dependency-free simpledisplay.d, simpleaudio.d, joystick.d combo.

Sounds fun! Could break it up into 6 parts over 6 weeks:
- how to load images
- draw stuff on the screen
- control stuff on the screen
- simple physics simulation
- add sounds to collision events
- play lunar lander (or some other simple game)

> color.d - a color struct for RGBA, also does CSS color string read/writing, HSL <-> RGB, some color manipulation, alpha blending, and image base classes including palette to true color and true color to palette (quantization).

The CSS stuff might be a useful startingpoint for Manu's std.colour library?

> csv.d - simple csv reader, predates std.csv (and is a bit simpler)

All common data format conversions would be useful to have in cookbook format on the web. This is something I typically google for because I it is more like a "bump in the road" than a domain specific thing.

> database.d - base class for RDBMS access. Also includes basic ORM and query builder in the form of DataObject and SelectBuilder

Also a nice topic. Especially if you cover the configuration gotchas for common databases that is incredibly boring to get stuck on. A "problem solver" article, perhaps?

> dom.d - XML and HTML parsing and manipulation, including CSS selectors and other tools that can help for implementing a browser. API inspired by modern Javascript DOM, capable of scraping tag soup web pages.

Spiders are a fun topic too. Like "how to extract links from reddit" or some simple NLP heuristics that looks for keywords "hot topics this week".

> joystick.d - code for accessing XBox 360 controllers (and similar ones, like the PS1 controller via usb) on Windows and Linux.

Stuff like this sounds like a hit. Fun to read about even if you don't need it. I think geeks like to learn about what is under the hood of things they use.

> jsvar.d - a var type similar to Javascript, usable in D. Can be used to read and write JSON with a natural syntax and other dynamic type tasks.

Nice topic. "How to create your own dynamic type in D."

> script.d - a script interpeter based on jsvar.d. The script language is like a cross of D and Javascript. Made for API convenience - very very easy to embed in an application.

I think these "continued next week" hooks where you get something complete to play with in each issue are nice.

> simpleaudio.d - access to WinMM on Windows and ALSA on Linux for waveform sound I/O and MIDI I/O.

Yup, "under the hood" topic. I like to read those even if I don't need them.

> game.d - helper functions for writing games (bringing together the display, audio, and joystick stuff). I have OpenGL texture stuff written now, almost done with the high level input api, and some math stuff that will probably be in there.
>
> model.d - loading and displaying a 3d model format with open gl.
>
> midi.d, wav.d - loading, saving, and working with midi and wav files

Yep, all good stuff!

Nice concept you have going here.
January 15, 2015
On 1/15/15 12:49 AM, Szymon Gatner wrote:
> On Thursday, 15 January 2015 at 07:58:47 UTC, Andrei Alexandrescu wrote:
>> On 1/14/15 7:19 PM, brian wrote:
>>> My point was that there are fewer examples of *how* to do things in D.
>>> This will discourage the new user, which will prevent it becoming a more
>>> popular language.
>>
>> Yes, it would be great if we could crowdsource a cornucopia of "how
>> to" topics in D. -- Andrei
>
>
> Adam's D Cookbook kindof does that

Yah, we need stuff online and nice and with that upbeat ukulele music. -- Andrei

January 15, 2015
On 1/15/15 1:42 AM, weaselcat wrote:
> On Thursday, 15 January 2015 at 07:58:47 UTC, Andrei Alexandrescu wrote:
>> On 1/14/15 7:19 PM, brian wrote:
>>> My point was that there are fewer examples of *how* to do things in D.
>>> This will discourage the new user, which will prevent it becoming a more
>>> popular language.
>>
>> Yes, it would be great if we could crowdsource a cornucopia of "how
>> to" topics in D. -- Andrei
>
> D is the 8th most popular language on Rosetta Code(I think most of the
> entries are from a single person - Bearophile), it's within ~25 entries
> of C, Ruby, etc.

Way to go bearophile! Could somebody please insert a reference to Rosetta Code on dlang.org?

> There's also the cookbook on the wiki that's unfinished.
> http://wiki.dlang.org/Cookbook
> and the tutorial page
> http://wiki.dlang.org/Tutorials

Well those need to be finished before we advertise them.


Andrei
January 15, 2015
On Thursday, 15 January 2015 at 16:53:14 UTC, Andrei Alexandrescu wrote:
> On 1/15/15 1:42 AM, weaselcat wrote:
>> On Thursday, 15 January 2015 at 07:58:47 UTC, Andrei Alexandrescu wrote:
>>> On 1/14/15 7:19 PM, brian wrote:
>>>> My point was that there are fewer examples of *how* to do things in D.
>>>> This will discourage the new user, which will prevent it becoming a more
>>>> popular language.
>>>
>>> Yes, it would be great if we could crowdsource a cornucopia of "how
>>> to" topics in D. -- Andrei
>>
>> D is the 8th most popular language on Rosetta Code(I think most of the
>> entries are from a single person - Bearophile), it's within ~25 entries
>> of C, Ruby, etc.
>
> Way to go bearophile! Could somebody please insert a reference to Rosetta Code on dlang.org?
>
>> There's also the cookbook on the wiki that's unfinished.
>> http://wiki.dlang.org/Cookbook
>> and the tutorial page
>> http://wiki.dlang.org/Tutorials
>
> Well those need to be finished before we advertise them.
>
>
> Andrei

I suppose such things will never be really 'finished', but indeed they are of uneven quality, and sort of scattered.  Seems like a rather random collection of stuff, which is a testament to the project's open source nature.

Finally, one issue with using a Wiki in general is that it would be nice if any code snippets in D howto's, FAQs, tutorials, etc could be run through the latest DMD release so that it doesn't get 'out of step' with the current language. I suppose if most of the Howto's/Tutorials were written in DDOC the Howto/Tutorials could be run through the auto-tester ... but I am not sure exactly how this would be done/how difficult it would be.
January 15, 2015
On Thursday, 15 January 2015 at 17:32:11 UTC, CraigDillabaugh wrote:
> On Thursday, 15 January 2015 at 16:53:14 UTC, Andrei Alexandrescu wrote:
>> On 1/15/15 1:42 AM, weaselcat wrote:
>>> On Thursday, 15 January 2015 at 07:58:47 UTC, Andrei Alexandrescu wrote:
>>>> On 1/14/15 7:19 PM, brian wrote:
>>>>> My point was that there are fewer examples of *how* to do things in D.
>>>>> This will discourage the new user, which will prevent it becoming a more
>>>>> popular language.
>>>>
>>>> Yes, it would be great if we could crowdsource a cornucopia of "how
>>>> to" topics in D. -- Andrei
>>>
>>> D is the 8th most popular language on Rosetta Code(I think most of the
>>> entries are from a single person - Bearophile), it's within ~25 entries
>>> of C, Ruby, etc.
>>
>> Way to go bearophile! Could somebody please insert a reference to Rosetta Code on dlang.org?
>>
>>> There's also the cookbook on the wiki that's unfinished.
>>> http://wiki.dlang.org/Cookbook
>>> and the tutorial page
>>> http://wiki.dlang.org/Tutorials
>>
>> Well those need to be finished before we advertise them.
>>
>>
>> Andrei
>
> I suppose such things will never be really 'finished', but indeed they are of uneven quality, and sort of scattered.  Seems like a rather random collection of stuff, which is a testament to the project's open source nature.
>
> Finally, one issue with using a Wiki in general is that it would be nice if any code snippets in D howto's, FAQs, tutorials, etc could be run through the latest DMD release so that it doesn't get 'out of step' with the current language. I suppose if most of the Howto's/Tutorials were written in DDOC the Howto/Tutorials could be run through the auto-tester ... but I am not sure exactly how this would be done/how difficult it would be.

I think I should clarify my last point a bit.  What I had in mind, it that for tutorials/faqs/howtos, etc. It would be nice if each tutorial/howto were coded as a single D file, with the actual content in DDOC format, and any D code as compilable code within the file.  Then at each new release the tutorials could be compiled to make sure they stay in sync.

When I said I was unsure how difficult this would be I meant that this may present challenges for tutorial writers.  Also, in this case you would want your code (or a subset thereof) to show up in the output. Not sure if DDOC could handle that.
January 15, 2015
We're kinda going off topic here, but..

(BTW, I just hit escape AGAIN after typing that. my vim habits are going overgrown!)

On Thursday, 15 January 2015 at 16:31:56 UTC, Ola Fosheim Grøstad wrote:
> Right, and it is more fun if you get response on reddit etc, so something short and useful that the reader can expand for her/his own cute little gadget is probably a good choice?

yeah. I actually did the stack thing in the last issue because someone asked about it on reddit so I figured it is a kinda hotish topic.

> Oauth2.0 is not so complicated, but it is annoying to wade through all the irrelvant stuff on the web...

My thing is mostly doing the 1.0 version, and the complication wasn't even so much the thing itself, but the varying interpretations of the "standard" that were around a few years ago. Like Twitter was case insensitive and LinkedIn wasn't and they expected different names and just silly little things like that. And, of course, when it fails, it just says "bad signature", you don't know why...

I think it is all working well now though, I've used that oauth.d with a bunch of services, at least last year, I didn't do so much D web stuff in 2014.

> Sounds fun! Could break it up into 6 parts over 6 weeks:

hmm, I could play with that. (also snipping a lot of other good ideas throughout btw)

> The CSS stuff might be a useful startingpoint for Manu's std.colour library?

Maybe, though I just kinda hacked it together without knowing a great deal about the underlying theory, so Manu would probably do a better job than I did anyway.

> Stuff like this sounds like a hit. Fun to read about even if you don't need it. I think geeks like to learn about what is under the hood of things they use.

Ah, but it is easy! On Windows especially, they offer a new XInput dll that is made specifically for the xbox 360 controller and has super easy access to all its features. The hardest thing for me has been reconciling it with my old PS1 controller which I prefer the shape of...

I suppose I could talk about it anyway though, there's a few nice bits of implementation we could go over.

> Nice topic. "How to create your own dynamic type in D."

I'm thinking about doing this at dconf this year!
January 15, 2015
On Thu, Jan 15, 2015 at 06:00:36PM +0000, Adam D. Ruppe via Digitalmars-d wrote:
> We're kinda going off topic here, but..
> 
> (BTW, I just hit escape AGAIN after typing that. my vim habits are
> going overgrown!)
[...]

Only just??! For years now I've had this uncontrollable twitch in my left hand, that every so often reaches in the direction of the ESC key without my awareness. It's a sign of a true hardcore vi(m) user. :-P


T

-- 
Spaghetti code may be tangly, but lasagna code is just cheesy.
January 15, 2015
On Thursday, 15 January 2015 at 18:00:38 UTC, Adam D. Ruppe wrote:
> We're kinda going off topic here, but..

Getting dependency free cook-book stuff on the web, that you just cut'n'paste into your editor could have a huge influence on D becoming more used.  Encouraging people to write small utilities that run faster than scripting languages allow with the same amount of typing.

There's something to the phrase: «Show, don't tell!»


> (BTW, I just hit escape AGAIN after typing that. my vim habits are going overgrown!)

I get the same feeling when going from Emacs to Windows... Ctrl-X Ctrl-S. Very annoying to first delete a lot of stuff and then saving it... :-/


> I think it is all working well now though, I've used that oauth.d with a bunch of services, at least last year, I didn't do so much D web stuff in 2014.

All the google stuff is Oauth2, I think. But without a «show, don't tell» cut'n'paste solution I'm more like "sounds complicated and tedious, it can wait...".


> Ah, but it is easy! On Windows especially, they offer a new XInput dll that is made specifically for the xbox 360 controller and has super easy access to all its features. The hardest thing for me has been reconciling it with my old PS1 controller which I prefer the shape of...
>
> I suppose I could talk about it anyway though, there's a few nice bits of implementation we could go over.

I think many have a 1-minute attention span when surfing the web, so I would worry more about not making it short enough than too short. You could probably structure such articles so that the fun part is on the top of the page and the "how to do it" on the lower part.

Besides it makes for a good reddit/hacker news title, so people might just comment on it to talk about their own stuff. Which is good. It still gets D exposure.


>> Nice topic. "How to create your own dynamic type in D."
>
> I'm thinking about doing this at dconf this year!

Neat, Iooking forward to the slides!
January 15, 2015
On Thursday, 15 January 2015 at 16:53:14 UTC, Andrei Alexandrescu wrote:
> On 1/15/15 1:42 AM, weaselcat wrote:
>> On Thursday, 15 January 2015 at 07:58:47 UTC, Andrei Alexandrescu wrote:
>>> On 1/14/15 7:19 PM, brian wrote:
>>>> My point was that there are fewer examples of *how* to do things in D.
>>>> This will discourage the new user, which will prevent it becoming a more
>>>> popular language.
>>>
>>> Yes, it would be great if we could crowdsource a cornucopia of "how
>>> to" topics in D. -- Andrei
>>
>> D is the 8th most popular language on Rosetta Code(I think most of the
>> entries are from a single person - Bearophile), it's within ~25 entries
>> of C, Ruby, etc.
>
> Way to go bearophile! Could somebody please insert a reference to Rosetta Code on dlang.org?
>
>> There's also the cookbook on the wiki that's unfinished.
>> http://wiki.dlang.org/Cookbook
>> and the tutorial page
>> http://wiki.dlang.org/Tutorials
>
> Well those need to be finished before we advertise them.
>
>
> Andrei

bearophile did an awesome job. hats off.

i've noticed there are some code that are not working such as the anonymous recursion example. [0] the first example there doesn't work but the second one works with DMD64 D Compiler v2.066.

let's get together and find out which examples are working well and which are not.

[0] http://rosettacode.org/wiki/Anonymous_recursion#D
January 15, 2015
On Thursday, 15 January 2015 at 10:19:36 UTC, Joakim wrote:
> On Thursday, 15 January 2015 at 08:54:34 UTC, ponce wrote:
>> On Thursday, 15 January 2015 at 03:19:10 UTC, brian wrote:
>>>
>>> My point wasn't that there aren't ways to do things in D.
>>> My point was that there are fewer examples of *how* to do things in D.
>>> This will discourage the new user, which will prevent it becoming a more popular language.
>>> So if I'm looking for a new language to use, I'd probably stick to the ones that have more examples.
>>
>> Does this help? http://p0nce.github.io/d-idioms/
>
> Just went through your list of idioms, noticed one mistake, anonymous _nested_ structs/unions are in D:
>
> "anonymous structs/unions are allowed as members of other structs/unions"
> http://dlang.org/struct.html

Actually it's more complicated than that, _some_ anonymous nested struct are in D, but not the ones you need to translate C.
https://github.com/p0nce/d-idioms/issues/10#issuecomment-70154005