News for hackers. Stuff that matters.
Re:How does D improve on C++17? by giancarlostoro on Sunday April 26, 2015 @07:55PM (#9443767)
I'm curious how many people out there on HN actully use D and what for? I don't typically see D based projects here on HN so it would be interesting to find out about any use cases where D was found a perfect fit.
Re:How does D improve on C++17? by CyberShadow on Sunday April 26, 2015 @09:53PM (#9444046)
I use D for ... almost everything. https://github.com/CyberShadow?tab=repositories

Here's a bit of code from a personal shopping comparison program I wrote a few days ago, which combines some standard library constructs with my own libraries:

  string findProduct(string name)
  {
      return
          ("http://www.tp-link.com/en/search/?q=" ~ encodeComponent(name))
          .download
          .readText
          .toXML
          .xmlParse
          .I!(doc => zip(
              doc
              .findAll("#productResult > li > dl > dt > a")
              .map!(e => e.attributes["href"])
          ,    
              doc
              .findAll("#productResult > li > dl > dt > a")
              .map!(e => e.children[$-1].text.strip)
          ))
          .filter!(t => !icmp(t[1], name))
          .I!(r => r.empty ? null : "http://www.tp-link.com" ~ r.front[0])
      ;
  }
Re:How does D improve on C++17? by giancarlostoro on Monday April 27, 2015 @04:56AM (#9445076)
I know your projects! You made RABCDasm, which is used extensively on a certain game I used to play around in, people are still using it. Hah, I mostly asked this question because I was reminded of you, you're one of the first developers I saw who does most of their work in D.

Thanks for all your hard work, there's people out there who really found RABCDAsm really helpful, and it inspired a lot of fun software in the process.

Re:How does D improve on C++17? by CyberShadow on Monday April 27, 2015 @06:02AM (#9445275)
Ah, thank you! Long live game modding ;)
Re:How does D improve on C++17? by Ace17 on Monday April 27, 2015 @01:40AM (#9444520)
95% of the code I work on is D.

D fits lots of purposes (more than C++), but I'm only going to talk about scripting.

The minimalistic approach for the C++ standard library makes C++ inappropriate to replace, for example, Bash scripts. In C++, you can't do any operation on the file system (erase a directory, get file size, list files, create pipes, ..) in a portable way. You can't create processes in a portable way.

The D standard library (aka Phobos) doesn't suffer these limitations. Which means you can write very high-level code using only a few (readable) lines. By adding a shebang "#!/usr/bin/env rdmd" at the beginning of your D programs, you can execute them without prior explicit compilation, like: ./myProgram.d

I've been porting all my Bash scripts to D. The code runs incredibly faster, and now I can have structs again!

Re:How does D improve on C++17? by vtuulos on Sunday April 26, 2015 @08:16PM (#9443825)
We (AdRoll) use it for performance-sensitive machine learning:

http://tech.adroll.com/blog/data/2014/11/17/d-is-for-data-sc...

Re:How does D improve on C++17? by giancarlostoro on Monday April 27, 2015 @04:48AM (#9445047)
Nice, thanks for the blog post.
Re:How does D improve on C++17? by edmccard on Sunday April 26, 2015 @08:55PM (#9443901)
Facebook uses Warp[1] as a fast replacement for the c/c++ preprocessor.

[1]https://github.com/facebook/warp

Re:How does D improve on C++17? by lambdafunc on Sunday April 26, 2015 @08:22PM (#9443838)
This is an interesting one: https://github.com/prestodb/presto-odbc But I am not sure whether D is a perfect fit here though.
Re:How does D improve on C++17? by maxerickson on Sunday April 26, 2015 @08:08PM (#9443809)
WalterBright uses it in his compiler.
Re:How does D improve on C++17? by edmccard on Sunday April 26, 2015 @08:56PM (#9443902)
>WalterBright uses it in his compiler.

Ironically, the dmd compiler is written in C++.

Re:How does D improve on C++17? by WalterBright on Sunday April 26, 2015 @09:25PM (#9443980)
D didn't exist when the dmd compiler was written. But Daniel Murphy has written a C++ to D converter, and it's looking like the next release will have dmd written in D.
Re:How does D improve on C++17? by edmccard on Sunday April 26, 2015 @09:39PM (#9444021)
>it's looking like the next release will have dmd written in D.

Is that going to make it trickier for GDC/LDC to stay in sync with DMD? (Either way, it's exciting news!)

Re:How does D improve on C++17? by WalterBright on Sunday April 26, 2015 @09:48PM (#9444038)
Tricky or not, they're on board with the jump.
Re:How does D improve on C++17? by henderson101 on Monday April 27, 2015 @12:01PM (#9447133)
How will you then bootstrap it on new platforms? Will it become reliant on cross compilation for bootstrap?
Re:How does D improve on C++17? by Zardoz84 on Monday April 27, 2015 @02:50AM (#9444705)
Where is ?
Re:How does D improve on C++17? by Shorel on Monday April 27, 2015 @01:57PM (#9447986)
It's being replaced this year by a D version.
Re:How does D improve on C++17? by RyJones on Sunday April 26, 2015 @08:40PM (#9443869)
He's a little more involved in D than using it in his compiler :)
Re:How does D improve on C++17? by amyjess on Monday April 27, 2015 @09:58AM (#9446287)
What I'd particularly like to see is an analysis of D vs. Rust. Both have been touted as systems programming languages to replace C/C++, and I'd be curious to see a breakdown of their strengths and weaknesses compared to each other.
Re:How does D improve on C++17? by WalterBright on Monday April 27, 2015 @04:28PM (#9448884)
It would take an expert in both languages to do it. My knowledge of Rust is fairly limited. In particular, every language has its own idiomatic way of doing things (the D Way, the Rust Way), and to compare one has to be cognizant of those idioms.
Re:How does D improve on C++17? by Zardoz84 on Monday April 27, 2015 @02:55AM (#9444722)
I did some hobby stuff with it. But I'm afraid that I didn't use it for real stuff. A few weeks ago I try to use it to write a tool to update our Java webservices from the latest Maven deploy (I'm afraid that I work as Java programmer :( ). Sadly I got issues with linking against std.net.curl , and I end writing a bash script for that.

I really enjoy a lot more writing on D, but I keep finding the issue that I need to interface with C++ libs for something (for example Qt 5 for an emulator GUI) or weird errors like these problem with std.net.curl on Ubuntu 14.04 . If not was for that, I would wrote the Trillek virtual computer on D.

Re:How does D improve on C++17? by giancarlostoro on Monday April 27, 2015 @04:53AM (#9445064)
Did you consider their wiki page on GUI Libraries?

http://wiki.dlang.org/GUI_Libraries

Just thought I'd share, maybe you overlooked it and this might be helpful for future projects? Good luck!

Re:How does D improve on C++17? by Zardoz84 on Monday April 27, 2015 @05:29AM (#9445172)
I know and try GtkD (https://github.com/Zardoz89/DEDCPU-16). It's fancy, but at the end you would find that you are always trying to do a mental map between the Gtk documentation and how this is translated to D. Plus is Gtk.

Also, I played a few with Qt 5 on C++... I would like to have updated binding of Qt for D. qtd and dqt looks that are abandoned. :S

DQuick looks interesting, perhaps I would rewrite my fontmap editor with it.

PD: If I look that I hate a bit Gtk, I would only say that with buggy graphics drivers (ie ATI/AMD cards on Linux), Gtk usually have horrible graphical glitches, when Qt simply works fine.