Re: CTFE Status

2016-12-08 Thread Stefan Koch via Digitalmars-d
On Friday, 9 December 2016 at 02:10:58 UTC, Andrei Alexandrescu 
wrote:

On 12/08/2016 04:24 PM, Stefan Koch wrote:

Results are obtained running the following code
uint MakeInitAndSumArray(uint length)
{
uint result;
uint[] arr;
arr.length = length;

while(length--)
{
arr[length] = length;
}
foreach(e;arr)
{
  result += e;
}

return result;
}

pragma(msg, MakeInitAndSumArray(ushort.max));
pragma(msg, MakeInitAndSumArray(ushort.max/2));
pragma(msg, MakeInitAndSumArray(ushort.max*2));


That's pretty awesome. The new CTFE engine release will soon 
rival Tesla Model 3 in terms of interest raised :o).


In addition to artificial corpora like the above, I suggest 
comparing against real-world code - starting with simpler 
things such as bitfields instantiations.



Andrei


That will not work currently.
Since function and methods calls are still "in the works".
They will require another restructuring as well.
Therefore artificial tests are the best I can do to gunge 
performance.




Re: CTFE Status

2016-12-08 Thread Andrei Alexandrescu via Digitalmars-d

On 12/08/2016 04:24 PM, Stefan Koch wrote:

Results are obtained running the following code
uint MakeInitAndSumArray(uint length)
{
uint result;
uint[] arr;
arr.length = length;

while(length--)
{
arr[length] = length;
}
foreach(e;arr)
{
  result += e;
}

return result;
}

pragma(msg, MakeInitAndSumArray(ushort.max));
pragma(msg, MakeInitAndSumArray(ushort.max/2));
pragma(msg, MakeInitAndSumArray(ushort.max*2));


That's pretty awesome. The new CTFE engine release will soon rival Tesla 
Model 3 in terms of interest raised :o).


In addition to artificial corpora like the above, I suggest comparing 
against real-world code - starting with simpler things such as bitfields 
instantiations.



Andrei


Re: CTFE Status

2016-12-08 Thread Stefan Koch via Digitalmars-d

On Thursday, 8 December 2016 at 19:49:47 UTC, Faux Amis wrote:

Any reason for the infinite depth update posting style?
I would have loved to see each update to be a child of the root 
post with its own discussions tree.
Currently, the posts are quite unreadable in tree view 
(thunderbird).



On 2016-10-31 14:29, Stefan Koch wrote:
Hi Guys, since I got a few complaints about giving minor 
status updates

in the announce group, I am opening this thread.


The reason it that I don't use the tree view.
I just answer to myself every time I have an update.
It looks fine on the web-frontend.


Re: CTFE Status

2016-12-08 Thread Stefan Koch via Digitalmars-d
I just wanted to post another performance comparision that does 
not test dmd's memory allocator more then anything else :)


[root@localhost dmd]# time src/dmd -c testSettingArrayLength.d  
-bc-ctfe

2147385345u
536821761u
4294639619u

real0m0.114s
user0m0.110s
sys 0m0.003s
[root@localhost dmd]# time src/dmd -c testSettingArrayLength.d
2147385345u
536821761u
4294639619u

real0m0.921s
user0m0.843s
sys 0m0.077s

Results are obtained running the following code
uint MakeInitAndSumArray(uint length)
{
uint result;
uint[] arr;
arr.length = length;

while(length--)
{
arr[length] = length;
}
foreach(e;arr)
{
  result += e;
}

return result;
}

pragma(msg, MakeInitAndSumArray(ushort.max));
pragma(msg, MakeInitAndSumArray(ushort.max/2));
pragma(msg, MakeInitAndSumArray(ushort.max*2));



Re: How about a bounty for a new windows installer using inno setup ?

2016-12-08 Thread Jesse Phillips via Digitalmars-d

On Thursday, 8 December 2016 at 11:03:07 UTC, Thomas Mader wrote:
I think you might be right about using WiX. MSI seems to be 
build upon transactional installation.
Do you think it would be possible to use D instead of C++ to 
write custom code?


