[Issue 5995] string append negative integer causes segfault

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5995

erict...@gmail.com changed:

   What|Removed |Added

 CC||erict...@gmail.com

--- Comment #13 from erict...@gmail.com ---
Still present in 2.067

--


[Issue 14425] New: Indirect template instantiation within is expression causes missing linker symbols

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14425

  Issue ID: 14425
   Summary: Indirect template instantiation within is expression
causes missing linker symbols
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: DMD
  Assignee: nob...@puremagic.com
  Reporter: slud...@outerproduct.org

The following causes the linker to complain about missing
Foo!string.__xopEquals and .__xtoHash:

---
struct Foo(I) { I i; }
struct Bar(I) { I i; }
static assert(is(Foo!(Bar!string)));
---

Workaround is to explicitly instantiate the template:

alias Workaround = Foo!(Bar!string);

--


[Issue 14426] New: Segfault for missing extern variable

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14426

  Issue ID: 14426
   Summary: Segfault for missing extern variable
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: blocker
  Priority: P1
 Component: DMD
  Assignee: nob...@puremagic.com
  Reporter: erict...@gmail.com

$ cat test.d
extern (C): int i;
import std.stdio;
void main(){
  write(i);
}
$ dmd -run test
--- killed by signal 11
$ rdmd test
Segmentation fault (core dumped)

--


[Issue 10492] Illegal Instruction for mixin template with scope declarations

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10492

--- Comment #5 from github-bugzi...@puremagic.com ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/ee243b618c48d3e99dc6af861cbc89c5c5f1b461
fix Issue 10492 - Illegal Instruction for mixin template with scope
declarations

--


[Issue 14249] Loose error check for incorrect template mixin

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14249

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 14243] mixin template scope inconsistency?

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14243

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/f54862eb0e4a9af4265042f35972bf6e91d1eaf1
fix Issue 14243 - mixin template scope inconsistency?

https://github.com/D-Programming-Language/dmd/commit/50b19975fdb339c56c3c96f7e5e706b9090eebbe
Merge pull request #4455 from 9rnsr/fix14243

Issue 14243 - mixin template scope inconsistency?

--


[Issue 14401] typeid(shared X).init is empty for class types

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14401

--- Comment #4 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/94f725f3f56df4257647e348184586a1661f60cf
fix root/rmem.d to follow issue 14401 fix in druntime.

https://github.com/D-Programming-Language/dmd/commit/7f8f27c9520c559190d5ac366cd337f9ef5c597b
Merge pull request #4572 from 9rnsr/fix14401

fix root/rmem.d to follow issue 14401 fix in druntime.

--


[Issue 14428] New: Link all book formats available from dlang.org

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14428

  Issue ID: 14428
   Summary: Link all book formats available from dlang.org
   Product: D
   Version: D2
  Hardware: x86
OS: Mac OS X
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: websites
  Assignee: nob...@puremagic.com
  Reporter: and...@erdani.com

See http://forum.dlang.org/thread/dzlbgmkbbqcuoelic...@forum.dlang.org

--


[Issue 14425] Indirect template instantiation within is expression causes missing linker symbols

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14425

Sönke Ludwig slud...@outerproduct.org changed:

   What|Removed |Added

   Hardware|All |x86_64
 OS|All |Linux

--- Comment #1 from Sönke Ludwig slud...@outerproduct.org ---
Happens only for builds without the -debug flag.

--


[Issue 14243] mixin template scope inconsistency?

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14243

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 14249] Loose error check for incorrect template mixin

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14249

--- Comment #3 from github-bugzi...@puremagic.com ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/bdc92c7c244398a361261369c3f59daccaa62664
fix Issue 14249 - Loose error check for incorrect template mixin

--


[Issue 14427] New: Regression: navigation for phobos documentation has disappeared

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14427

  Issue ID: 14427
   Summary: Regression: navigation for phobos documentation has
disappeared
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: regression
  Priority: P1
 Component: websites
  Assignee: nob...@puremagic.com
  Reporter: bugzi...@digitalmars.com

http://dlang.org/phobos/index.html

Note the navigation list of all phobos modules in the left panel has
disappeared.

This is a critical bug.

--


[Issue 14427] Regression: navigation for phobos documentation has disappeared

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14427

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

 CC||and...@erdani.com

--- Comment #1 from Andrei Alexandrescu and...@erdani.com ---
The following sequence of events has happened:

* After Vladimir got an account, he uploaded the site as user vladimir.

* I upload files as user d-programming.

* There is a mismatch in groups and permissions of these two usernames that
makes it impossible for me to upload the site. I get errors and freezes in
rsync.

* This problem has been known for a while, and Martin tried to help it:
https://github.com/D-Programming-Language/dlang.org/pull/959

* This afternoon I tried to update the site with the rsync command as fixed by
Martin. Things still didn't work.

* Assuming at least I didn't upload some corrupted files, I gave up and sent
emails to Martin, Vladimir, and Sönke asking for help.

Looking into it further I think the issue here is d-programming is not a member
of the group dlang.org. I emailed about it to Jan.

The core issue here is twofold: (a) we have no centralized web czar so
everybody believes a failure is someone else's problem; (b) our provider (Jan)
is external so we depend on him being around to get stuff done.

In the meantime I manually synchronized /phobos/. Will keep this open until the
rsync issue gets fixed.

--


[Issue 12971] Missing REX prefix for 8 bit register access

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12971

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 12971] Missing REX prefix for 8 bit register access

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12971

--- Comment #5 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c056b9dd2dfb6f03e0a3cb0c98c0c85b64dfe5d8
Fix issue 12971 - Missing REX prefix for 8 bit register access

https://github.com/D-Programming-Language/dmd/commit/0bd6aad8f49221886275bc965d8bd25a0160e7a2
Merge pull request #4554 from WalterWaldron/fix12971

Fix issue 12971 - Missing REX prefix for 8 bit register access

--


Implementing Iterator to support foreach

2015-04-08 Thread tcak via Digitalmars-d-learn
I am planning to implement Iterator class. But looking at 
foreach statement, it takes a range only.


So is there any way other than returning an array from a function 
that is to be passed foreach statement? So I could write like 
that:


Iterator iter = new MyList();

foreach(item; iter){
}


Otherwise I will need to write like that:

foreach(item; iter.getArrayOfAvailableItems()){
}



Re: DMD AST Docs/Reference or Dumper?

2015-04-08 Thread Kai Nacke via Digitalmars-d

On Tuesday, 7 April 2015 at 15:58:49 UTC, bitwise wrote:
I'm trying to add some compile-time function generation to dmd, 
but wasn't sure exactly how to click all the little legos 
together.


Is there any documentation or reference for the DMD AST? Or 
maybe some examples somewhere of what an AST may look like for 
a given function?


As a last resort, I was about to start converting the 
ToJsonVisitor to a ToAstDumpVisitor, but as you may have 
guessed, I am not particularly excited about this venture. Does 
source code exist anywhere for this already?


Thanks


Hi bitwise,

I am not aware of such a visitor but would find it helpful, too.

Regards,
Kai


Re: Implementing Iterator to support foreach

2015-04-08 Thread Ali Çehreli via Digitalmars-d-learn

On 04/07/2015 10:59 PM, tcak wrote:

I am planning to implement Iterator class. But looking at foreach
statement, it takes a range only.


The other option is to overload opApply():


http://ddili.org/ders/d.en/foreach_opapply.html#ix_foreach_opapply.opApply

Ali



DDMD is now in the master branch

2015-04-08 Thread Daniel Murphy via Digitalmars-d
Several hours ago, Walter merged my DDMD branch into master.  This means 
that an additional 'ddmd' target is available in the makefiles, and the 
autotester will check that it builds.


The make target converts the C++ frontend source to D, and then compiles 
with the host dmd.  The converter is included in the DMD repo for now.


