Re: Fastest JSON parser in the world is a D project

2015-10-28 Thread wobbles via Digitalmars-d-announce

On Wednesday, 28 October 2015 at 11:26:59 UTC, wobbles wrote:


So yes - opDispatch is cool but should be used VERY sparingly.


I just had a thought, I could check if dataName is in 
[__traits(allMembers ... )]. That would at least ensure I'm 
referencing something that exists. Maybe that'd be useful in 
vibes Bson/Json code. (Except the opposite, you want to check 
you're referencing something that DOESN'T exist, so you can be 
sure it's not 'remove' for example).


Re: Fastest JSON parser in the world is a D project

2015-10-28 Thread wobbles via Digitalmars-d-announce

On Tuesday, 27 October 2015 at 14:00:07 UTC, Martin Nowak wrote:

On Tuesday, 27 October 2015 at 13:14:36 UTC, wobbles wrote:
How can `coordinates` member be known at compile-time when 
the input argument is a run-time string?


I suspect through the opDispatch operator overload.

http://dlang.org/operatoroverloading.html#dispatch


Yikes, this is such an anti-pattern.
https://github.com/rejectedsoftware/vibe.d/issues/634


Heh - yeah it is quite problematic.

The only time I've needed to use it was when I was reading in 
Json with some structure like

{
  [
{  "timestamp" : { ... timestamp info ... },
   "info1" : { ... info ...},
   "info2" : { ... info ...},
.
.
   "info 23" : { ... info  ...}
},
{ < more of the above >}
  ]
}

and I wanted to be able get a Json[timestamp] map, where the Json 
is either a info1, info2 etc etc.
I didn't want to write 23 different functions "hash_info1", 
"hash_info2" etc etc.

So, opDispatch!

Basically I wanted to hash the timestamp and some data. My 
opDispatch became:


@ignore auto opDispatch(string name)(){
		static assert(name.startsWith("hash_"), "Error, use 
StatHosts.hash_XYZ to gather XYZ[timestamp] info");

static assert(name.length > 5);
enum dataName = name[5..$];
typeof(mixin("StatDetail."~dataName))[StatTimestampDetail] data;

foreach(stat; statistics){
data[stat.timestamp] = mixin("stat."~dataName);
}
return data;
}

23 functions merged into 1...

The static assert reduces the number of places it can break 
things at least, still some weird things can happen but for the 
most part it's ok.


So yes - opDispatch is cool but should be used VERY sparingly.


Re: Fastest JSON parser in the world is a D project

2015-10-28 Thread Marco Leise via Digitalmars-d-announce
Am Tue, 27 Oct 2015 14:00:06 +
schrieb Martin Nowak :

> On Tuesday, 27 October 2015 at 13:14:36 UTC, wobbles wrote:
> >> How can `coordinates` member be known at compile-time when the 
> >> input argument is a run-time string?
> >
> > I suspect through the opDispatch operator overload.
> >
> > http://dlang.org/operatoroverloading.html#dispatch
> 
> Yikes, this is such an anti-pattern.
> https://github.com/rejectedsoftware/vibe.d/issues/634

For my defense I can say that the JSON parser is not a range
and thus less likely to be used in UFCS chains. It can be
replaced with .singleKey!"coordinates"()

-- 
Marco



Re: "Programming in D" ebook is available for purchase

2015-10-28 Thread Ali Çehreli via Digitalmars-d-announce

On 10/28/2015 02:32 AM, Joakim wrote:

> Do you have a bitcoin address I can use instead?

Sorry, I am way behind on that topic. :)

Ali



Re: Fastest JSON parser in the world is a D project

2015-10-28 Thread Adam D. Ruppe via Digitalmars-d-announce

On Tuesday, 27 October 2015 at 14:00:07 UTC, Martin Nowak wrote:

Yikes, this is such an anti-pattern.
https://github.com/rejectedsoftware/vibe.d/issues/634


Every time I use opDispatch, I add an if(name != "popFront") 
constraint, at least (unless it is supposed to be forwarding). It 
helps with this a lot and think everyone should do it.


Short film about our visit in Brasov

2015-10-28 Thread Andrei Alexandrescu via Digitalmars-d-announce

https://www.youtube.com/watch?v=s4EvygDNB0Q=youtu.be

Andrei


Re: Release Candidate D 2.069.0-rc1

2015-10-28 Thread sdfghj via Digitalmars-d-announce

On Monday, 26 October 2015 at 23:30:56 UTC, Martin Nowak wrote:

First and hopefully only release candidate for the 2.069.0.

http://dlang.org/download.html#dmd_beta 
http://dlang.org/changelog/2.069.0.html


A list of fixes over 2.069.0-b2 
https://github.com/D-Programming-Language/dlang.org/commit/aa3b957c1da47d2fe070c628045460c92a7a89b7.


Please report any bugs at https://issues.dlang.org

-Martin


I've found two possible regressions. The first is revealed when 
compiling dproto the second libasync. Issues :


- https://github.com/etcimon/libasync/issues/41
- https://github.com/msoucy/dproto/issues/58
- https://issues.dlang.org/show_bug.cgi?id=15253


LDC 0.16.1 has been released!

2015-10-28 Thread Kai Nacke via Digitalmars-d-announce

Hi everyone,

LDC 0.16.1, the LLVM-based D compiler, is available for download!
This release is based on the 2.067.1 frontend and standard 
library and supports LLVM 3.1-3.7 (OS X: no support for 3.3).


Don't miss to check if your preferred system is supported by this 
release. We also have a Win64 compiler available!


As usual, you can find links to the changelog and the binary 
packages over at digitalmars.D.ldc:

http://forum.dlang.org/post/uqibfhjpugaxnbsbf...@forum.dlang.org

Regards,
Kai



"Programming in D" ebook is available for purchase

2015-10-28 Thread Ali Çehreli via Digitalmars-d-announce
Although the book will always be free[1], many of you have expressed a 
need to pay without having to buy the paper version.


The ebook versions are now available at Gumroad:

  https://gum.co/PinD

The price is the very affordable $0+ ;) and you can pay with credit card 
number or through PayPal.


