Re: How do you use D?

2017-08-02 Thread Nicholas Wilson via Digitalmars-d

On Thursday, 3 August 2017 at 03:46:38 UTC, Zwargh wrote:

On Monday, 31 July 2017 at 12:32:52 UTC, Nicholas Wilson wrote:

On Sunday, 30 July 2017 at 01:53:15 UTC, Zwargh wrote:
I am using D to develop a system for rational drug design. 
The main application for D is for protein 3D structure 
prediction and statistical analysis using Differential 
Geometry and Knot Theory.


Cool! Are you considered using dcompute for this once it has 
matured a bit?


It is a possibility and MIR as well. In my experience, D could 
be the perfect replacement for C++ and Java for bioinformatics.


I hope it does, i'll be using it for all my bioinformatics stuff.


Re: How do you use D?

2017-08-02 Thread Zwargh via Digitalmars-d

On Monday, 31 July 2017 at 12:32:52 UTC, Nicholas Wilson wrote:

On Sunday, 30 July 2017 at 01:53:15 UTC, Zwargh wrote:
I am using D to develop a system for rational drug design. The 
main application for D is for protein 3D structure prediction 
and statistical analysis using Differential Geometry and Knot 
Theory.


Cool! Are you considered using dcompute for this once it has 
matured a bit?


It is a possibility and MIR as well. In my experience, D could be 
the perfect replacement for C++ and Java for bioinformatics.





Re: [your code here] HexViewer

2017-08-02 Thread Andre Pany via Digitalmars-d
On Wednesday, 2 August 2017 at 22:02:49 UTC, Vladimir Panteleev 
wrote:
On Wednesday, 2 August 2017 at 21:59:23 UTC, Vladimir Panteleev 
wrote:

Good idea! But I think it needs more ranges:


The format call can be substituted with writefln directly:

void main(string[] args)
{
import std.algorithm, std.format, std.stdio;
enum cols = 16;
args[1].File("rb").byChunk(16).each!(chunk =>
writefln!"%(%02X %)%*s  %s"(
chunk,
3 * (cols - chunk.length), "",
chunk.map!(c =>
c < 0x20 || c > 0x7E ? '.' : char(c;
}


Really cool:)

Kind regards
André


Re: Who maintains the D website?

2017-08-02 Thread Moritz Maxeiner via Digitalmars-d

On Thursday, 3 August 2017 at 00:48:41 UTC, Andrej Mitrovic wrote:
On Thursday, 3 August 2017 at 00:26:31 UTC, Moritz Maxeiner 
wrote:
On Thursday, 3 August 2017 at 00:18:38 UTC, Andrej Mitrovic 
wrote:
Is there a single person who's the main maintainer of the D 
website..?



If not, I have some ideas on how to improve it. Not just 
ideas, I'd like to give a host at improving it myself, really.


AFAIK the website is maintained via git here [1].
If you want to improve something, you can create a PR / open 
an issue there.


[1] https://github.com/dlang/dlang.org


Oh, I get that much. But I was wondering if there was a 
webmaster who approve disapproved changes to the site.




I don't think so, technically anyone with write access can toggle 
auto merge (IIRC), but if the changes are non-trivial there's 
likely going to be a discussion on the PR first


Re: Who maintains the D website?

2017-08-02 Thread Andrej Mitrovic via Digitalmars-d

On Thursday, 3 August 2017 at 00:48:41 UTC, Andrej Mitrovic wrote:
On Thursday, 3 August 2017 at 00:26:31 UTC, Moritz Maxeiner 
wrote:
On Thursday, 3 August 2017 at 00:18:38 UTC, Andrej Mitrovic 
wrote:
Is there a single person who's the main maintainer of the D 
website..?



If not, I have some ideas on how to improve it. Not just 
ideas, I'd like to give a host at improving it myself, really.


AFAIK the website is maintained via git here [1].
If you want to improve something, you can create a PR / open 
an issue there.


[1] https://github.com/dlang/dlang.org


Oh, I get that much. But I was wondering if there was a 
webmaster who approve disapproved changes to the site.


Sorry, bad typos here. I meant a webmaster who approved /or/ 
disapproved changes to the website.


Re: Who maintains the D website?

2017-08-02 Thread Andrej Mitrovic via Digitalmars-d

On Thursday, 3 August 2017 at 00:26:31 UTC, Moritz Maxeiner wrote:
On Thursday, 3 August 2017 at 00:18:38 UTC, Andrej Mitrovic 
wrote:
Is there a single person who's the main maintainer of the D 
website..?



If not, I have some ideas on how to improve it. Not just 
ideas, I'd like to give a host at improving it myself, really.


AFAIK the website is maintained via git here [1].
If you want to improve something, you can create a PR / open an 
issue there.


[1] https://github.com/dlang/dlang.org


Oh, I get that much. But I was wondering if there was a webmaster 
who approve disapproved changes to the site.



Anyway, I'll come up with something new soon and share it with 
W&A, I really think the website could use a better presentation.


Re: Who maintains the D website?

2017-08-02 Thread Moritz Maxeiner via Digitalmars-d

On Thursday, 3 August 2017 at 00:18:38 UTC, Andrej Mitrovic wrote:
Is there a single person who's the main maintainer of the D 
website..?



If not, I have some ideas on how to improve it. Not just ideas, 
I'd like to give a host at improving it myself, really.


AFAIK the website is maintained via git here [1].
If you want to improve something, you can create a PR / open an 
issue there.


[1] https://github.com/dlang/dlang.org


Re: Who maintains the D website?

2017-08-02 Thread Andrej Mitrovic via Digitalmars-d

On Thursday, 3 August 2017 at 00:18:38 UTC, Andrej Mitrovic wrote:
Is there a single person who's the main maintainer of the D 
website..?



If not, I have some ideas on how to improve it. Not just ideas, 
I'd like to give a host at improving it myself, really.


Sorry that was a weird typo. I meant, I'd like to give a try at 
improving it myself.


Who maintains the D website?

2017-08-02 Thread Andrej Mitrovic via Digitalmars-d
Is there a single person who's the main maintainer of the D 
website..?



If not, I have some ideas on how to improve it. Not just ideas, 
I'd like to give a host at improving it myself, really.


Re: How do you use D?

2017-08-02 Thread Moritz Maxeiner via Digitalmars-d

On Wednesday, 2 August 2017 at 21:30:11 UTC, SCev wrote:
guys don't do your own IDE, i see everyone working on his own 
IDE, please just make plugin for famous crossplatform IDE.. 
this will be better for comunity


But I'm NIH interested in having my own plugin for Sublime which 
does exactly what I want how I want it.




VSCode/Atom


Used both of these for a considerable time, got sick of them 
(graphic glitches, slow&laggy, heavily interferes with power 
saving on battery power, etc.).



Xamarin Studio/IntelliJ


I'm frankly not interested in having either mono or a JVM on my 
machine.




my team don't want use D cause IDEs are all shit


I can understand that, but I'd have to say that D is then 
(currently) not for your team.


Re: [your code here] HexViewer

2017-08-02 Thread Vladimir Panteleev via Digitalmars-d
On Wednesday, 2 August 2017 at 22:02:49 UTC, Vladimir Panteleev 
wrote:
On Wednesday, 2 August 2017 at 21:59:23 UTC, Vladimir Panteleev 
wrote:

Good idea!


https://github.com/dlang/dlang.org/pull/1854


Re: [your code here] HexViewer

2017-08-02 Thread Vladimir Panteleev via Digitalmars-d

On Wednesday, 2 August 2017 at 21:58:18 UTC, H. S. Teoh wrote:
Whoa. This is cool and everything, but it also looks pretty 
intimidating for a newcomer to D.  I'm not sure if we should 
put this on the front page!


Perhaps we should make some examples only available if the user 
selects them explicitly from the dropdown, i.e. never show them 
initially, and only use simpler examples for the 
initially-visible random example.




Re: [your code here] HexViewer

2017-08-02 Thread H. S. Teoh via Digitalmars-d
On Wed, Aug 02, 2017 at 09:59:23PM +, Vladimir Panteleev via Digitalmars-d 
wrote:
> On Wednesday, 2 August 2017 at 19:39:18 UTC, Andre Pany wrote:
> > This application opens the file passed as argument and display the
> > content in hex and text format:
> 
> Good idea! But I think it needs more ranges:
> 
> void main(string[] args)
> {
> import std.algorithm, std.format, std.stdio;
> enum cols = 16;
> args[1].File("rb").byChunk(16).map!(chunk =>
> format!"%(%02X %)%*s  %s"(
> chunk,
> 3 * (cols - chunk.length), "",
> chunk.map!(c =>
> c < 0x20 || c > 0x7E ? '.' : char(c
> .each!writeln;
> }

Whoa. This is cool and everything, but it also looks pretty intimidating
for a newcomer to D.  I'm not sure if we should put this on the front
page!


T

-- 
Democracy: The triumph of popularity over principle. -- C.Bond


Re: [your code here] HexViewer

2017-08-02 Thread Vladimir Panteleev via Digitalmars-d
On Wednesday, 2 August 2017 at 21:59:23 UTC, Vladimir Panteleev 
wrote:

Good idea! But I think it needs more ranges:


The format call can be substituted with writefln directly:

void main(string[] args)
{
import std.algorithm, std.format, std.stdio;
enum cols = 16;
args[1].File("rb").byChunk(16).each!(chunk =>
writefln!"%(%02X %)%*s  %s"(
chunk,
3 * (cols - chunk.length), "",
chunk.map!(c =>
c < 0x20 || c > 0x7E ? '.' : char(c;
}



Re: [your code here] HexViewer

2017-08-02 Thread Vladimir Panteleev via Digitalmars-d

On Wednesday, 2 August 2017 at 19:39:18 UTC, Andre Pany wrote:
This application opens the file passed as argument and display 
the content in hex and text format:


Good idea! But I think it needs more ranges:

void main(string[] args)
{
import std.algorithm, std.format, std.stdio;
enum cols = 16;
args[1].File("rb").byChunk(16).map!(chunk =>
format!"%(%02X %)%*s  %s"(
chunk,
3 * (cols - chunk.length), "",
chunk.map!(c =>
c < 0x20 || c > 0x7E ? '.' : char(c
.each!writeln;
}



Re: [your code here] HexViewer

2017-08-02 Thread Steven Schveighoffer via Digitalmars-d

On 8/2/17 3:39 PM, Andre Pany wrote:
This application opens the file passed as argument and display the 
content in hex and text format:


00 00 03 00 00 00 64 00 00 00 FF 56 01 00 00 70 ......d... V..p
02 00 FF A6 00 00 00 20 02 00 00 00 00 00 00 00. ª... ...
00 00 00 00 00 00 00 00 00 00 00 00

void main(string[] args)
{
 import std.file, std.string, std.range, std.array, std.algorithm, 
std.digest, std.conv;

 import std.stdio: writeln;

 enum cols = 16;
 auto data = cast(const(ubyte)[]) read(args[1]);

 foreach(g; data.chunks(cols))
 {
 string hex = g.toHexString.chunks(2).join(" ").to!string;
 string txt = g.map!(b => b == 0 ? '.' : char(b)).array;
 writeln(hex.leftJustify(cols * 2 + (cols - 1), ' '), "", txt);
 }
}


Very nice!

I think actually you are going to have a bit of trouble with the 'text' 
output, since D is going to output the character array as unicode, vs. a 
normal hexdump which will output as one glyph per byte. You could do 
this poorly by changing the map condition to b == 0 || b >= 0x80.


Actually you may want to substitute some extra chars, as I'm not sure 
low bytes are printable (or will print what you really want them to).


-Steve


Re: [your code here] HexViewer

2017-08-02 Thread Steven Schveighoffer via Digitalmars-d

On 8/2/17 5:27 PM, Nick B wrote:

On Wednesday, 2 August 2017 at 19:39:18 UTC, Andre Pany wrote:
This application opens the file passed as argument and display the 
content in hex and text format:




Is this code in GitHub or DUB ?
Is there a link ?


Here is a link:

https://forum.dlang.org/post/dvjltobyaaxoihhqy...@forum.dlang.org

:)

-Steve


Re: [your code here] HexViewer

2017-08-02 Thread H. S. Teoh via Digitalmars-d
On Wed, Aug 02, 2017 at 09:27:07PM +, Nick B via Digitalmars-d wrote:
> On Wednesday, 2 August 2017 at 19:39:18 UTC, Andre Pany wrote:
> > This application opens the file passed as argument and display the
> > content in hex and text format:
> > 
> 
> Is this code in GitHub or DUB ?
> Is there a link ?
[...]

The code is right there in the message.


T

-- 
Sometimes the best solution to morale problems is just to fire all of the 
unhappy people. -- despair.com


Re: How do you use D?

2017-08-02 Thread SCev via Digitalmars-d
guys don't do your own IDE, i see everyone working on his own 
IDE, please just make plugin for famous crossplatform IDE.. this 
will be better for comunity


VSCode/Atom/Xamarin Studio/IntelliJ

my team don't want use D cause IDEs are all shit


Re: [your code here] HexViewer

2017-08-02 Thread Nick B via Digitalmars-d

On Wednesday, 2 August 2017 at 19:39:18 UTC, Andre Pany wrote:
This application opens the file passed as argument and display 
the content in hex and text format:




Is this code in GitHub or DUB ?
Is there a link ?

Nick


Re: [OT] Generative C++

2017-08-02 Thread 12345swordy via Digitalmars-d

On Wednesday, 2 August 2017 at 14:08:21 UTC, jmh530 wrote:

On Wednesday, 2 August 2017 at 13:50:49 UTC, 12345swordy wrote:


Is it to much to ask for d developers to provide a way to 
enforce custom coding standards in a similar fashion that 
@nogc and @safe does?


Alex


Like the ability to run dscanner at compile-time?
https://github.com/dlang-community/D-Scanner


...No? I was referring to the c++ proposal paper.


[your code here] HexViewer

2017-08-02 Thread Andre Pany via Digitalmars-d
This application opens the file passed as argument and display 
the content in hex and text format:


00 00 03 00 00 00 64 00 00 00 FF 56 01 00 00 70
.....d... V..p
02 00 FF A6 00 00 00 20 02 00 00 00 00 00 00 00. ª... 
...

00 00 00 00 00 00 00 00 00 00 00 00

void main(string[] args)
{
	import std.file, std.string, std.range, std.array, 
std.algorithm, std.digest, std.conv;

import std.stdio: writeln;

enum cols = 16; 
auto data = cast(const(ubyte)[]) read(args[1]);

foreach(g; data.chunks(cols))
{
string hex = g.toHexString.chunks(2).join(" ").to!string;
string txt = g.map!(b => b == 0 ? '.' : char(b)).array;
		writeln(hex.leftJustify(cols * 2 + (cols - 1), ' '), "", 
txt);

}
}


Re: [OT] Bitcoin's Split Is Good for Progress

2017-08-02 Thread Ali Çehreli via Digitalmars-d

On 08/02/2017 09:21 AM, jmh530 wrote:

I was surprised to see a familiar name here:
https://www.bloomberg.com/view/articles/2017-08-02/bitcoin-s-split-is-good-for-progress



"They -- led by former Facebook developer Amaury Sechet -- moved ahead 
with new software that would increase the maximum block size to 8 MB."


Ali



Re: [OT] Alternative to Thunderbird (was: Re: NG technical issues: Is it just me?)

2017-08-02 Thread Schrom, Brian T via Digitalmars-d
On Tue, Aug 01, 2017 at 04:58:43PM -0700, H. S. Teoh via Digitalmars-d wrote:
> On Tue, Aug 01, 2017 at 03:50:02PM -0700, Ali Çehreli via Digitalmars-d wrote:
> [...]
> > Perhaps I should get used to reading news and email with Emacs
> > already. :/
> [...]
> 
> I've been using Mutt for years, and quite happy with it.
+1  for Mutt.  davmail (for  exchange)+offlineimap make  for a  terrific
combination (though  it takes  a day to  work through  configuration and
setup)


Re: all OS functions should be "nothrow @trusted @nogc"

2017-08-02 Thread Moritz Maxeiner via Digitalmars-d
On Wednesday, 2 August 2017 at 16:32:44 UTC, Andrei Alexandrescu 
wrote:

import std.algorithm;
// I probably wouldn't even define this but use the body as is
auto strnlen_safe(in char[] str)
{
 return countUntil(cast(ubyte[]) str, '\0');
}


Oh that cast it irks me so.

-Steve


return str.representation.countUntil('\0');



Thanks, wasn't aware of this; it makes auto decoding slightly 
more bearable.


Re: all OS functions should be "nothrow @trusted @nogc"

2017-08-02 Thread Andrei Alexandrescu via Digitalmars-d

import std.algorithm;
// I probably wouldn't even define this but use the body as is
auto strnlen_safe(in char[] str)
{
 return countUntil(cast(ubyte[]) str, '\0');
}


Oh that cast it irks me so.

-Steve


return str.representation.countUntil('\0');

Andrei


[OT] Bitcoin's Split Is Good for Progress

2017-08-02 Thread jmh530 via Digitalmars-d

I was surprised to see a familiar name here:
https://www.bloomberg.com/view/articles/2017-08-02/bitcoin-s-split-is-good-for-progress



Re: How do you use D?

2017-08-02 Thread MGW via Digitalmars-d

On Friday, 28 July 2017 at 14:58:01 UTC, Ali wrote:
While the Orgs using D page is very nice ... I hoping to hear 
more personal stories ...


I use D2 since 2014. I had wide experience of C programming 
earlier. Now I use only DMD in all projects, except special. At 
the initial stage there were difficulties with a choice of good 
GUI and I decided to make the binding for Qt-5. QtE5 turned out 
and I use it for creation of cross-platform applications. I mix 
pfobos and API Qt-5 in the applications.


https://github.com/MGWL/QtE5
https://www.youtube.com/channel/UCNlwbCCcpYVAI0EL2VFOutQ

Short list of development:
- Learnability monitoring (reception of examinations) - dmd + qte5

- Scanner of file system, indexing and search.

- the forth language interpreter - dmd + asm_dmd

- IDE5 - mini ide (example QtE5) - dmd + QtE5

- External DLL for extension functionality of VBA for MSOffice - 
dmd


- Smart Scripts for start of external applications

I use notepad++ and only dmd (win/linux/OSX for 32/64) or ide5 
for small app.


dmd is an excellent programming language )))


Re: [OT] Generative C++

2017-08-02 Thread jmh530 via Digitalmars-d

On Wednesday, 2 August 2017 at 13:50:49 UTC, 12345swordy wrote:


Is it to much to ask for d developers to provide a way to 
enforce custom coding standards in a similar fashion that @nogc 
and @safe does?


Alex


Like the ability to run dscanner at compile-time?
https://github.com/dlang-community/D-Scanner


Re: [OT] Generative C++

2017-08-02 Thread 12345swordy via Digitalmars-d

On Wednesday, 2 August 2017 at 09:50:41 UTC, Walter Bright wrote:

On 8/2/2017 2:24 AM, Russel Winder via Digitalmars-d wrote:
And there was me being a great fan of AST macros in those 
languages that have

them.


There are many who share your views here :-)


Well d have a goto statement despite having a famous argument 
against goto statments, so it not like d always follows the rules.


Regardless, what impress me the most is the part where it came be 
used to enforce coding standards at compile time. Which I am 
trying to look if it's possible with d and sadly no luck.


Is it to much to ask for d developers to provide a way to enforce 
custom coding standards in a similar fashion that @nogc and @safe 
does?


Alex


Re: How do you use D?

2017-08-02 Thread Meta via Digitalmars-d

On Friday, 28 July 2017 at 14:58:01 UTC, Ali wrote:
While the Orgs using D page is very nice ... I hoping to hear 
more personal stories ...


So

How do you use D?


I've been using D for most of my personal projects since 2011.


In work, (key projects or smaller side projects)


Unfortunately it's pretty much impossible to introduce a new 
language in my position at work, but I use D regularly for small 
text processing tools. I need to rip apart and/or reformat text 
files regularly; I used to use Perl but I find D to be as good or 
better for this job than Perl, and faster as well.



in your side project, (github, links please)


Recently I've been working on a Discord bot and a small game (not 
on github), both using D libraries of course.


just to learn something new? (I would easily argue that 
learning D will make you a better C++ programmer, maybe not the 
most efficient way, but I a sure it i very effective)


I've learned about everything from programming language design to 
type theory to algorithm design to low-level programming just 
from participating in the D community over the past 6 years. 
There's no question that learning D has made me a better 
programmer and introduced me to concepts that I would not have 
been aware of otherwise.


Did you introduce D to your work place? How? What challenges 
did you face?


I would love to introduce D to my work place but it's not really 
possible.



What is you D setup at work, which compiler, which IDE?


Plain old Sublime Text with DCD/dscanner/dfmt. I used to heavily 
use Visual Studio with the visual-d plugin but I wanted something 
more light weight.


Re: [OT] Generative C++

2017-08-02 Thread Walter Bright via Digitalmars-d

On 8/2/2017 2:24 AM, Russel Winder via Digitalmars-d wrote:

And there was me being a great fan of AST macros in those languages that have
them.


There are many who share your views here :-)


Re: How do you use D?

2017-08-02 Thread Daniel Kozak via Digitalmars-d
s/ok we have to because of failover/ok we have two because of failover/

On Wed, Aug 2, 2017 at 11:29 AM, Daniel Kozak  wrote:

> On Fri, Jul 28, 2017 at 4:58 PM, Ali via Digitalmars-d <
> digitalmars-d@puremagic.com> wrote:
>
>> While the Orgs using D page is very nice ... I hoping to hear more
>> personal stories ...
>>
>> So
>>
>> How do you use D?
>>
>
> Mainly at work, for lot of things.
>
> autoloader - tool for parsing all php files at our main project and
> generate file for autoloading php files
> esatd - deamon for controling and communicating with our servers
> (reading logs, do releases of our products, controlling of availability...)
> cronchecker - tool for managing and watchdoging our crons
> dbsync - db tool for syncing and moving our databases around different
> servers
> testdbsync - dbtool sync our production databases to our test databases
> phpdispatcher - deamon for managing php workers processes
> camera-media-server - reverse engineering server for communicating
> with some chinese DVR units
> esat-map-engine - tool for (reverse) geocoding, and generating map
> tiles
> mapfactorbridge - REST API over MapFactor OCX(windows only, we used it
> under wine), so it is possible to use it on many machines through network
> and on any platform
> MapfactorWrapper - demon for calculating shortest path from one
> city(or any place) to another using mapfactor ocx api (mapfactorbridge)
>
>
>
>>
>> Did you introduce D to your work place? How? What challenges did you face?
>>
>
> Yes in 2012, only problem was with the ecosystem. There has been no good
> IDE and too few libraries, but because of posibility to use C libraries it
> was not a problem.
> But good IDE is still a problem for some of us.
>
>
>>
>> What is you D setup at work, which compiler, which IDE?
>>
>
> DMD for development, LDC or GDC for release binaries, VSCode with webfreak
> dlang plugin (2017-now), monodevelop (2013-2016)
>
>
>>
>> And any other fun facts you may want to share :)
>>
>
> In 2012 at work we have been looking for a way how to improve performance
> of our data processing machines. These machines process lots of files
> (binary,xml,text...).
> These files comes from GPS units and has been (still are) process by PHP
> scripts (called parsers).
>
> So we decided to rewrite those PHP scripts to something faster (PHP has
> been quite slow theses days, now with PHP7 and HHVM it is little better).
> So I was responsible for finding another language (the right one) in which
> we wil rewrite those scripts. OK easy task, so I selected few languages I
> know to select from.
> Java, C/C++, Go, Python. But quite fast I realized none of these languages
> fulfil our requirements.
> Our requirements was:
> OOP (Go is out)
> GC (C++ is out, ok there is a way to use gc in c++, but i have never done
> that before)
> Fast startup (Java is out because of VM)
> Syntax similar to PHP as much as posible (python is out)
> Fast compilation (C++ is out again)
>
> Our best choice has been Java, but it would mean change architecture
> (instead of executing own process for every file, we will need to process
> them in one process with multiple threads or something similar), which has
> been no go these days.
>
> So I have been looking for some another language. And for some reason I
> have remembered that there has been some language, which I have try at my
> high school days (2004-2008).  Unfortunately I did not remembred the name.
> So I start typing into google things I have remembred about this language.
> And after some time I have found  it (D language). So I looked at D closer
> and was very satisfied. My first  thoughts was something like "This is it".
>
> So I introduce D to my coworkers. At first there has been two camps. One
> camp has the same feeling about D as me, the other ones was OK with D as a
> language, but has been afraid of ecosystem. So I have started to showing
> them how easily I can use C ecosystem so they do not have to be worried. So
> after some time D has been chosen and we started to rewrite our parsers
> into D.
>
> First results (just data processing) has been promising (new parsers has
> been 10 to 100 times faster than the old(PHP) ones with smaller system
> requirments), but after integrating other parts (database, filesystem...)
> we have realized there is an almost no gain in the end. Data processing was
> only small part of parsers, so database and filesystem interaction has been
> the problem. So we start to improve this part of parsers. In the end we was
> 5 times faster than the old parsers, but we could just do all these changes
> to old parsers too. So we end up with rewriting our D parsers back to PHP,
> because D parsers has been to far from being complete.
>
> But it was not complete failure. Because of this we have improved our
> parsers and D has established in our ecosystem. After few years parsers
> performance became problem again (even with PHP 7). So we

Re: How do you use D?

2017-08-02 Thread Kagamin via Digitalmars-d

On Saturday, 29 July 2017 at 21:07:24 UTC, H. S. Teoh wrote:
Unfortunately, they are not receptive to new languages right 
now.  C is king here, sad to say, and even C++ is only barely 
tolerated (they basically outlawed C++ exceptions in the name 
of optimization, and use their own C-based hack instead, among 
other such restrictions). The mere mention of the word "GC" 
will make the answer an automatic "no".


I use D without exceptions and GC too, previously I used C for 
this, but of course any D is miles ahead of it.


Re: How do you use D?

2017-08-02 Thread Daniel Kozak via Digitalmars-d
On Fri, Jul 28, 2017 at 4:58 PM, Ali via Digitalmars-d <
digitalmars-d@puremagic.com> wrote:

> While the Orgs using D page is very nice ... I hoping to hear more
> personal stories ...
>
> So
>
> How do you use D?
>

Mainly at work, for lot of things.

autoloader - tool for parsing all php files at our main project and
generate file for autoloading php files
esatd - deamon for controling and communicating with our servers
(reading logs, do releases of our products, controlling of availability...)
cronchecker - tool for managing and watchdoging our crons
dbsync - db tool for syncing and moving our databases around different
servers
testdbsync - dbtool sync our production databases to our test databases
phpdispatcher - deamon for managing php workers processes
camera-media-server - reverse engineering server for communicating with
some chinese DVR units
esat-map-engine - tool for (reverse) geocoding, and generating map tiles
mapfactorbridge - REST API over MapFactor OCX(windows only, we used it
under wine), so it is possible to use it on many machines through network
and on any platform
MapfactorWrapper - demon for calculating shortest path from one city(or
any place) to another using mapfactor ocx api (mapfactorbridge)



>
> Did you introduce D to your work place? How? What challenges did you face?
>

Yes in 2012, only problem was with the ecosystem. There has been no good
IDE and too few libraries, but because of posibility to use C libraries it
was not a problem.
But good IDE is still a problem for some of us.


>
> What is you D setup at work, which compiler, which IDE?
>

DMD for development, LDC or GDC for release binaries, VSCode with webfreak
dlang plugin (2017-now), monodevelop (2013-2016)


>
> And any other fun facts you may want to share :)
>

In 2012 at work we have been looking for a way how to improve performance
of our data processing machines. These machines process lots of files
(binary,xml,text...).
These files comes from GPS units and has been (still are) process by PHP
scripts (called parsers).

So we decided to rewrite those PHP scripts to something faster (PHP has
been quite slow theses days, now with PHP7 and HHVM it is little better).
So I was responsible for finding another language (the right one) in which
we wil rewrite those scripts. OK easy task, so I selected few languages I
know to select from.
Java, C/C++, Go, Python. But quite fast I realized none of these languages
fulfil our requirements.
Our requirements was:
OOP (Go is out)
GC (C++ is out, ok there is a way to use gc in c++, but i have never done
that before)
Fast startup (Java is out because of VM)
Syntax similar to PHP as much as posible (python is out)
Fast compilation (C++ is out again)

Our best choice has been Java, but it would mean change architecture
(instead of executing own process for every file, we will need to process
them in one process with multiple threads or something similar), which has
been no go these days.

So I have been looking for some another language. And for some reason I
have remembered that there has been some language, which I have try at my
high school days (2004-2008).  Unfortunately I did not remembred the name.
So I start typing into google things I have remembred about this language.
And after some time I have found  it (D language). So I looked at D closer
and was very satisfied. My first  thoughts was something like "This is it".

So I introduce D to my coworkers. At first there has been two camps. One
camp has the same feeling about D as me, the other ones was OK with D as a
language, but has been afraid of ecosystem. So I have started to showing
them how easily I can use C ecosystem so they do not have to be worried. So
after some time D has been chosen and we started to rewrite our parsers
into D.

First results (just data processing) has been promising (new parsers has
been 10 to 100 times faster than the old(PHP) ones with smaller system
requirments), but after integrating other parts (database, filesystem...)
we have realized there is an almost no gain in the end. Data processing was
only small part of parsers, so database and filesystem interaction has been
the problem. So we start to improve this part of parsers. In the end we was
5 times faster than the old parsers, but we could just do all these changes
to old parsers too. So we end up with rewriting our D parsers back to PHP,
because D parsers has been to far from being complete.

But it was not complete failure. Because of this we have improved our
parsers and D has established in our ecosystem. After few years parsers
performance became problem again (even with PHP 7). So we need to improve
them again. We have already known that rewriting it to something faster
would not help. So I have try another approach.

The result of that approach is phpdispatcher. So instead of starting new
process for every file request there is a D deamon (phpdispatcher) which
put file request into queue

Re: [OT] Generative C++

2017-08-02 Thread Russel Winder via Digitalmars-d
On Tue, 2017-08-01 at 15:06 -0700, Walter Bright via Digitalmars-d wrote:
> 
[…]
> I can't say I understand the proposal, but if it is similar to AST macros,
> my 
> argument against that is well known and similar to yours

And there was me being a great fan of AST macros in those languages that have
them.

> .
-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

signature.asc
Description: This is a digitally signed message part


Re: Problem of undefined behaviour with overloaded methods and overloaded delegate's invokers

2017-08-02 Thread knex via Digitalmars-d

On Tuesday, 1 August 2017 at 11:30:07 UTC, John Colvin wrote:

looks like a bug to me. Please report at issues.dlang.org


Let it be, then. Reported at 
https://issues.dlang.org/show_bug.cgi?id=17710


Re: [OT] Generative C++

2017-08-02 Thread Kagamin via Digitalmars-d

On Tuesday, 1 August 2017 at 22:11:47 UTC, Stefan Koch wrote:

It's basically a restricted form of AST-Macros.
Not as aweful as it could have been but still quite complex and 
I have no idea how one would implement that efficiently.


They look as efficient as templates. Both duplicate the AST tree, 
don't they?


Re: [OT] Alternative to Thunderbird (was: Re: NG technical issues: Is it just me?)

2017-08-02 Thread Kagamin via Digitalmars-d

Sylpheed?