If you are a DMD developer, pull requests may need to be updated to modify 
the converter's configuration file, or to replace problematic code that 
cannot be converted.  Details can be found here: 
http://wiki.dlang.org/Updating_Pull_Requests_for_DDMD


For everyone else, please test the generated ddmd binary with your projects 
and report any correctness or performance problems you encounter.  I'm also 
interested in feedback on the quality of the generated D source.


When we are satisfied with the quality of the D version, we will switch over 
all development to it and delete the C++ source.  If we're lucky this will 
happen before the 2.068 release.


Thanks to everybody who has helped with DDMD over the last two years. 



Re: D Code list should be tag/hierarchical based

2015-04-08 Thread extrawurst via Digitalmars-d

On Wednesday, 8 April 2015 at 00:21:08 UTC, Jeff Jones wrote:


http://code.dlang.org/

Who wants to scroll 3 500 packages?


What i like about the current layout is the possibility to 
rapidly try different keyword searches using the browser 
find-functionality.


Re: Wanted: Review manager for std.data.json

2015-04-08 Thread Robert burner Schadek via Digitalmars-d

On Wednesday, 8 April 2015 at 09:58:31 UTC, Sönke Ludwig wrote:


That's what we have the review thread for. The library is now 
in a state that everyone can easily try out. If it were a 
Phobos PR, that would be much more difficult (or I'd have to 
maintain two versions in parallel).


from experience: Hardly anybody reads previous posts. comments on 
the source make it easier for you to get useful criticism and 
filter all the noise.


I still have to look into running a proper benchmark. Initial 
numbers that I just collected have not been as good as expected 
- I'll have to take a closer look at the compiler output.


I thought more performance was one of the major reason for the 
json replacement. We need graphs!




Re: Wanted: Review manager for std.data.json

2015-04-08 Thread Sönke Ludwig via Digitalmars-d

Am 08.04.2015 um 09:14 schrieb Iain Buclaw via Digitalmars-d:


On 8 Apr 2015 00:05, tcha via Digitalmars-d
digitalmars-d@puremagic.com mailto:digitalmars-d@puremagic.com wrote:
 
  Out of curiosity I tried to use this lib in lately discussed
benchmark [1]
 
  Original values on my machine (dmd 2.067, gdc 4.8.4, ldc2 0.15.1 llvm
3.5.1):
  D - 10.22s, 1322.7Mb
  D Gdc - 24.30s, 926.8Mb
  D Ldc - 25.93s, 925.8Mb
 
  With this lib it gets to [2]:
  D - 7.48s, 1794.0Mb
  Gdc and Ldc cannot build it with release (debug works) [3] and [4]
 

I assume you cleared your dub cache and didn't try linking a dmd built
library to a gdc/ldc application.  :)

Iain.



DUB uses the path of the compiler binary, as well as the reported 
frontend version to distinguish builds of different compilers, so that 
clearing the cache shouldn't be necessary.


But there are definitely performance issues. My own tests are far from 
what I would have expected, including for the pull parser...




Re: Future of contract-based programming in D

2015-04-08 Thread Pierre Krafft via Digitalmars-d

On Wednesday, 8 April 2015 at 11:26:38 UTC, Kagamin wrote:
BTW, what do you think about this problem: 
http://forum.dlang.org/post/cokicokwqnscaktxi...@forum.dlang.org 
?


That's a great feature! Don't inherit if it's not the right tool, 
and it almost never is. We have interfaces and alias this with 
@disable so composition is really easy to do.
I am starting to think that when we have multiple alias this we 
would be better of if we stopped using inheritance at all. Except 
for the syntax I can't come up with a problem that would be 
better solved using inheritance than using composition.


Re: Future of contract-based programming in D

2015-04-08 Thread Kagamin via Digitalmars-d

On Wednesday, 8 April 2015 at 12:07:18 UTC, Pierre Krafft wrote:
Except for the syntax I can't come up with a problem that would 
be better solved using inheritance than using composition.


How would you interate a collection of widgets without 
polymorphism, i.e. any generic handling?


Re: [OT] Regarding most used operating system among devs

2015-04-08 Thread Szymon Gatner via Digitalmars-d

On Wednesday, 8 April 2015 at 12:00:35 UTC, Kagamin wrote:
http://stackoverflow.com/research/developer-survey-2015#tech-tabsspaces 
heh


Yeah :) huh must be younger devs?


Re: [OT] Regarding most used operating system among devs

2015-04-08 Thread Szymon Gatner via Digitalmars-d

On Wednesday, 8 April 2015 at 10:34:19 UTC, Jens Bauer wrote:

On Wednesday, 8 April 2015 at 08:59:04 UTC, Szymon Gatner wrote:

From StackOverflow's 2015 Developer Survey [1]:
Mac appears to have overtaken the Linuxes among active Stack 
Overflow devs.

[1]http://stackoverflow.com/research/developer-survey-2015


If they wanted to have some more reliable numbers, they would 
make a web-page that shows a little more than an image of the 
Stackoverflow logo in some Web-browsers...

-That's all I see.


Works fine in Chrome and IE. I kindof doubt Joel Solsky can't do 
a wepage right


Re: Which D IDE do you use?(survey)

2015-04-08 Thread Szymon Gatner via Digitalmars-d

On Tuesday, 7 April 2015 at 22:58:44 UTC, weaselcat wrote:
Hi, I hope nobody minds but I'm just curious as to the 
popularity amongst D IDEs for a blog post. Sorry if I forgot 
your favorite $editor.


http://goo.gl/forms/MmsuInzDL0

thanks : )


voted for VisualD


Re: DDMD is now in the master branch

2015-04-08 Thread Jacob Carlborg via Digitalmars-d

On 2015-04-08 08:26, Daniel Murphy wrote:

Several hours ago, Walter merged my DDMD branch into master.  This means
that an additional 'ddmd' target is available in the makefiles, and the
autotester will check that it builds.

The make target converts the C++ frontend source to D, and then compiles
with the host dmd.  The converter is included in the DMD repo for now.

If you are a DMD developer, pull requests may need to be updated to
modify the converter's configuration file, or to replace problematic
code that cannot be converted.  Details can be found here:
http://wiki.dlang.org/Updating_Pull_Requests_for_DDMD

For everyone else, please test the generated ddmd binary with your
projects and report any correctness or performance problems you
encounter.  I'm also interested in feedback on the quality of the
generated D source.

When we are satisfied with the quality of the D version, we will switch
over all development to it and delete the C++ source.  If we're lucky
this will happen before the 2.068 release.

Thanks to everybody who has helped with DDMD over the last two years.


This is great news, awesome :)

--
/Jacob Carlborg


Re: Why I'm Excited about D

2015-04-08 Thread Martin Nowak via Digitalmars-d
On Tuesday, 7 April 2015 at 22:22:35 UTC, Andrei Alexandrescu 
wrote:

On 4/7/15 11:42 AM, Martin Nowak wrote:
What's still missing is a faster AST interpreter for CTFE 
though.


A JIT would be nice. -- Andrei


Maxine understood the point, see 
http://dconf.org/2013/talks/chevalier_boisvert.pdf p. 61 ff, an 
AST interpreter is something you can write over a long weekend, a 
JIT is rather unlikely to happen any time soon. Even a bytecode 
interpreter might hardly be worth the effort.


Re: Wanted: Review manager for std.data.json

2015-04-08 Thread Martin Nowak via Digitalmars-d

On Wednesday, 8 April 2015 at 07:14:32 UTC, Iain Buclaw wrote:

With this lib it gets to [2]:
D - 7.48s, 1794.0Mb
Gdc and Ldc cannot build it with release (debug works) [3] and 
[4]


Have you tried to use the pull/stream parser?


Re: Fun project - faster associative array algorithm

2015-04-08 Thread Martin Nowak via Digitalmars-d
On Tuesday, 7 April 2015 at 23:38:21 UTC, Andrei Alexandrescu 
wrote:

Ah, I thought the array embeds KeyValue directly. Thx! -- Andrei


It should if they are relatively small compared to the pointer, 
or at least store the key inline. As we recently discussed about 
the freeing bug in the AA, it should be fine to store values 
inline, as long as the bucket array is never deleted.


Re: Why I'm Excited about D

2015-04-08 Thread Idan Arye via Digitalmars-d

On Wednesday, 8 April 2015 at 08:35:52 UTC, ixid wrote:

On Tuesday, 7 April 2015 at 19:46:07 UTC, Ary Borenszweig wrote:

On 4/7/15 3:34 PM, deadalnix wrote:
On Tuesday, 7 April 2015 at 18:01:53 UTC, Ary Borenszweig 
wrote:

On 4/7/15 2:16 PM, deadalnix wrote:

On Tuesday, 7 April 2015 at 08:58:57 UTC, ixid wrote:

Or to be more consistent with UFCS:

foreach (name; names.parallel) {
 name.writeln;
}


no.please


wat


unreadable.is.ufcs.using.over


Yes, I don't like writeln being used with UFCS, it's an 
abuse.


My point is that every language has WATs :-)


Why is it 'an abuse'? Do you special case any other functions 
or is names.parallel unacceptable as well? Are longer chains 
ending in writeln acceptable or do you insist in putting the 
whole chain inside a parens writeln?


name.reverse.writeln

or

writeln(name.reverse)

or surely that would break your dislike of single UFCS 
arguments so you should stick to:


writeln(reverse(name))

Which is proper yoda speak.


At the very least, put () after the writelne:

name.reverse.writeln();

Using the property getter style for a function used solely for 
it's side-effects kind of conceals what you are trying to do 
here...



At any rate, since UFCS allows you to choose the order your code 
will be read in, you should try give as much information as soon 
as possible:


`writeln(name.reverse);` - the first word is `writeln`, so I know 
it's a statement that's going to write something to stdout.


`name.reverse.writeln();` - the first word is `name`, so I know 
it has something to do with the name.


Decide which one to use based on the first impression you want 
people to get from that statement.


Re: Which D IDE do you use?(survey)

2015-04-08 Thread wobbles via Digitalmars-d

On Wednesday, 8 April 2015 at 00:14:54 UTC, weaselcat wrote:

On Wednesday, 8 April 2015 at 00:10:57 UTC, Dicebot wrote:

On Tuesday, 7 April 2015 at 22:58:44 UTC, weaselcat wrote:
Hi, I hope nobody minds but I'm just curious as to the 
popularity amongst D IDEs for a blog post. Sorry if I forgot 
your favorite $editor.


http://goo.gl/forms/MmsuInzDL0

thanks : )


Can't select multiple options. Voted vim but commonly use 
Mono-D for investigating unknown code base.


I would probably use mono-D if the monodevelop vim plugin 
wasn't awful.


monodevelop plugin is awful?

Do tell why!
I find it excellent!


Re: Wanted: Review manager for std.data.json

2015-04-08 Thread Martin Nowak via Digitalmars-d

On Wednesday, 8 April 2015 at 09:58:31 UTC, Sönke Ludwig wrote:
Initial numbers that I just collected have not been as good as 
expected. I'll have to take a closer look at the compiler 
output.


I made a note, will see if I time to help with that. Algebraic 
might be a problem as it's based on typeinfo not tags, just a 
wild guess though.


Re: [OT] Regarding most used operating system among devs

2015-04-08 Thread Jens Bauer via Digitalmars-d

On Wednesday, 8 April 2015 at 08:59:04 UTC, Szymon Gatner wrote:

From StackOverflow's 2015 Developer Survey [1]:
Mac appears to have overtaken the Linuxes among active Stack 
Overflow devs.

[1]http://stackoverflow.com/research/developer-survey-2015


If they wanted to have some more reliable numbers, they would 
make a web-page that shows a little more than an image of the 
Stackoverflow logo in some Web-browsers...

-That's all I see.


Re: Wanted: Review manager for std.data.json

2015-04-08 Thread via Digitalmars-d

On Tuesday, 7 April 2015 at 16:37:15 UTC, Sönke Ludwig wrote:
Anyone up to this? The issues of the previous discussion [1] 
have all been addressed now more or less, so the package is 
ready for a more thorough review.


Code: https://github.com/s-ludwig/std_data_json
Docs: http://s-ludwig.github.io/std_data_json/

[1]: 
http://forum.dlang.org/thread/lt5s76$is$1...@digitalmars.com#post-lt5s76:24is:241:40digitalmars.com


It seems the `in` operator (or an equivalent method) isn't 
supported...


Re: Which D IDE do you use?(survey)

2015-04-08 Thread JN via Digitalmars-d

Eclipse DDT and Code::Blocks for me.


Re: Generating all combinations of length X in an array

2015-04-08 Thread bearophile via Digitalmars-d-learn

wobbles:

While trying to generate all combinations of length X in an 
array,

I came across the question on stackoverflow. [1]

Theres a couple good answers there, but one that caught my eye 
shows a C# code snippet that is quite nice and short:


Often short code is not the best code.

Take a look at the versions here, the usable one is the third:
http://rosettacode.org/wiki/Combinations#D

Bye,
bearophile


Re: Creating a microcontroller startup file

2015-04-08 Thread Mike via Digitalmars-d-learn

On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:



Question number 2: Is it possible to change the VectorFunc to 
be a real function pointer, rather than a void* ?




I did something along these lines (modified to match your 
example) and it worked fine for me:


alias VectorFunc = void function();

@attribute(weak) @attribute(alias, defaultHandler)
extern void Reset_Handler();

@attribute(weak) @attribute(alias, defaultHandler)
extern void NMI_Handler()

@attribute(weak) @attribute(alias, defaultHandler)
extern void HardFault_Handler();

@attribute(section,.isr_vector.ro)
immutable ISR[3] g_pfnVectors =
[
  Reset_Handler
, NMI_Handler
, HardFault_Handler
];

I did this before weak, alias, and section attributes were 
added, however.  To see my original code, look at the slide in 
the presentation here: https://youtu.be/o5m0m_ZG9e8?t=2332.  My 
original code had everything decorated with extern(C) as well so 
I could refer to the symbol directly in my linker scripts.  That 
may not be needed for you, so I left it out.


Question number 3: How can I call an external function and keep 
the binary file size down ?


Are you compiling with -ffunction-sections -fdata-sections and 
linking with --gc-sections? You may need to in order to get rid 
of some things.


What do you using for your D runtime?  Perhaps some code in your 
runtime is implicitly linking to some code you're not directly 
calling.


I also add the following to my linker scripts to get rid of stuff 
I don't find necessary:


/DISCARD/ :
{
   *(.ARM.extab*)
   *(.ARM.exidx*)
}

/DISCARD/ :
{
   *(.ARM.attributes*)
   *(.comment)
}

You can see the latest incarnation of my linker script here: 
https://github.com/JinShil/stm32f42_discovery_demo/blob/master/linker/linker.ld



Question number 4: How can I reduce the function declaration of 
the Reset_Handler and NMI_Handler shown above ?


Try something along these lines.

enum weak = gcc.attribute.attribute(weak);
enum isrDefault = gcc.attribute.attribute(alias, 
defaultHandler);


extern @weak @isrDefault void NMI_Handler();
extern @weak @isrDefault void HardFault_Handler();

I use this idiom briefly in my code here: 
https://github.com/JinShil/stm32f42_discovery_demo/blob/master/source/start.d


The enum thing kinda bugs me about D, but you'll see it used 
everywhere, especially phobos.  It's called a manifest constant, 
and you can find a short blurb about it at the bottom of this 
page:  http://dlang.org/enum.html


Mike


Re: Generating all combinations of length X in an array