Ali

[1] http://ddili.org/ders/d.en/


Re: Fastest JSON parser in the world is a D project

2015-10-28 Thread Meta via Digitalmars-d-announce
On Wednesday, 28 October 2015 at 13:56:27 UTC, Adam D. Ruppe 
wrote:

On Tuesday, 27 October 2015 at 14:00:07 UTC, Martin Nowak wrote:

Yikes, this is such an anti-pattern.
https://github.com/rejectedsoftware/vibe.d/issues/634


Every time I use opDispatch, I add an if(name != "popFront") 
constraint, at least (unless it is supposed to be forwarding). 
It helps with this a lot and think everyone should do it.


I would go even farther and say that one should never define 
opDispatch without a template constraint limiting which members 
can be dispatched on. It may be a bit radical but we could even 
go as far as outright deprecating unconstrained opDispatch.


//Okay
auto opDispatch(string member)()
if (member == "get" || isVectorSwizzle!member)
{
//...
}

//Deprecated
auto opDispatch(string member)()
{
//...
}


Re: "Programming in D" ebook is available for purchase

2015-10-28 Thread Ali Çehreli via Digitalmars-d-announce

On 10/28/2015 11:29 AM, Andrei Alexandrescu wrote:

On 10/28/2015 10:50 AM, Andrei Alexandrescu wrote:

On 10/28/2015 04:01 AM, Ali Çehreli wrote:

Although the book will always be free[1], many of you have expressed a
need to pay without having to buy the paper version.

The ebook versions are now available at Gumroad:

   https://gum.co/PinD

The price is the very affordable $0+ ;) and you can pay with credit card
number or through PayPal.

Ali

[1] http://ddili.org/ders/d.en/


Ali is holding an impromptu AMA on reddit:
https://www.reddit.com/r/programming/comments/3qk8fz/programming_in_d_ebook_available_starting_at_001/



Approval rate is a monster at 97%. I've rarely seen such a high
percentage on /r/programming. Congratulations! -- Andrei



I can't believe this! I mad the book purchasable as pay-what-you-want 
about 10 hours ago and I've already received $99.99! That is already 
higher than the amount that the paper book sales brought since the 
beginning of this month. I will retire next week... :p


Thank you everyone! :)
Ali



National charsets support

2015-10-28 Thread Nikolay via Digitalmars-d-announce
I am quite happy with UTF support in phobos, but support for 
national codepages is very limited in phobos. Also it is not 
conform with ranges. So I decide share my project for supporting 
national charsets: 
https://bitbucket.org/sibnick/national-encoding.git


Sample code:

import national.charsets, std.array;
dstring s = "123Я";
auto cp1251 = Windows1251.encode(s).array;
auto utf32 = Windows1251.decode(cp1251).array;