Short answer is yes, I've created such and actually inject my 
custom DLL for testing purposes.


MSI's are pretty awkward, no one knows how to create the MSI 
database instead there are 3 example databases provided which you 
can merge together if you desire that feature. From there the 
Database consists of tables which layout the installation 
sequence along with the installation sequence for the GUI. These 
sequences can call "Custom Actions" which are just table entries 
that point to a DLL (there is more to Custom Actions).


The signature looks something like below. I've got a little 
wrapper around the MSIHANDLE so as to add some safety and 
convenience.


   extern(Windows):
   export uint MyCustomActionName(const MsiLiveHandle hModule) {

I'm not too familiar with WIX and the exposure I've had is with 
older versions (3.x) which have had annoying and weird bugs. D 
certainly could be used to create the D MSI installer, but that 
is even lower level than WIX.


d***@*******

2016-12-08 Thread 85 Windsor via Digitalmars-d

d***@***



Re: CTFE Status

2016-12-08 Thread Stefan Koch via Digitalmars-d

On Thursday, 8 December 2016 at 19:13:23 UTC, Stefan Koch wrote:

I found the biggest performance bottleneck in newCTFE!

oldCtfe :
[root@localhost dmd]# time src/dmd -c ctfeTest.d testStringEq.d 
testStringLength.d testStruct.d testMultipleArrayLiterals.d


real0m0.026s
user0m0.020s
sys 0m0.003s


Before Fixing :
[root@localhost dmd]# time src/dmd -c ctfeTest.d testStringEq.d 
testStringLength.d testStruct.d testMultipleArrayLiterals.d 
-bc-ctfe


real0m0.025s
user0m0.020s
sys 0m0.003s

After Fixing

[root@localhost dmd]# time src/dmd -c ctfeTest.d testStringEq.d 
testStringLength.d testStruct.d testMultipleArrayLiterals.d  
-bc-ctfe


real0m0.019s
user0m0.017s
sys 0m0.000s


Please note that the ctfe interpretation, with newCTFE, inside 
the frontend takes 10% of the compilation time

Whereas with the old interpreter it takes 50%


Re: CTFE Status

2016-12-08 Thread Faux Amis via Digitalmars-d

Any reason for the infinite depth update posting style?
I would have loved to see each update to be a child of the root post 
with its own discussions tree.

Currently, the posts are quite unreadable in tree view (thunderbird).


On 2016-10-31 14:29, Stefan Koch wrote:

Hi Guys, since I got a few complaints about giving minor status updates
in the announce group, I am opening this thread.







Re: How about a bounty for a new windows installer using inno setup ?

2016-12-08 Thread Jim Hewes via Digitalmars-d

On 12/8/2016 3:03 AM, Thomas Mader wrote:


Do you think it would be possible to use D instead of C++ to write
custom code?


Custom code where? During the process of building the installation 
package or during installation itself. Anyway, in either case I don't 
see why not. You can insert a DLL into an MSI file. Then at some point 
during installation that you specify, the DLL will be extracted and an 
arbitrary function in it called. So any language that can generate a DLL 
will work there.


Re: CTFE Status

2016-12-08 Thread Stefan Koch via Digitalmars-d

I found the biggest performance bottleneck in newCTFE!

oldCtfe :
[root@localhost dmd]# time src/dmd -c ctfeTest.d testStringEq.d 
testStringLength.d testStruct.d testMultipleArrayLiterals.d


real0m0.026s
user0m0.020s
sys 0m0.003s

[root@localhost dmd]# time src/dmd -c ctfeTest.d testStringEq.d 
testStringLength.d testStruct.d testMultipleArrayLiterals.d 
-bc-ctfe


real0m0.025s
user0m0.020s
sys 0m0.003s

After Fixing

[root@localhost dmd]# time src/dmd -c ctfeTest.d testStringEq.d 
testStringLength.d testStruct.d testMultipleArrayLiterals.d  
-bc-ctfe


real0m0.019s
user0m0.017s
sys 0m0.000s




Re: OT: Tiobe Index - December Headline: What is happening to good old language C?

2016-12-08 Thread Anonymouse via Digitalmars-d

On Thursday, 8 December 2016 at 13:19:31 UTC, Meta wrote:

On Thursday, 8 December 2016 at 08:46:07 UTC, Nordlöw wrote:

On Tuesday, 6 December 2016 at 07:40:44 UTC, Nick B wrote:

source: http://www.tiobe.com/tiobe-index/   (Dec 2016)


Glad to see D at 21. I believe this an improvement compared to 
previous year. Does anybody got any hard numbers for this?


Actually I think D has slipped. I believe it used to be at 18, 
but I can't remember when that was.


It's nice to see D in the ballpark of 1%+. That said, I also 
think the whole index should be taken with more than one grain of 
salt. Sources and metrics. Lies, damned lies and statistics.


As their disclaimer says, it's the languages most mentioned and 
with the most search hits that score the highest, not the most 
used. Maybe it was particularly high when dconf coverage 
circulated reddit and HN.


Re: [OT] Interesting blog post on disadvantages of the pure functional paradigm

2016-12-08 Thread Stefan Koch via Digitalmars-d
On Thursday, 8 December 2016 at 13:40:21 UTC, Andrei Alexandrescu 
wrote:

http://flyingfrogblog.blogspot.com/2016/05/disadvantages-of-purely-functional.html
 -- Andrei


Great Find! Thanks for sharing it.

This article expresses in nice words what is wrong with 
mono-paradigm languages.

Performance always has to yield to the Paradigm.


Re: Should we warn if we detect null derefernces or void value uses ?

2016-12-08 Thread Stefan Koch via Digitalmars-d

On Thursday, 8 December 2016 at 08:52:45 UTC, qznc wrote:

On Monday, 5 December 2016 at 04:41:55 UTC, Stefan Koch wrote:
 This requires data-flow analysis (The same kind that tells 
you if you are skipping a statement)
And will slow down compilation a little if we enable such a 
warning.



I would rather see a separate tool for stuff like this. It can 
be much slower and do much more analysis.


Compare: clang-analyzer http://clang-analyzer.llvm.org/


Due to D's stronger focus on correctness,
something like the clang static analyzer has importance in D then 
it has in C++.


Also If we don't stick to unambiguous errors, there will be a LOT 
of false positives.




[OT] Interesting blog post on disadvantages of the pure functional paradigm

2016-12-08 Thread Andrei Alexandrescu via Digitalmars-d
http://flyingfrogblog.blogspot.com/2016/05/disadvantages-of-purely-functional.html 
-- Andrei


dconf.org: Merge conflict marker in the banner?

2016-12-08 Thread Nicholas Wilson via Digitalmars-d

lines 23-28 of index.html

<<< 08a5395ead0589eb18e62d3b420781bfa5b0f3e2
  alt="DConf 2017: May 4–6 · Berlin" height="116" 
border="0" />

===


Fix year from 2016 to 2017




Re: OT: Tiobe Index - December Headline: What is happening to good old language C?

2016-12-08 Thread Meta via Digitalmars-d

On Thursday, 8 December 2016 at 08:46:07 UTC, Nordlöw wrote:

On Tuesday, 6 December 2016 at 07:40:44 UTC, Nick B wrote:

source: http://www.tiobe.com/tiobe-index/   (Dec 2016)


Glad to see D at 21. I believe this an improvement compared to 
previous year. Does anybody got any hard numbers for this?


Actually I think D has slipped. I believe it used to be at 18, 
but I can't remember when that was.


Re: How about a bounty for a new windows installer using inno setup ?

2016-12-08 Thread Thomas Mader via Digitalmars-d

On Wednesday, 7 December 2016 at 23:00:13 UTC, Jim Hewes wrote:

On 12/6/2016 10:31 PM, Thomas Mader wrote:


The update case could be better supported by Inno by default 
though I
don't know how to really do it transactionally/atomic. Once 
everything
is on the drive, how would you be able to switch from the old 
directory

to the new one with one atomic action under Windows?



I liked WiX because it was down to the metal and I don't think 
there's anything you can't do. With other tools (like 
InstallShield) I spent too much time trying to get the tool to 
do something I could have done really easy at the low level if 
I could've just gotten to it. But granted, for simpler install 
situations the scripting tools can work OK and have a smaller 
learning curve.


Jim


I think you might be right about using WiX. MSI seems to be build 
upon transactional installation.
Do you think it would be possible to use D instead of C++ to 
write custom code?


Re: OT: Tiobe Index - December Headline: What is happening to good old language C?

2016-12-08 Thread Claude via Digitalmars-d
It's strange to see "assembly language" as an entry, the target 
is not specified, so I suppose it includes them all, and is more 
a way of programming. It would be interesting to see which target 
(x86, ARM?) are the most used.


Re: How about a bounty for a new windows installer using inno setup ?

2016-12-08 Thread Thomas Mader via Digitalmars-d

On Wednesday, 7 December 2016 at 23:00:13 UTC, Jim Hewes wrote:

On 12/6/2016 10:31 PM, Thomas Mader wrote:


The update case could be better supported by Inno by default 
though I
don't know how to really do it transactionally/atomic. Once 
everything
is on the drive, how would you be able to switch from the old 
directory

to the new one with one atomic action under Windows?



I'm not sure what you mean by switch the directory. If you mean 
that the update uses a different directory for the program than 
the original, then you can probably just use a "major" upgrade. 
Windows Installer has the idea of minor upgrade and major 
upgrade. (So, it's independent of whatever tools your using.) A 
minor upgrade just updates the files that have changed. A major 
upgrade essentially removes the original product totally and 
installs the new one. Some people even use a major upgrade for 
_every_ new version just to avoid problems that might occur 
with a minor upgrade.


The Update is triggered by the application itself. If the install 
fails or is Canceled in the middle the application can not start 
anymore and so the user needs to do something manually.
It would be possible to update everything into a new directory 
and after everything is done just exchange the stuff in the 
already installed directory with the new update directory.

But even this operation isn't atomic even though it's much better.
What might work is to make it work like the Nix package manager.
NixOS (Nix Package manager) provides atomic updates because the 
entire system environment is build by links. Replacing a version 
with another one is just a matter of changing the link to the 
proper directory.


So in Windows you could do it the same. Install versions in 
separate directories. The installation directory is linking to 
the appropriate version directory. On update just install to new 
version directory and after everything is done just update the 
installation directory link to the new update directory.
No matter what happens either the old or the new application 
version should be workable.


Re: Should we warn if we detect null derefernces or void value uses ?

2016-12-08 Thread qznc via Digitalmars-d

On Monday, 5 December 2016 at 04:41:55 UTC, Stefan Koch wrote:
 This requires data-flow analysis (The same kind that tells you 
if you are skipping a statement)
And will slow down compilation a little if we enable such a 
warning.



I would rather see a separate tool for stuff like this. It can be 
much slower and do much more analysis.


Compare: clang-analyzer http://clang-analyzer.llvm.org/



Re: OT: Tiobe Index - December Headline: What is happening to good old language C?

2016-12-08 Thread Nordlöw via Digitalmars-d

On Tuesday, 6 December 2016 at 07:40:44 UTC, Nick B wrote:

source: http://www.tiobe.com/tiobe-index/   (Dec 2016)


Glad to see D at 21. I believe this an improvement compared to 
previous year. Does anybody got any hard numbers for this?


Re: OT: Tiobe Index - December Headline: What is happening to good old language C?

2016-12-08 Thread Nordlöw via Digitalmars-d

On Wednesday, 7 December 2016 at 09:12:39 UTC, piotrklos wrote:

Smaller reason:
C is being replaced in some applications by Go, D and C++.


And most likely also Rust.