2015-04-08 Thread wobbles via Digitalmars-d-learn

On Wednesday, 8 April 2015 at 11:08:00 UTC, wobbles wrote:

On Wednesday, 8 April 2015 at 10:54:45 UTC, bearophile wrote:

wobbles:

While trying to generate all combinations of length X in an 
array,

I came across the question on stackoverflow. [1]

Theres a couple good answers there, but one that caught my 
eye shows a C# code snippet that is quite nice and short:


Often short code is not the best code.

Take a look at the versions here, the usable one is the third:
http://rosettacode.org/wiki/Combinations#D

Bye,
bearophile


Ah, excellent! Dunno why I didnt think of rosettacode before.

Is the 3rd version usable at compile time?

Thanks, all the D stuff on rosettacode is an excellent resource!


Have just tested, it is!


Re: [OT] Regarding most used operating system among devs

2015-04-08 Thread Kagamin via Digitalmars-d
http://stackoverflow.com/research/developer-survey-2015#tech-tabsspaces 
heh


function shadowed

2015-04-08 Thread ddos via Digitalmars-d-learn

i got two modules
opengvg.d and vg.d

vg.d contains calls to external c functions
openvg.d should wrap and simplify some of those calls

in openvg.d i make public import of submodule vg.d
such that if openvg.d is imported the functions in vg.d can be 
called, this works as intended. but as soon as i overload a 
function from vg.d in openvg.d i can only call the function in 
openvg.d


example:
vg.d:
module vg;
extern (C) void  vgSetParameterfv(VGHandle object, VGint 
paramType, VGint count, VGfloat *values);


openvg.d
module openvg;
public import vg;

void vgSetParameterfv(VGHandle object, VGint paramType, 
const(VGfloat[]) values)

{
	vg.vgSetParameterfv(object, paramType, cast(int)values.length, 
cast(VGfloat*)values);

}

test.d
import openvg;
vgSetParameterfv(object, paramType, length, values); // call to 
fun in vg.d


how can i call both functions? i'd like to avoid using the module 
prefix vg.vgSetParameterfv if possible


source:
https://github.com/oggs91/OpenVG_D/blob/master/openvg/


Re: Wanted: Review manager for std.data.json

2015-04-08 Thread Sönke Ludwig via Digitalmars-d

Am 08.04.2015 um 11:05 schrieb Robert burner Schadek:

IMO this should be a PR for phobos so all comments to the code can be
collected in one location.

Where is the benchmark against std.json and rapidjson?



That's what we have the review thread for. The library is now in a state 
that everyone can easily try out. If it were a Phobos PR, that would be 
much more difficult (or I'd have to maintain two versions in parallel).


I still have to look into running a proper benchmark. Initial numbers 
that I just collected have not been as good as expected - I'll have to 
take a closer look at the compiler output.


Re: Which D IDE do you use?(survey)

2015-04-08 Thread Jens Bauer via Digitalmars-d

I voted for nano+uCode (my own IDE, which is still pre-alpha).

uCode is designed for microcontroller and SPLD/CPLD use.
nano, because it's the only editor on a Mac, I can be sure of 
handling Unicode well.
(TextEdit messes up unicode files, Xcode 2.5 seems to work with 
Unicode, but Xcode 3.x messes it up).

I do use Xcode 2.5 frequently, but D is not integrated.


Re: Which D IDE do you use?(survey)

2015-04-08 Thread Martin Nowak via Digitalmars-d

On Tuesday, 7 April 2015 at 22:58:44 UTC, weaselcat wrote:

http://goo.gl/forms/MmsuInzDL0


Emacs



Re: Wanted: Review manager for std.data.json

2015-04-08 Thread tcha via Digitalmars-d

On Wednesday, 8 April 2015 at 07:14:32 UTC, Iain Buclaw wrote:
I assume you cleared your dub cache and didn't try linking a 
dmd built

library to a gdc/ldc application.  :)

Iain.


I tried it with dub clean, dub --force, even removed 
std_data_json package to clone it again, but no success.


Here is a full dub build -v output: http://pastebin.com/yHV3gYcX


Re: Future of contract-based programming in D

2015-04-08 Thread Kagamin via Digitalmars-d

On Tuesday, 7 April 2015 at 12:51:45 UTC, Delirius wrote:
I read a thread here where he wrote you should get rid of those 
in/out contracts and replace them with assert()s in the 
function body.


That was only because contracts with Allman style increase line 
count.


BTW, what do you think about this problem: 
http://forum.dlang.org/post/cokicokwqnscaktxi...@forum.dlang.org ?


Re: Which D IDE do you use?(survey)

2015-04-08 Thread Pierre Krafft via Digitalmars-d
Any editor using DCD will be great, and I think most D editors 
are. I use Sublime exclusively since it's easy to setup and 
effective for me to use.


Re: DDMD is now in the master branch

2015-04-08 Thread Walter Bright via Digitalmars-d

On 4/8/2015 2:45 AM, Daniel Murphy wrote:

The backend is still in C++ and the license is unchanged.  And most likely will
never change.


Also, translating code to another language creates a derived work and does not 
obviate the copyright or license.




Re: Wanted: Review manager for std.data.json

2015-04-08 Thread Sönke Ludwig via Digitalmars-d

Am 08.04.2015 um 10:24 schrieb Andrea Fontana:

Any plan to support functions like these?

http://forum.dlang.org/thread/lrknjl$co7$1...@digitalmars.com?page=4#post-bcszdbasnjzmbwzdgeqy:40forum.dlang.org


There is opt() [1], which takes a path and returns a 
`Nullable!JSONValue`. get is unfortunately already taken by 
std.typecons.Algebraic, so we can't use it for its AA meaning.


Maybe another overload of opt?
JSONValue opt(JSONValue default_value, string[] path...);

[1]: 
http://s-ludwig.github.io/std_data_json/stdx/data/json/value/json_value.opt.html


Re: Which D IDE do you use?(survey)

2015-04-08 Thread Jens Bauer via Digitalmars-d

On Wednesday, 8 April 2015 at 10:43:43 UTC, Dmitri Makarov wrote:

On Wednesday, 8 April 2015 at 10:29:44 UTC, Jens Bauer wrote:
nano, because it's the only editor on a Mac, I can be sure of 
handling Unicode well.


Emacs provides complete Unicode support.


True - and I do like Emacs, but I need my editor to be simpler. :)
Nano might not be so advanced, but it does the basic editing 
quite well.


Re: [OT] Regarding most used operating system among devs

2015-04-08 Thread thedeemon via Digitalmars-d

On Wednesday, 8 April 2015 at 08:59:04 UTC, Szymon Gatner wrote:

From StackOverflow's 2015 Developer Survey [1]:


Interestingly, from the Text editor question we learn that 
most used ones are NotePad++ and Sublime Text (and not 
Visual Studio) which I know are favs among webdevelopers that 
are not used to IDEs (as debugging happens in web browsers).


I suspect in the list of text editors IDEs were not listed, they 
probably were in another question.


Re: Which D IDE do you use?(survey)

2015-04-08 Thread John Colvin via Digitalmars-d

On Tuesday, 7 April 2015 at 22:58:44 UTC, weaselcat wrote:
Hi, I hope nobody minds but I'm just curious as to the 
popularity amongst D IDEs for a blog post. Sorry if I forgot 
your favorite $editor.


http://goo.gl/forms/MmsuInzDL0

thanks : )


Vim.

I would happily use a full IDE, but only if the fundamental 
text-editing was vim and customisable.


Generating all combinations of length X in an array

2015-04-08 Thread wobbles via Digitalmars-d-learn

Hi folks,

While trying to generate all combinations of length X in an array,
I came across the question on stackoverflow. [1]

Theres a couple good answers there, but one that caught my eye 
shows a C# code snippet that is quite nice and short:


public static IEnumerableIEnumerableT CombinationsT(this 
IEnumerableT elements, int k)

{
  return k == 0 ? new[] { new T[0] } :
elements.SelectMany((e, i) =
  elements.Skip(i + 1).Combinations(k - 1).Select(c = (new[] 
{e}).Concat(c)));

}


I spent a couple hours trying to translate this to D, but couldnt 
get my head around the SelectMany statement.
I think it's analogous to std.algorithm.map, but it seems quite 
difficult to mimic the behaviour using map.


Anyone with more knowledge and/or skills like to have a crack?

Thanks!

[1] 
http://stackoverflow.com/questions/127704/algorithm-to-return-all-combinations-of-k-elements-from-n


Re: Which D IDE do you use?(survey)

2015-04-08 Thread Dmitri Makarov via Digitalmars-d

On Wednesday, 8 April 2015 at 10:29:44 UTC, Jens Bauer wrote:
nano, because it's the only editor on a Mac, I can be sure of 
handling Unicode well.


Emacs provides complete Unicode support.


Re: Generating all combinations of length X in an array

2015-04-08 Thread wobbles via Digitalmars-d-learn

On Wednesday, 8 April 2015 at 10:54:45 UTC, bearophile wrote:

wobbles:

While trying to generate all combinations of length X in an 
array,

I came across the question on stackoverflow. [1]

Theres a couple good answers there, but one that caught my eye 
shows a C# code snippet that is quite nice and short:


Often short code is not the best code.

Take a look at the versions here, the usable one is the third:
http://rosettacode.org/wiki/Combinations#D

Bye,
bearophile


Ah, excellent! Dunno why I didnt think of rosettacode before.

Is the 3rd version usable at compile time?

Thanks, all the D stuff on rosettacode is an excellent resource!


Re: Why I'm Excited about D

2015-04-08 Thread Jacob Carlborg via Digitalmars-d

On 2015-04-07 19:53, deadalnix wrote:


https://www.destroyallsoftware.com/talks/wat


That is mostly for JavaScript.

--
/Jacob Carlborg


Re: Creating a microcontroller startup file

2015-04-08 Thread Johannes Pfau via Digitalmars-d-learn
Am Tue, 07 Apr 2015 20:38:52 +
schrieb Jens Bauer doc...@who.no:

 On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:
  Question number 1: How can a C subroutine be made optional, so 
  it's called only if it linked ?
 
 Question 1 might be answered by the following thread:
 http://forum.dlang.org/thread/mg1bad$30uk$1...@digitalmars.com
 -So no need to answer question 1. ;)

I actually saw these errors when I first tested your examples, but I
thought that was a mistake in the example code. I didn't even know that
extern weak symbols get default values in C ;-)


Re: Why I'm Excited about D

2015-04-08 Thread deadalnix via Digitalmars-d
On Wednesday, 8 April 2015 at 05:03:03 UTC, Andrei Alexandrescu 
wrote:

On 4/7/15 7:33 PM, deadalnix wrote:
On Wednesday, 8 April 2015 at 01:30:02 UTC, Andrei 
Alexandrescu wrote:
Not really when you think about it. CPU instruction is a 
bytecode like

another, with provided hardware interpreter for it.


Classical interpretation via tree walking does not use a 
bytecode. --

Andrei


Yes, but this is pretty much what is done right now, so that 
wouldn't be

an improvement.


You went ouroboros. This means your point has been destroyed so 
thoroughly, you lost the thread of the dialog. Own the 
destruction and move on. -- Andrei


You are the one making about winning.


Re: DDMD is now in the master branch

2015-04-08 Thread Daniel Murphy via Digitalmars-d
Martin Nowak  wrote in message 
news:ucmrojmbjdaubdzqj...@forum.dlang.org...


That would be great, though being able to compile ddmd with ldc and/or gdc 
is necessary IMO to make it releasable. What's missing to make that work?


Not sure, but they will most likely need to be updated to 2.067.  The main 
issues are likely to be C++ ABI related. 



Re: Why I'm Excited about D

2015-04-08 Thread ixid via Digitalmars-d

On Tuesday, 7 April 2015 at 19:46:07 UTC, Ary Borenszweig wrote:

On 4/7/15 3:34 PM, deadalnix wrote:
On Tuesday, 7 April 2015 at 18:01:53 UTC, Ary Borenszweig 
wrote:

On 4/7/15 2:16 PM, deadalnix wrote:

On Tuesday, 7 April 2015 at 08:58:57 UTC, ixid wrote:

Or to be more consistent with UFCS:

foreach (name; names.parallel) {
  name.writeln;
}


no.please


wat


unreadable.is.ufcs.using.over


Yes, I don't like writeln being used with UFCS, it's an abuse.

My point is that every language has WATs :-)


Why is it 'an abuse'? Do you special case any other functions or 
is names.parallel unacceptable as well? Are longer chains ending 
in writeln acceptable or do you insist in putting the whole chain 
inside a parens writeln?


name.reverse.writeln

or

writeln(name.reverse)

or surely that would break your dislike of single UFCS arguments 
so you should stick to:


writeln(reverse(name))

Which is proper yoda speak.


[Issue 14424] dmd crashes with __traits(getUnitTests)

2015-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14424

Jacob Carlborg d...@me.com changed:

   What|Removed |Added

 CC||d...@me.com

--- Comment #1 from Jacob Carlborg d...@me.com ---
Seems to be a regression, it works when I try with 2.065.0, but not with
2.066.0.

--


Re: Implementing Iterator to support foreach

2015-04-08 Thread bearophile via Digitalmars-d-learn

tcak:

I am planning to implement Iterator class. But looking at 
foreach statement, it takes a range only.


Unless you are just experimenting, it's better to not go against 
a language and its std lib.


Bye,
bearophile


Re: Why I'm Excited about D

2015-04-08 Thread Jacob Carlborg via Digitalmars-d

On 2015-04-07 19:46, Ary Borenszweig wrote:


It's true that Ruby is slow, but only because their priority is
correctness.


I don't think it's so much about the correctness, it's rather the 
complicated features it supports, like metaprogramming. eval and 
bindings are causing problems, also promoting Fixnum to Bignum when it
doesn't fit is a problem. I also read somewhere that since you can 
replace any method in Ruby, all calls to a method needs to check if the 
method has been replaced.


Here's a blog that talks about the problems of optimizing Ruby [1]

[1] http://blog.headius.com/2012/10/so-you-want-to-optimize-ruby.html

--
/Jacob Carlborg


Re: Creating a microcontroller startup file

2015-04-08 Thread Jens Bauer via Digitalmars-d-learn

On Wednesday, 8 April 2015 at 08:02:35 UTC, Johannes Pfau wrote:
I actually saw these errors when I first tested your examples, 
but I thought that was a mistake in the example code. I didn't 
even know that extern weak symbols get default values in C ;-)


Don't feel bad about that. I think I found out by looking at
someone else's source-code. ;)
It's not really information that is easy to find on the net.


Re: DDMD is now in the master branch

2015-04-08 Thread Daniel Murphy via Digitalmars-d
bioinfornatics  wrote in message 
news:guokkisbhbhgbvohj...@forum.dlang.org...



little question as ddmd generate a code does this means that ddmd
backend and frontend is full open source under boost license?


The backend is still in C++ and the license is unchanged.  And most likely 
will never change.


We are working to mitigate this by restructuring the frontend so that it is 
easier to maintain GDC and LDC, in the hope that they will be able to follow 
the dmd frontend version much more closely. 



Re: Wanted: Review manager for std.data.json

2015-04-08 Thread Andrea Fontana via Digitalmars-d

Any plan to support functions like these?

http://forum.dlang.org/thread/lrknjl$co7$1...@digitalmars.com?page=4#post-bcszdbasnjzmbwzdgeqy:40forum.dlang.org