ubyte[] cp866 = CHARSETS["cp866"].encode(s).array;
utf32 = CHARSETS["cp866"].decode(cp866).array;


Every codec accepts range of some chars and returns range of 
ubytes. Every decoder accepts range of ubytes  and returns range 
of dchars. This library is not cover UTF codecs, and multibytes 
national code pages.


Re: DConf 2016, Berlin: Call for Submissions is now open!

2015-10-28 Thread ponce via Digitalmars-d-announce

On Monday, 26 October 2015 at 10:12:30 UTC, ponce wrote:
On Sunday, 25 October 2015 at 23:59:16 UTC, Andrei Alexandrescu 
wrote:


Yes please! Forgot to mention that. Many thanks!! -- Andrei


Added to my TODO list :)


So I've made a logo here:
https://github.com/p0nce/dconf.org/blob/master/2016/images/logo.svg

If you like it tell and I'll make the usual dconf.org integration.

What needs to be written next to it?


Re: DConf 2016, Berlin: Call for Submissions is now open!

2015-10-28 Thread nazriel via Digitalmars-d-announce
On Friday, 23 October 2015 at 16:37:20 UTC, Andrei Alexandrescu 
wrote:
Please join us at DConf 2016, the conference of the D 
programming language in Berlin, Germany, May 4-6 2016.


[...]


Awesome that it is happening in Europe!
See ya soon then! :)


Re: "Programming in D" ebook is available for purchase

2015-10-28 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 10/28/2015 10:50 AM, Andrei Alexandrescu wrote:

On 10/28/2015 04:01 AM, Ali Çehreli wrote:

Although the book will always be free[1], many of you have expressed a
need to pay without having to buy the paper version.

The ebook versions are now available at Gumroad:

   https://gum.co/PinD

The price is the very affordable $0+ ;) and you can pay with credit card
number or through PayPal.

Ali

[1] http://ddili.org/ders/d.en/


Ali is holding an impromptu AMA on reddit:
https://www.reddit.com/r/programming/comments/3qk8fz/programming_in_d_ebook_available_starting_at_001/


Approval rate is a monster at 97%. I've rarely seen such a high 
percentage on /r/programming. Congratulations! -- Andrei




Re: "Programming in D" ebook is available for purchase

2015-10-28 Thread cym13 via Digitalmars-d-announce

On Wednesday, 28 October 2015 at 08:01:29 UTC, Ali Çehreli wrote:
Although the book will always be free[1], many of you have 
expressed a need to pay without having to buy the paper version.


It's a bit late now but I like what Cory Doctorow (a writter who 
publishes mainly books under Creative Common license) does: the 
epub/pdf version is free but if you want to participate without 
buying the paper version you can buy a book that will be given to 
a library (of your choice if you express one) instead. This 
allows participation as well as diffusion.


As this is not a book of fiction it may be suited to fewer 
libraries but I still think this is a concept worth sharing.


Re: DConf 2016, Berlin: Call for Submissions is now open!

2015-10-28 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 10/28/2015 01:00 PM, ponce wrote:

On Monday, 26 October 2015 at 10:12:30 UTC, ponce wrote:

On Sunday, 25 October 2015 at 23:59:16 UTC, Andrei Alexandrescu wrote:


Yes please! Forgot to mention that. Many thanks!! -- Andrei


Added to my TODO list :)


So I've made a logo here:
https://github.com/p0nce/dconf.org/blob/master/2016/images/logo.svg

If you like it tell and I'll make the usual dconf.org integration.

What needs to be written next to it?


Looks interesting but I fail to see "DConf". The text should read "DConf 
2016/May 4-6/Berlin, Germany" -- Andrei


Re: DConf 2016, Berlin: Call for Submissions is now open!

2015-10-28 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 10/28/2015 02:57 PM, ponce wrote:

On Wednesday, 28 October 2015 at 18:10:04 UTC, Andrei Alexandrescu wrote:

What needs to be written next to it?


Looks interesting but I fail to see "DConf". The text should read
"DConf 2016/May 4-6/Berlin, Germany" -- Andrei


That would give something like:
https://github.com/p0nce/dconf.org/blob/master/2016/images/logo-sample.png


Nice, thanks. What is the meaning of the "E" or "m"? -- Andrei


Re: "Programming in D" ebook is available for purchase

2015-10-28 Thread Ali Çehreli via Digitalmars-d-announce

On 10/28/2015 11:46 AM, cym13 wrote:

On Wednesday, 28 October 2015 at 08:01:29 UTC, Ali Çehreli wrote:

Although the book will always be free[1], many of you have expressed a
need to pay without having to buy the paper version.


It's a bit late now but I like what Cory Doctorow (a writter who
publishes mainly books under Creative Common license) does: the epub/pdf
version is free but if you want to participate without buying the paper
version you can buy a book that will be given to a library (of your
choice if you express one) instead. This allows participation as well as
diffusion.

As this is not a book of fiction it may be suited to fewer libraries but
I still think this is a concept worth sharing.


Interesting. That is almost the same as what I said to someone who 
wanted to contribute but did not want the paper book. I said "buy the 
paper book and give it to someone you know." :)


Ali



2music

2015-10-28 Thread captaindet via Digitalmars-d-announce

more BJM related
http://www.amazon.com/Declare-Nothing-Parks-Anton-Newcombe/dp/B00WZXX2NC


Re: DConf 2016, Berlin: Call for Submissions is now open!

2015-10-28 Thread ponce via Digitalmars-d-announce
On Wednesday, 28 October 2015 at 19:24:13 UTC, Andrei 
Alexandrescu wrote:

On 10/28/2015 02:57 PM, ponce wrote:
On Wednesday, 28 October 2015 at 18:10:04 UTC, Andrei 
Alexandrescu wrote:

What needs to be written next to it?


Looks interesting but I fail to see "DConf". The text should 
read

"DConf 2016/May 4-6/Berlin, Germany" -- Andrei


That would give something like:
https://github.com/p0nce/dconf.org/blob/master/2016/images/logo-sample.png


Nice, thanks. What is the meaning of the "E" or "m"? -- Andrei


It is supposed to refer to the Bundestag like in 
http://www.catherinefeff-studio.com/references/39636641Berlin_logo.gif


But I guess this part isn't working too well.


Re: DConf 2016, Berlin: Call for Submissions is now open!

2015-10-28 Thread ponce via Digitalmars-d-announce
On Wednesday, 28 October 2015 at 18:10:04 UTC, Andrei 
Alexandrescu wrote:

What needs to be written next to it?


Looks interesting but I fail to see "DConf". The text should 
read "DConf 2016/May 4-6/Berlin, Germany" -- Andrei


That would give something like: 
https://github.com/p0nce/dconf.org/blob/master/2016/images/logo-sample.png


Re: 2music

2015-10-28 Thread captaindet via Digitalmars-d-announce

sorry, emailer(me) malfunction. pls ignore


Re: "Programming in D" ebook is available for purchase

2015-10-28 Thread Dylan Allbee via Digitalmars-d-announce

On Wednesday, 28 October 2015 at 18:51:04 UTC, Ali Çehreli wrote:

On 10/28/2015 11:46 AM, cym13 wrote:
On Wednesday, 28 October 2015 at 08:01:29 UTC, Ali Çehreli 
wrote:
Although the book will always be free[1], many of you have 
expressed a

need to pay without having to buy the paper version.


It's a bit late now but I like what Cory Doctorow (a writter 
who
publishes mainly books under Creative Common license) does: 
the epub/pdf
version is free but if you want to participate without buying 
the paper
version you can buy a book that will be given to a library (of 
your
choice if you express one) instead. This allows participation 
as well as

diffusion.

As this is not a book of fiction it may be suited to fewer 
libraries but

I still think this is a concept worth sharing.


Interesting. That is almost the same as what I said to someone 
who wanted to contribute but did not want the paper book. I 
said "buy the paper book and give it to someone you know." :)


Ali


I really appreciate all of the work you've put into this book. 
It's been an immense help to myself and several friends both with 
learning the language and learning programming in general. It's 
typically the first book I recommend new students of programming 
to read.


Hope you get most of the cut from the ebook - Enjoy the donation. 
I only wish I could give more at the moment.


Re: LDC 0.16.1 has been released!

2015-10-28 Thread Matt Soucy via Digitalmars-d-announce
On 10/28/2015 03:52 AM, Kai Nacke wrote:
> Hi everyone,
> 
> LDC 0.16.1, the LLVM-based D compiler, is available for download!
> This release is based on the 2.067.1 frontend and standard library and 
> supports LLVM 3.1-3.7 (OS X: no support for 3.3).
> 
> Don't miss to check if your preferred system is supported by this release. We 
> also have a Win64 compiler available!
> 
> As usual, you can find links to the changelog and the binary packages over at 
> digitalmars.D.ldc:
> http://forum.dlang.org/post/uqibfhjpugaxnbsbf...@forum.dlang.org
> 
> Regards,
> Kai
> 