On Tuesday, 7 April 2015 at 16:37:15 UTC, Sönke Ludwig wrote:
Anyone up to this? The issues of the previous discussion [1] 
have all been addressed now more or less, so the package is 
ready for a more thorough review.


Code: https://github.com/s-ludwig/std_data_json
Docs: http://s-ludwig.github.io/std_data_json/

[1]: 
http://forum.dlang.org/thread/lt5s76$is$1...@digitalmars.com#post-lt5s76:24is:241:40digitalmars.com




[OT] Regarding most used operating system among devs

2015-04-08 Thread Szymon Gatner via Digitalmars-d

From StackOverflow's 2015 Developer Survey [1]:

For the third year in a row, we asked respondents which 
operating system they use the most. Windows maintains the lion's 
share of the developer operating system market, while Mac appears 
to have overtaken the Linuxes among active Stack Overflow devs.


Linux may be a small player on the consumer market, with just 
1.5% of global desktop operating system share, but it's a go-to 
OS for developers.


Interestingly, from the Text editor question we learn that most 
used ones are NotePad++ and Sublime Text (and not Visual 
Studio) which I know are favs among webdevelopers that are not 
used to IDEs (as debugging happens in web browsers).


This correlates with with Most popular technologies results too.

To sum up:

Please give more attention to Windows developers like myself ;)


[1]http://stackoverflow.com/research/developer-survey-2015


Re: Fun project - faster associative array algorithm

2015-04-08 Thread Martin Nowak via Digitalmars-d

On Wednesday, 8 April 2015 at 09:12:00 UTC, Martin Nowak wrote:
The biggest problems in writing an AA library implementation 
sorted by difficulty are:


There is a clear acceptance list for a good AA here.
https://github.com/D-Programming-Language/druntime/pull/934#issuecomment-65916801


Re: DDMD is now in the master branch

2015-04-08 Thread John Colvin via Digitalmars-d

On Wednesday, 8 April 2015 at 08:20:49 UTC, bioinfornatics wrote:

Good news,

little question as ddmd generate a code does this means that 
ddmd

backend and frontend is full open source under boost license?

regards


IIRC ddmd is only the frontend.


Re: Fun project - faster associative array algorithm

2015-04-08 Thread thedeemon via Digitalmars-d

On Tuesday, 7 April 2015 at 19:09:21 UTC, deadalnix wrote:

Food for thought :

http://codecapsule.com/2013/11/11/robin-hood-hashing/
http://people.csail.mit.edu/shanir/publications/disc2008_submission_98.pdf

Also it is probably worthwhile to adopt various strategy 
depending on element types characteristics.


More food, D implementation and benchmark results (default AAs 
vs. Vibe.d linear probing vs. Robin Hood) :

http://www.infognition.com/blog/2014/on_robin_hood_hashing.html


Re: Why I'm Excited about D

2015-04-08 Thread ixid via Digitalmars-d

On Tuesday, 7 April 2015 at 18:34:01 UTC, deadalnix wrote:

On Tuesday, 7 April 2015 at 18:01:53 UTC, Ary Borenszweig wrote:

On 4/7/15 2:16 PM, deadalnix wrote:

On Tuesday, 7 April 2015 at 08:58:57 UTC, ixid wrote:

Or to be more consistent with UFCS:

foreach (name; names.parallel) {
  name.writeln;
}


no.please


wat


unreadable.is.ufcs.using.over


UFCS doesn't give you yoda speak. It's more consistent to use it 
for single as well as multiple function chains and it's cleaner.


Some users' distaste for UFCS cramps D's developing its own 
consistent idiomatic approach. Do you have any argument for your 
dislike that isn't just personal preference? You're fine with 
names.parallel but for some reason balk at name.writeln?


Re: DDMD is now in the master branch

2015-04-08 Thread Robert burner Schadek via Digitalmars-d

Congratulations


Re: Wanted: Review manager for std.data.json

2015-04-08 Thread Robert burner Schadek via Digitalmars-d
IMO this should be a PR for phobos so all comments to the code 
can be collected in one location.


Where is the benchmark against std.json and rapidjson?



Re: Which D IDE do you use?(survey)

2015-04-08 Thread Jacob Carlborg via Digitalmars-d

On 2015-04-08 00:58, weaselcat wrote:

Hi, I hope nobody minds but I'm just curious as to the popularity
amongst D IDEs for a blog post. Sorry if I forgot your favorite $editor.

http://goo.gl/forms/MmsuInzDL0


TextMate 2.

--
/Jacob Carlborg


Re: D Code list should be tag/hierarchical based

2015-04-08 Thread Jacob Carlborg via Digitalmars-d

On 2015-04-08 08:51, extrawurst wrote:


What i like about the current layout is the possibility to rapidly try
different keyword searches using the browser find-functionality.


I like that too, but it only works when there are quire few packages.

--
/Jacob Carlborg


Re: Fun project - faster associative array algorithm

2015-04-08 Thread Martin Nowak via Digitalmars-d

On Tuesday, 7 April 2015 at 19:07:01 UTC, w0rp wrote:

On Tuesday, 7 April 2015 at 18:35:27 UTC, Martin Nowak wrote:
One thing I was wondering about, which you might know more 
about, is that I had to set my load factor to be half the size 
of the array, as quadratic probing seems to fail when more than 
half the buckets are filled. Is that correct, or did I make a 
mistake?


You made a mistake somewhere, the sweet spot should be in the 
range of 0.6-0.8. Quadratic probing with triangular numbers is 
guaranteed to fail only when your buckets are completely full.


Re: Wanted: Review manager for std.data.json

2015-04-08 Thread Iain Buclaw via Digitalmars-d
On 8 Apr 2015 00:05, tcha via Digitalmars-d digitalmars-d@puremagic.com
wrote:

 On Tuesday, 7 April 2015 at 16:37:15 UTC, Sönke Ludwig wrote:

 Anyone up to this? The issues of the previous discussion [1] have all
been addressed now more or less, so the package is ready for a more
thorough review.

 Code: https://github.com/s-ludwig/std_data_json
 Docs: http://s-ludwig.github.io/std_data_json/

 [1]:
http://forum.dlang.org/thread/lt5s76$is$1...@digitalmars.com#post-lt5s76:24is:241:40digitalmars.com


 Out of curiosity I tried to use this lib in lately discussed benchmark [1]

 Original values on my machine (dmd 2.067, gdc 4.8.4, ldc2 0.15.1 llvm
3.5.1):
 D - 10.22s, 1322.7Mb
 D Gdc - 24.30s, 926.8Mb
 D Ldc - 25.93s, 925.8Mb

 With this lib it gets to [2]:
 D - 7.48s, 1794.0Mb
 Gdc and Ldc cannot build it with release (debug works) [3] and [4]


I assume you cleared your dub cache and didn't try linking a dmd built
library to a gdc/ldc application.  :)

Iain.


Re: DDMD is now in the master branch

2015-04-08 Thread bioinfornatics via Digitalmars-d

Good news,

little question as ddmd generate a code does this means that ddmd
backend and frontend is full open source under boost license?

regards


Re: DDMD is now in the master branch

2015-04-08 Thread Martin Nowak via Digitalmars-d

On Wednesday, 8 April 2015 at 06:26:04 UTC, Daniel Murphy wrote:

If we're lucky this will happen before the 2.068 release.


That would be great, though being able to compile ddmd with ldc 
and/or gdc is necessary IMO to make it releasable. What's missing 
to make that work?


Re: Fun project - faster associative array algorithm

2015-04-08 Thread Martin Nowak via Digitalmars-d
On Tuesday, 7 April 2015 at 22:33:52 UTC, Steven Schveighoffer 
wrote:
Until that point, all these discussions on AA updates are 
useless.


I really don't that all or nothing attitude, it condemns an 
important step, just because something better might be possible. 
It's also very comfortable, because this way nobody will ever 
have to do anything.


Improving the AA implementation has a big immediate effect, and 
will also help anyone writing a library implementation, because 
any candidate up to this date was still based on that crappy 
bucket list implementation.


The biggest problems in writing an AA library implementation 
sorted by difficulty are:

- deprecation of all magic AA behaviors (attributes, as[i][j]++)
- get the lowering right
- efficient construction and value insertion (rvalue moving)


Re: DUB 0.9.23 released

2015-04-08 Thread Marco Leise via Digitalmars-d-announce
Am Mon, 06 Apr 2015 10:21:45 +0200
schrieb Sönke Ludwig slud...@rejectedsoftware.com:

 The new version contains some important bug fixes for sub modules and 
 overridden string imports, as well as some other major fixes. Apart from 
 that, the major additions are:
 
   - copyFiles now get hard linked instead of copied and whole
 directories can be copied in addition to individual files
   - The dub init command has been extended to take an optional list of
 dependencies that is added to the generated dub.json
   - A new deimos template has been been implemented
 (dub init --type=deimos)
   - The default compiler is now chosen based on what is found in PATH

How does it resolve preferences when 3 comilers are on PATH ? =)
dmd first?

   - New project generators for Sublime Text and CMake
   - In single file build mode, --parallel can now be used to compile
 with multiple compiler instances at once
 
 Find the full list of changes in the change log [1] and download at:
 
 http://code.dlang.org/download
 
 [1]: https://github.com/D-Programming-Language/dub/blob/master/CHANGELOG.md

And one idea that recently came to my mind since I'm a fan of
shared libraries. Would it work in D to say compile a shared
library and generate a number of .di files required to use it?
Similar to druntime that provides only a hand full of its
modules as .di or where necessary as .d files.

I'm looking for a perspective out of the compile the world
model in Dlang, since as far as I understand it, the D
front-end will always parse all imported modules recursively.
Even in single-file compilation mode, when only app.d
changed it would parse the whole thing down to the last corner
of all used D libraries like GtkD or vibe.d.

With the minimum amount of required .di files for libraries,
further private imports inside their modules are hidden away
from the compiler, thereby short-circuiting the import the
world recursion.

-- 
Marco



Re: [OT] Regarding most used operating system among devs

2015-04-08 Thread Dicebot via Digitalmars-d

On Wednesday, 8 April 2015 at 15:41:42 UTC, bachmeier wrote:

On Wednesday, 8 April 2015 at 08:59:04 UTC, Szymon Gatner wrote:

To sum up:

Please give more attention to Windows developers like myself ;)


We could turn that around: Windows developers, please step up 
to contribute to the development of D.


Which is the only way more attention to Windows development can 
realistically happen.


Re: [OT] Regarding most used operating system among devs

2015-04-08 Thread weaselcat via Digitalmars-d

On Wednesday, 8 April 2015 at 08:59:04 UTC, Szymon Gatner wrote:

From StackOverflow's 2015 Developer Survey [1]:

For the third year in a row, we asked respondents which 
operating system they use the most. Windows maintains the 
lion's share of the developer operating system market, while 
Mac appears to have overtaken the Linuxes among active Stack 
Overflow devs.


Linux may be a small player on the consumer market, with just 
1.5% of global desktop operating system share, but it's a go-to 
OS for developers.


Interestingly, from the Text editor question we learn that 
most used ones are NotePad++ and Sublime Text (and not 
Visual Studio) which I know are favs among webdevelopers that 
are not used to IDEs (as debugging happens in web browsers).


This correlates with with Most popular technologies results 
too.


To sum up:

Please give more attention to Windows developers like myself ;)


[1]http://stackoverflow.com/research/developer-survey-2015


Poll has a windows bias due to stackoverflows focus on .NET, 
which is extremely overrepresented on SO(see: redmonk)


Re: Creating a microcontroller startup file

2015-04-08 Thread Jens Bauer via Digitalmars-d-learn
Something tells me that now is when I have to start doing some 
hard work. ;)

-Sorry, I need to split this up into short replies/questions.

On Wednesday, 8 April 2015 at 11:17:12 UTC, Mike wrote:

On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:
Question number 2: Is it possible to change the VectorFunc to 
be a real function pointer, rather than a void* ?



immutable ISR[3] g_pfnVectors =
[
  cast(ISR)_stack
, Reset_Handler
, NMI_Handler
, HardFault_Handler
];


In your example, you do not have the initial stack pointer.
The above code gives me the following:
src/test.d:24:13: error: reinterpreting cast from uint* to 
void()* is not supported in CTFE

cast(ISR)_stack
 ^

-That's the only reason I needed to change it to from function() 
to void*.

Can you successfully cast(ISR)_stack ?


Re: Berlin D Meetup April 2015

2015-04-08 Thread Dicebot via Digitalmars-d-announce
This will be an early preview of some stuff prepared for my DConf 
talk. See you in Berlin!


Also slides from previous talk by Martin Nowak are public now : 
https://code.dawg.eu/talks/2015-03-20-garbage_collection_dmeetup/#1


Re: [OT] Regarding most used operating system among devs

2015-04-08 Thread Dicebot via Digitalmars-d

On Wednesday, 8 April 2015 at 16:03:12 UTC, Charles wrote:

On Wednesday, 8 April 2015 at 15:41:42 UTC, bachmeier wrote:
On Wednesday, 8 April 2015 at 08:59:04 UTC, Szymon Gatner 
wrote:

To sum up:

Please give more attention to Windows developers like myself 
;)


We could turn that around: Windows developers, please step up 
to contribute to the development of D.


I don't know if that's necessarily fair. I asked last week about
finding the Win32 API for D. It exists, but it hasn't been
touched in awhile, and still exists on dsource (not
code.dlang.org). We have core.sys.windows.windows, but it's
pretty terrible atm in this front.


So who is going to do the pull request? One of those Linux 
developers I presume? :)


Re: Why I'm Excited about D

2015-04-08 Thread via Digitalmars-d

On Wednesday, 8 April 2015 at 13:52:22 UTC, bearophile wrote:
I think foo.writeln; is acceptable. You just need to get a 
bit used to it.


The whole dot-notation for pipelining is semantically flawed en 
relies on knowing what names stand for rather than more universal 
symbols with known interpretations. It has been (ab)used quite a 
bit in OO-libraries for other languages, for chaining, which can 
be rather confusing when you use many libraries.


Dedicated pipeline operators look much better 
(input-process-output). Add dataflow with multiple paths and 
high level optimization, then you have something.


Re: Which D IDE do you use?(survey)

2015-04-08 Thread André

On Tuesday, 7 April 2015 at 22:58:44 UTC, weaselcat wrote:
Hi, I hope nobody minds but I'm just curious as to the 
popularity amongst D IDEs for a blog post. Sorry if I forgot 
your favorite $editor.


http://goo.gl/forms/MmsuInzDL0

thanks : )


As I already use Qt Creator for C++ development I also use it 
with the great qtcreator-dlangeditor and qtcreator-dubmanager 
plugins, giving me DCD and DUB integration [1], [2]. VIM mode is 
enabled of course :-)


André

[1] https://github.com/Groterik/qtcreator-dlangeditor
[2] https://github.com/Groterik/qtcreator-dubmanager


Is it any faster to read array slices than just elements of an array?

2015-04-08 Thread ZILtoid1991 via Digitalmars-d-learn
While I technically finished the 0.2 version of my graphics 
engine which has a reasonable speed at low internal resolutions 
and with only a couple of sprites, but it still gets bottlenecked 
a lot. First I'll throw out the top-down determination 
algorhythm as it requires constant memory paging (alrought it 
made much more sense when the engine was full OO and even slower).


Instead I'll use a overwriting (bottom-up) method. It still 
needs constant updates and I have to remove the per sprite 
transparency key and use a per layer key, however it requires 
much less paging, and still have the ability of unbound layer 
numbers and sprite count with unbound sizes.