Fantastic!

Since ldc2 is part of the Fedora repositories, do you happen to know who is 
responsible for pushing the update in?

-- 
Matt Soucy
http://msoucy.me/



signature.asc
Description: OpenPGP digital signature


Re: DConf 2016, Berlin: Call for Submissions is now open!

2015-10-28 Thread Daniel Kozak via Digitalmars-d-announce
Wow, I can't wait :-). One question, when I would be able to make a
registration?

Dne 23. 10. 2015 18:40 napsal uživatel "Andrei Alexandrescu via
Digitalmars-d-announce" :
>
> Please join us at DConf 2016, the conference of the D programming
language in Berlin, Germany, May 4-6 2016.
>
> We're very very excited to hold DConf under Sociomantic's sponsorship in
their neck of the woods—Berlin, one of Europe's premier technology hotbeds.
Sociomantic has been a long-time supporter and user of D and we're grateful
to benefit of their hosting.
>
> The D programming language has continued to grow strongly through 2015 in
both use and development participation. The fledgling D Language Foundation
is poised to lead and organize the community better than ever before. DConf
is the main face-to-face event for everyone and everything related to the D
language and environment. The 2016 edition will be held in premiere in
Europe, on the heels of strong D adoption throughout the Old Continent.
We're gearing for our largest event yet!
>
> Call for Submissions
>
> We are looking forward to your submission for a paper, talk, demo, or
panel for DConf 2016. The topics of choice are anything and everything
related to the D language. For more details, check the conference page:
>
> http://dconf.org/2016/index.html
>


Re: DConf 2016, Berlin: Call for Submissions is now open!

2015-10-28 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 10/28/2015 06:10 PM, Daniel Kozak via Digitalmars-d-announce wrote:

Wow, I can't wait :-). One question, when I would be able to make a
registration?


Soon enough - probably by the end of next week. -- Andrei


Re: DConf 2016, Berlin: Call for Submissions is now open!

2015-10-28 Thread Walter Bright via Digitalmars-d-announce

On 10/28/2015 11:57 AM, ponce wrote:

On Wednesday, 28 October 2015 at 18:10:04 UTC, Andrei Alexandrescu wrote:

What needs to be written next to it?


Looks interesting but I fail to see "DConf". The text should read "DConf
2016/May 4-6/Berlin, Germany" -- Andrei


That would give something like:
https://github.com/p0nce/dconf.org/blob/master/2016/images/logo-sample.png


The logo looks nice, but it doesn't seem to be evocative of D. I think there 
needs to be a theme to it, like "D saves the world", "D is cool tech", "D makes 
money for business", "D is the choice of cutting edge programmers", "D is the 
latest technology", etc. Something like that.


Re: DConf 2016, Berlin: Call for Submissions is now open!

2015-10-28 Thread ponce via Digitalmars-d-announce
On Wednesday, 28 October 2015 at 23:02:59 UTC, Walter Bright 
wrote:

On 10/28/2015 11:57 AM, ponce wrote:
On Wednesday, 28 October 2015 at 18:10:04 UTC, Andrei 
Alexandrescu wrote:

What needs to be written next to it?


Looks interesting but I fail to see "DConf". The text should 
read "DConf

2016/May 4-6/Berlin, Germany" -- Andrei


That would give something like:
https://github.com/p0nce/dconf.org/blob/master/2016/images/logo-sample.png


The logo looks nice, but it doesn't seem to be evocative of D. 
I think there needs to be a theme to it, like "D saves the 
world", "D is cool tech", "D makes money for business", "D is 
the choice of cutting edge programmers", "D is the latest 
technology", etc. Something like that.


There is a D right there in the logo.
It think I'll let others step up with other designs.


Re: "Programming in D" ebook is available for purchase

2015-10-28 Thread Joakim via Digitalmars-d-announce

On Wednesday, 28 October 2015 at 08:01:29 UTC, Ali Çehreli wrote:
Although the book will always be free[1], many of you have 
expressed a need to pay without having to buy the paper version.


The ebook versions are now available at Gumroad:

  https://gum.co/PinD

The price is the very affordable $0+ ;) and you can pay with 
credit card number or through PayPal.


Ali

[1] http://ddili.org/ders/d.en/


Do you have a bitcoin address I can use instead?