I also came up with the idea of reading slices out from the 
graphical elements to potentially speed up the process a bit, 
especially as the custom bitmaps it uses are 16bit for palette 
operations, so per pixel read operations would waste a portion of 
memory bus. So should I write a method for the bitmap class which 
gets a line from it? (an array slice as it contains the data in a 
single 1D array to avoid jagged arrays on a future expansion for 
a scaler) And can I write an array slice at a position of an 
array? (to reduce writeback calls)


Re: Why I'm Excited about D

2015-04-08 Thread Adam D. Ruppe via Digitalmars-d

On Wednesday, 8 April 2015 at 16:59:27 UTC, Dicebot wrote:
Just to be clear - I wouldn't allow range.copy(stdout) in my 
projects either, requiring any consumer to be written as 
dedicated expression.


Worth noting that std.range.put's documentation also says use the 
freestanding syntax. (This is surely to avoid ambiguity with 
member puts on output ranges, but still.)


Re: Why I'm Excited about D

2015-04-08 Thread Dicebot via Digitalmars-d
On Wednesday, 8 April 2015 at 16:56:12 UTC, Andrei Alexandrescu 
wrote:

Considering I am far from the only person having problems
with it in our team and such style is extremely common because 
of being
easy - this can easily be one of most damaging language 
features in D in

terms of wasted developer time.


Again trying with ad populum. Not buying it.


I don't even slightly care about your opinion here. It is just 
another annoying custom style rule I have to deal with. Casual 
necessity for actually getting work done with D.


And if not buying it is all you can say about actual experience 
report (however opinionated it is) this tells quite a lot about 
how justified _your_ preference is.


Re: Why I'm Excited about D

2015-04-08 Thread Walter Bright via Digitalmars-d

On 4/8/2015 9:58 AM, Adam D. Ruppe wrote:

On Wednesday, 8 April 2015 at 16:51:53 UTC, Andrei Alexandrescu wrote:

File defines it.


Last time this came up on reddit, I explained that *this* was exactly why I
think string.writeln is mistaken. writeln does NOT operate on its string, it
doesn't tell the string to do something, it doesn't transform the string.

It tells a *File* to do something.


writeln is an OutputRange. It takes its input from the pipeline and places it in 
a container (the screen).


Re: Fun project - faster associative array algorithm

2015-04-08 Thread Marco Leise via Digitalmars-d
Am Tue, 07 Apr 2015 19:09:15 +
schrieb Jens Bauer doc...@who.no:

 On Tuesday, 7 April 2015 at 17:25:00 UTC, Walter Bright wrote:
  The current D associative array algorithm
 
 I did a quick-scan of the source and didn't see any Bloom filter 
 there.
 I wonder if it would be best to have the Bloom filters completely 
 external or if they should be included in the associative array ?
 -Eg. the Bloom filter does require extra memory, which is not 
 always desirable.
 On the other hand, a Bloom filter could be opted in, where high 
 speed is required.

More precisely it adds a memory and time overhead, but
reduces the cost for most lookups of non-existent keys.

When you just want an associative array for known-to-exist
keys it would be a bad idea to use a Bloom filter. Opt in is
not possible with the current AA syntax as far as I can see.
Except you mean some wrapper struct as part of Phobos/druntime.

-- 
Marco



Re: Why I'm Excited about D

2015-04-08 Thread Dicebot via Digitalmars-d

On Wednesday, 8 April 2015 at 17:17:21 UTC, Walter Bright wrote:

On 4/8/2015 9:58 AM, Adam D. Ruppe wrote:
On Wednesday, 8 April 2015 at 16:51:53 UTC, Andrei 
Alexandrescu wrote:

File defines it.


Last time this came up on reddit, I explained that *this* was 
exactly why I
think string.writeln is mistaken. writeln does NOT operate 
on its string, it
doesn't tell the string to do something, it doesn't transform 
the string.


It tells a *File* to do something.


writeln is an OutputRange. It takes its input from the pipeline 
and places it in a container (the screen).


But it is actually a method of stdout file, which was what Adam 
has pointed out. Hiding it behind free function and abusing that 
fact for UFCS is just mixing semantics and, well, abuse.


Re: Why I'm Excited about D

2015-04-08 Thread Adam D. Ruppe via Digitalmars-d

On Wednesday, 8 April 2015 at 17:17:21 UTC, Walter Bright wrote:

writeln is an OutputRange.


No, it isn't. It isn't even remotely close to one - an 
OutputRange is a type, writeln is a function. isOutputRange 
doesn't even return false for it, it outright fails to compile!


File isn't an output range either btw. An output range is defined 
by the presence of a put method, which File doesn't have.


b.d(4): Error: static assert  (isOutputRange!(File, char)) is 
false



Even putting aside the formal definition of output range, output 
is NOT part of the pipeline! Pipelines can be composed and they 
keep pumping data through them. writeln does not transform its 
input nor does it forward it to the next item in the pipe. It 
just eats it.


That's totally different than everything else in the sequence. 
And that's not even bringing in writeln's sister function, 
writefln, whose first argument isn't what is to be printed at 
all! (it can show something to print but passing arbitrary 
strings to writef as the first argument is a major program bug, 
you should never do it)


Re: Vibe.Dav

2015-04-08 Thread Sönke Ludwig via Digitalmars-d-announce

Am 07.04.2015 um 22:46 schrieb Bogdan:

Hi,

Here is a library that adds web dav support to vibe.d:
https://github.com/gedaiu/vibe.dav

Right now it has good file dav support and some basic support for cal dav

Any help, improvements ideas or constructive criticism is welcome.

Thanks,
Bogdan


Nice! I'll give it a try when I get some time to set up a little private 
FileDAV server.


Re: Creating a microcontroller startup file

2015-04-08 Thread Mike via Digitalmars-d-learn

On Wednesday, 8 April 2015 at 11:17:12 UTC, Mike wrote:

On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:



Question number 2: Is it possible to change the VectorFunc to 
be a real function pointer, rather than a void* ?




I did something along these lines (modified to match your 
example) and it worked fine for me:


alias VectorFunc = void function();


[...]


@attribute(section,.isr_vector.ro)
immutable ISR[3] g_pfnVectors =
[
  Reset_Handler
, NMI_Handler
, HardFault_Handler
];



Sorry, but that code should be:

@attribute(section,.isr_vector.ro)
immutable VectorFunc[3] g_pfnVectors =
[
  Reset_Handler
, NMI_Handler
, HardFault_Handler
];




Re: Future of contract-based programming in D

2015-04-08 Thread UselessManagerine via Digitalmars-d

On Tuesday, 7 April 2015 at 12:51:45 UTC, Delirius wrote:
The D features which interest me the most are those supporting 
contract-based programming. I want to experiment with that and 
I know no other production ready  language which has this level 
of support, except the original gangsta Eiffel but the only 
supported Eiffel compiler is proprietary and and expensive.


Doesn't a OSS version exist, in paralelle auf the commerzial one ?


An input range iteration question

2015-04-08 Thread ref2401 via Digitalmars-d-learn
If Iterator is a struct then Iterator.input won't be adjusted 
properly when the foreach loop ends.

Iterator.input still holds abcde value.
If i mark Iterator as class then Iterator.input will be an empty 
string after the foreach loop.

Could anyone explain me the difference please?
Thank you.


struct Iterator {
string input;

this(string input) {
this.input = input;
}


bool empty() { return input.empty; }

dchar front() { return input.front; }

void popFront() {
if (empty) {
return;
}

input.popFront();
writeln((iterator.popFront), input);
}
}

void main(string[] args) {
Iterator iterator = Iterator(abcde);

foreach (dchar c; iterator) {
writefln(%s, c);
}

writefln((the end): %s, iterator.input);
}


  1   2   3   >