Re: Emplacement in D

2013-09-17 Thread monarch_dodra

On Monday, 16 September 2013 at 21:35:24 UTC, Nordlöw wrote:
After having read about 
http://dlang.org/phobos/std_conv.html#.emplace


I wonder: Considering the fact that D has stricter control over 
memory, couldn't the need for emplace be removed through clever 
D compiler optimization when for example adding structs at the 
end of an array and assuming its constructor is safe?


At least If all the members recursively have value semantics it 
would be obvious right? But maybe that is a corner case.


Emplace is designed for user control, when the user wants to 
emplace an object over already allocated memory. It's basically 
just for user managed memory.


Appending to an array *is* managed by the compiler (well, 
druntime to be exact), via postblit. EG: memcpy followed by 
postblit.


That said, druntime does this completly... runtime, so isn't as 
optimal as it could be, but it's something we are working on.


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread PauloPinto

On Tuesday, 17 September 2013 at 05:48:21 UTC, deadalnix wrote:

On Tuesday, 17 September 2013 at 05:32:28 UTC, Manu wrote:
In my experience, more memory == slower. If you care about 
performance, the
only time it's acceptable to use more memory is if your data 
structures are
as efficient as they can get, and the alternative is reading 
off the hard

drive.
Bandwidth isn't free, cache is only so big, and logic to 
process and make
use of so much memory isn't free either. It usually just 
suggests
inefficient (or just lazy) data structures, which often also 
implies

inefficient processing logic.
And the more memory an app uses, the higher chance of invoking 
the page

file, which is a mega-killer.



I do agree as this is generally true. However, the problem 
isn't really cache size or bandwidth, but rather latency. We 
know how to increase bandwith or cache size, but the first one 
come at a cost with no big benefit, and the second come at 
increase of cost and increase of latency. What is capping the 
perf here is really latency.


That being said, less memory == more of your working set in 
cache = faster program.



Dunno what to tell you. My VS instance is pretty light.



Yup, VS is one of these program that microsoft did better than 
the alternative :D



Yet in 2013 still doesn't do color printing with syntax 
highlight, like any MS-DOS IDE used to offer around MS-DOS 5/6 
timeframe, unless one installs third party plugins.


And the refactoring tools are a joke compared to Java IDEs, 
unless one installs a third party tool.


Even QtCreator has better C/C++ refactoring tools out of the box.


Visual Studio is a very good IDE, but in some areas it is surely 
lacking.


--
Paulo


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread dennis luehring

Am 17.09.2013 08:24, schrieb Manu:

Perhaps the only one, and also the single reason I still use Windows
(despite their best efforts to ruin it more and more with almost every
release!). There is STILL no realistic alternative for my money, well over
a decade later...
I don't get it. VS has been there a long time. It's not even perfect; farm
from it in fact. But the fact that given over a decade of solid working
example, nobody has yet managed to create a competitive product just blows
my mind...


QTCreator seems to get better and better, its fast, got features like 
VS+VisualAsssist included, easy to write plugins for, nice buildsystem


only part which is still not in (perfect) good state is the windows 
debugger integration


one of my customers is evaluating it for 1Mio LOC Projecs and ~30 
developers, try to get rid of VS-IDE, but still using the VS compiler 
and debugger as backend and tools like incredibuild + gcc environment




Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Brad Anderson

On Tuesday, 17 September 2013 at 06:24:20 UTC, Manu wrote:
On 17 September 2013 15:48, deadalnix deadal...@gmail.com 
wrote:



On Tuesday, 17 September 2013 at 05:32:28 UTC, Manu wrote:

In my experience, more memory == slower. If you care about 
performance,

the
only time it's acceptable to use more memory is if your data 
structures

are
as efficient as they can get, and the alternative is reading 
off the hard

drive.
Bandwidth isn't free, cache is only so big, and logic to 
process and make
use of so much memory isn't free either. It usually just 
suggests
inefficient (or just lazy) data structures, which often also 
implies

inefficient processing logic.
And the more memory an app uses, the higher chance of 
invoking the page

file, which is a mega-killer.


I do agree as this is generally true. However, the problem 
isn't really
cache size or bandwidth, but rather latency. We know how to 
increase
bandwith or cache size, but the first one come at a cost with 
no big
benefit, and the second come at increase of cost and increase 
of latency.

What is capping the perf here is really latency.



Latency bottlenecks are usually a function of inefficient cache 
usage, or a

working set that's too large and non-linear.

That being said, less memory == more of your working set in 
cache = faster

program.



Precisely.

 Dunno what to tell you. My VS instance is pretty light.



Yup, VS is one of these program that microsoft did better than 
the

alternative :D



Perhaps the only one, and also the single reason I still use 
Windows
(despite their best efforts to ruin it more and more with 
almost every
release!). There is STILL no realistic alternative for my 
money, well over

a decade later...
I don't get it. VS has been there a long time. It's not even 
perfect; farm
from it in fact. But the fact that given over a decade of solid 
working
example, nobody has yet managed to create a competitive product 
just blows

my mind...
Seriously, where is the competition? I probably use about 10% 
of VS's
features, but the features that I do use and rely on work, and 
work well.
Although even they could be significantly improved in some very 
simple ways.


 I closed about half my open tabs after my last email (~50 left 
open). Down

to 93mb. You must all use some heavy plugins or something.
My current solution has 10 projects, one is an entire game 
engine with

over
500 source files, hundreds of thousands of LOC. Intellisense 
info for all

of it... dunno what to tell you.
Eclipse uses more than 4 times that much memory idling with 
no project

open
at all...



4 times ? You must have a pretty light instance of eclipse !



It's a fairly fresh eclipse install, and I just boot it up. It 
showed the
home screen, no project loaded. It was doing absolutely nothing 
and well

into 400mb.
When I do use it for android and appengine, it more or less 
works well
enough, but the UI feels like it's held together with 
stickytape and glue,
and it's pretty sluggish. Debugging (native code) is slow and 
clunky. How

can I take that software seriously?
I probably waste significant portion of my life hovering and 
waiting for
eclipse to render the pop-up variable inspection windows. That 
shit needs

to be instant, no excuse. It's just showing a value from ram.
Then I press a key, it doesn't take ages for the letter to 
appear on the

screen...


Better get used to it.  The Gaben has spoken: 
http://arstechnica.com/gaming/2013/09/gabe-newell-linux-is-the-future-of-gaming-new-hardware-coming-soon/


I actually agree, my experience with full blown IDEs other than 
VS has been terrible (and I just spent all day fixing a VS 2010 
PCH corruption bug). I've always got my beloved vim to fall back 
on though.


Re: [OT] Which IDE / Editor do you use?

2013-09-17 Thread Jacob Carlborg

On 2013-09-17 01:35, Justin Whear wrote:


Do you know about C-x C-e?  If EDITOR is set to vi it should open the
current command in vi as a temp file, allow you to edit, and when you
write and quit it'll execute it.  Not sure if this is Bash only or
universal.


OMG, it works with TextMate on Mac OS X. That is so cool :)

--
/Jacob Carlborg


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Jacob Carlborg

On 2013-09-17 07:32, Manu wrote:


I closed about half my open tabs after my last email (~50 left open).
Down to 93mb. You must all use some heavy plugins or something.
My current solution has 10 projects, one is an entire game engine with
over 500 source files, hundreds of thousands of LOC. Intellisense info
for all of it... dunno what to tell you.
Eclipse uses more than 4 times that much memory idling with no project
open at all...

VS is light years better than MonoDevelop. MD is only good where VS is
not available ;)

My task manager:
http://i.imgur.com/crbUrH1.png


Are we talking virtual or physical memory? Can the operating system 
affect, Windows 7 vs 8, for example?


--
/Jacob Carlborg


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Jacob Carlborg

On 2013-09-17 05:32, Manu wrote:


I presume you mean megabytes?
Well I've been working all morning since I made that comment; I have
about 100 tabs open for editing in VS now (I don't clean up open tabs
often _), and it's sitting at 120mb.
For reference, that's considerably less than the chrome process that
hosts gmail (200mb!). About the same as the steam client which I haven't
even opened since I turned on my PC, and less than double that of
dropbox (70mb!).
I just booted eclipse, doing absolutely nothing, no projects open on the
start screen. over 410mb...
I don't know why modern software uses so much memory. But it seems
VisualStudio at ~100mb is pretty bloody good comparatively!

Dunno why you're seeing 200mb? (still less than my gmail tab...)
Perhaps you use Visual Assist or some other bulky plugins? I only have
Visual-D installed.


Opening Xcode takes 76  MB real memory (I guess that's physical memory?) 
and 324 MB virtual memory.


After opening the DMD project, indexing, downloading some doc sets, it's 
at 227 MB real memory and 420 virtual memory.


Yesterday I got a stack overflow in our Rails application and the Ruby 
instance took 4 GB real memory.


--
/Jacob Carlborg


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread growler
On Tuesday, 17 September 2013 at 06:57:04 UTC, Jacob Carlborg 
wrote:

On 2013-09-17 07:32, Manu wrote:

I closed about half my open tabs after my last email (~50 left 
open).

Down to 93mb. You must all use some heavy plugins or something.
My current solution has 10 projects, one is an entire game 
engine with
over 500 source files, hundreds of thousands of LOC. 
Intellisense info

for all of it... dunno what to tell you.
Eclipse uses more than 4 times that much memory idling with no 
project

open at all...

VS is light years better than MonoDevelop. MD is only good 
where VS is

not available ;)

My task manager:
http://i.imgur.com/crbUrH1.png


Are we talking virtual or physical memory? Can the operating 
system affect, Windows 7 vs 8, for example?


That will be the working set for the process, both virtual and 
physical, private and shared memory.




Re: Had another 48hr game jam this weekend...

2013-09-17 Thread PauloPinto
On Tuesday, 17 September 2013 at 06:39:59 UTC, Brad Anderson 
wrote:

On Tuesday, 17 September 2013 at 06:24:20 UTC, Manu wrote:
On 17 September 2013 15:48, deadalnix deadal...@gmail.com 
wrote:



On Tuesday, 17 September 2013 at 05:32:28 UTC, Manu wrote:

In my experience, more memory == slower. If you care about 
performance,

the
only time it's acceptable to use more memory is if your data 
structures

are
as efficient as they can get, and the alternative is reading 
off the hard

drive.
Bandwidth isn't free, cache is only so big, and logic to 
process and make
use of so much memory isn't free either. It usually just 
suggests
inefficient (or just lazy) data structures, which often also 
implies

inefficient processing logic.
And the more memory an app uses, the higher chance of 
invoking the page

file, which is a mega-killer.


I do agree as this is generally true. However, the problem 
isn't really
cache size or bandwidth, but rather latency. We know how to 
increase
bandwith or cache size, but the first one come at a cost with 
no big
benefit, and the second come at increase of cost and increase 
of latency.

What is capping the perf here is really latency.



Latency bottlenecks are usually a function of inefficient 
cache usage, or a

working set that's too large and non-linear.

That being said, less memory == more of your working set in 
cache = faster

program.



Precisely.

Dunno what to tell you. My VS instance is pretty light.



Yup, VS is one of these program that microsoft did better 
than the

alternative :D



Perhaps the only one, and also the single reason I still use 
Windows
(despite their best efforts to ruin it more and more with 
almost every
release!). There is STILL no realistic alternative for my 
money, well over

a decade later...
I don't get it. VS has been there a long time. It's not even 
perfect; farm
from it in fact. But the fact that given over a decade of 
solid working
example, nobody has yet managed to create a competitive 
product just blows

my mind...
Seriously, where is the competition? I probably use about 10% 
of VS's
features, but the features that I do use and rely on work, and 
work well.
Although even they could be significantly improved in some 
very simple ways.


I closed about half my open tabs after my last email (~50 left 
open). Down

to 93mb. You must all use some heavy plugins or something.
My current solution has 10 projects, one is an entire game 
engine with

over
500 source files, hundreds of thousands of LOC. Intellisense 
info for all

of it... dunno what to tell you.
Eclipse uses more than 4 times that much memory idling with 
no project

open
at all...



4 times ? You must have a pretty light instance of eclipse !



It's a fairly fresh eclipse install, and I just boot it up. It 
showed the
home screen, no project loaded. It was doing absolutely 
nothing and well

into 400mb.
When I do use it for android and appengine, it more or less 
works well
enough, but the UI feels like it's held together with 
stickytape and glue,
and it's pretty sluggish. Debugging (native code) is slow and 
clunky. How

can I take that software seriously?
I probably waste significant portion of my life hovering and 
waiting for
eclipse to render the pop-up variable inspection windows. That 
shit needs

to be instant, no excuse. It's just showing a value from ram.
Then I press a key, it doesn't take ages for the letter to 
appear on the

screen...


Better get used to it.  The Gaben has spoken: 
http://arstechnica.com/gaming/2013/09/gabe-newell-linux-is-the-future-of-gaming-new-hardware-coming-soon/


I actually agree, my experience with full blown IDEs other than 
VS has been terrible (and I just spent all day fixing a VS 2010 
PCH corruption bug). I've always got my beloved vim to fall 
back on though.




Well, they want to sell their own console, Linux based.

So of course they need to create awareness for it.

Which is good for Linux gaming in general, but like commercial 
UNIXes, unless you use the right distribution, there is nothing 
for you, because of the typical fragmentation issues.


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread deadalnix

On Tuesday, 17 September 2013 at 07:24:23 UTC, PauloPinto wrote:

Well, they want to sell their own console, Linux based.

So of course they need to create awareness for it.



Well that do make sense. Many widows OpenGL games run faster in 
wine than on windows (obviously that isn't the case for DirectX). 
And we are talking here about the windows version of the game, 
not a native linux one.


Which is good for Linux gaming in general, but like commercial 
UNIXes, unless you use the right distribution, there is nothing 
for you, because of the typical fragmentation issues.


And people are still working on new way to packages stuff. What a 
waste of everybody's time ! Meanwhile, windows do not have any 
packaging system, and that even worse :D


Re: Emplacement in D

2013-09-17 Thread Per Nordlöw

Nice!

Thx,
Per


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Dicebot

On Tuesday, 17 September 2013 at 01:18:39 UTC, Manu wrote:
What kind of quantity are we talking? My VisualStudio2010 is 
humming away
right now at 80mb with a large project open (less than i 
expected).

It's a text editor... what does it do?


I don't know what is the minimal java runtime heap amount to make 
Eclipse perfectly responsive but I usually put it to 1GB+


Debug information for enumerator values

2013-09-17 Thread Iain Buclaw

I've implemented this in gdc.

https://github.com/D-Programming-GDC/GDC/commit/021dda8feaba282fec60600729ba8abc2c64cf81


---
enum enum_byte   : byte   { kE1, kE2, kE3 }
enum enum_ubyte  : ubyte  { kE1, kE2, kE3 }
enum enum_short  : short  { kE1, kE2, kE3 }
enum enum_ushort : ushort { kE1, kE2, kE3 }
enum enum_int: int{ kE1, kE2, kE3 }
enum enum_uint   : uint   { kE1, kE2, kE3 }
enum enum_long   : long   { kE1, kE2, kE3 }
enum enum_ulong  : ulong  { kE1, kE2, kE3 }

void main()
{
  enum_byte var_byte;
  enum_ubyte var_ubyte;
  enum_short var_short;
  enum_ushort var_ushort;
  enum_int var_int;
  enum_uint var_uint;
  enum_long var_long;
  enum_ulong var_ulong;
}
---

(gdb) print var_byte
$1 = test.enum_byte.kE1

(gdb) print var_ubyte
$2 = test.enum_ubyte.kE1

(gdb) print var_short
$3 = test.enum_short.kE1

(gdb) print var_ushort
$4 = test.enum_ushort.kE1

(gdb) print var_int
$5 = test.enum_int.kE1

(gdb) print var_uint
$6 = test.enum_uint.kE1

(gdb) print var_long
$7 = test.enum_long.kE1

(gdb) print var_ulong
$8 = test.enum_ulong.kE1

(gdb) print (ulong)var_ulong
$9 = 0

(gdb) print (byte)'test.enum_uint.kE2'
$10 = 1 '\001'

(gdb) print ('test.enum_ulong')3
$11 = (test.enum_ulong.kE2 | test.enum_ulong.kE3)

(gdb) print ('test.enum_ulong')2
$12 = test.enum_ulong.kE3

(gdb) print ('test.enum_ulong')4
$13 = (unknown: 4)


What do you think?  Is module.name.member too verbose, or 
just right? :-)


Regards
Iain


Re: Debug information for enumerator values

2013-09-17 Thread Tove

On Tuesday, 17 September 2013 at 09:52:37 UTC, Iain Buclaw wrote:

(gdb) print ('test.enum_ulong')3
$11 = (test.enum_ulong.kE2 | test.enum_ulong.kE3)

(gdb) print ('test.enum_ulong')2
$12 = test.enum_ulong.kE3

What do you think?  Is module.name.member too verbose, or 
just right? :-)


Regards
Iain


Kickass! I think it's just right... _BUT_ in case of multiple 
values, I would prefer something like this:


$11 = test.enum_ulong(kE2 | kE3)


Re: Debug information for enumerator values

2013-09-17 Thread Iain Buclaw
On 17 September 2013 11:02, Tove t...@fransson.se wrote:
 On Tuesday, 17 September 2013 at 09:52:37 UTC, Iain Buclaw wrote:

 (gdb) print ('test.enum_ulong')3
 $11 = (test.enum_ulong.kE2 | test.enum_ulong.kE3)

 (gdb) print ('test.enum_ulong')2
 $12 = test.enum_ulong.kE3

 What do you think?  Is module.name.member too verbose, or just
 right? :-)

 Regards
 Iain


 Kickass! I think it's just right... _BUT_ in case of multiple values, I
 would prefer something like this:

 $11 = test.enum_ulong(kE2 | kE3)

Need to open a bug report on 'wishlist' items in gdb D support.  As I
plan to get round to hacking it sometime soon...

-- 
Iain Buclaw

*(p  e ? p++ : p) = (c  0x0f) + '0';


Re: Move VisualD to github/d-programming-language ?

2013-09-17 Thread Regan Heath
On Mon, 16 Sep 2013 15:24:42 +0100, Bruno Medeiros  
brunodomedeiros+...@gmail.com wrote:



On 09/09/2013 10:25, Regan Heath wrote:

Eclipse is dreadful.  I hate it with a passion.


Any feedback why? Bloat, sluggishness? I do hope it's not just because  
the way it used to handle refreshing of resources...


The smallest part of it is simply getting used to different hotkeys, and  
swapping back and forth between it and MSVC with a different set of  
hotkeys.  I realise this problem goes away with time, however as long as  
I have to use both, it remains an issue to some degree.


Sluggishness is an issue.

Yes, refreshing was/is a major problem .. and we're stuck on an old  
version for one of our products - due to other library dependencies.  Some  
of these comments may be related to that old version, i.e. the refresh  
problem


When you search for text in files, if the file hasn't been 'refreshed' it  
gives an error/warning, instead of just refreshing it - who thought that  
was a good idea!


Builds often fail, until you refresh, cleanup, refresh, cleanup often  
multiple times.


Build path settings seem to go missing all by themselves.

There are probably more refresh related issues but I can't recall them  
ATM.  TBH I avoid using it as much as I can, and I do less work in Java  
than C/C++ and for the latter prefer MSVC.


R

--
Using Opera's revolutionary email client: http://www.opera.com/mail/


Re: [OT] Which IDE / Editor do you use?

2013-09-17 Thread Russel Winder
On Mon, 2013-09-16 at 11:24 -0700, Walter Bright wrote:
 On 9/16/2013 8:02 AM, Jacob Carlborg wrote:
  On 2013-09-16 16:28, H. S. Teoh wrote:
 
  Which reminds me... it's probably time to make backups of $HOME again...
 
  Just push them to internet and someone will make the backups for you :)
 
 Since the taxpayers already pay for an NSA backup of all our files, I think 
 they 
 should kindly provide a restore service!

Dilbert made use of this, found himself being taken to prison…

http://dilbert.com/2013-09-06/

… but read on for the denouement.

-- 
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: Move VisualD to github/d-programming-language ?

2013-09-17 Thread Joseph Rushton Wakeling

On 16/09/13 23:39, Brad Roberts wrote:

If that's the definition of official endorsement, then sorry, not likely to ever
happen.  Demanding that the core devs develop with specific tools is ridiculous
in concept.  Would you switch because someone told you to?  Me either.  I've
been using vi(m) for about 20 years now.  My fingers know what to do without
conscious control.. I don't have the free time nor the desire to retrain myself
like that.


However, if you're a core project dev, it _can_ make sense to deliberately 
explore the usability of your code from the point of view of someone using a 
particular popular tool, even if it's not part of your day to day workflow.


It's amazing how many adoption problems can be solved simply by putting a little 
bit of effort into understanding how to make it _easy_ for people to get your 
work up and running with their habitual toolchain.


Of course it'd be wrong to demand that core devs develop with specific tools, 
but it's not at all wrong to suggest that they regularly try out alternative 
toolchains so that they have personal experience of the kinds of problems that 
users will encounter.


Re: Improved Phobos dox

2013-09-17 Thread Dicebot
On Monday, 16 September 2013 at 17:08:02 UTC, Andrei Alexandrescu 
wrote:

On 9/16/13 9:57 AM, Dicebot wrote:
On Monday, 16 September 2013 at 16:49:25 UTC, Andrei 
Alexandrescu wrote:

...


Sounds like you are exactly arguing over the concept of 
semantic web and
related tools. Which is a bit weird because it basically 
repeats the
debates from various web world articles I have been reading 
almost 5
years ago :P Maybe we should use established wisdom of people 
who are

doomed to deal with it on daily basis? :P


What is the established wisdom?

Andrei


AFAIR there has been an article about semantic web linked in this 
thread. I am not web dev myself by any means but general motto I 
hear from Internet publications on topic can be summarized as:


- HTML is for semantics, CSS is for style
- HTML should never interfere with how stuff is viewed
- HTML should be meaningful on its own, even without any CSS
- Meaning of HTML elements is standardized, not so for classes

Importance of last point is often underestimated. Screen readers 
have been already mentioned but it also applies for stuff like 
search engine robots - better HTML element selection can result 
in better search output.


template alias = parameter

2013-09-17 Thread Luís.Marques
Could you please comment on the following behaviors? Are all of 
them intended? Are they internally coherent, with respect to each 
 other?


1)
void foo(alias f)(int f)
{
writeln(f);
}

foo(42);

Error: does not match template

2)
...
foo!(42)(42);

 42

3)
...
foo!(7)(42);

 42

4)
void foo(alias f)(int g=f)
{
writeln(g);
}

foo(42);

Error: does not match template

5)
void foo(alias f=42)(int g=f)
{
writeln(g);
}

foo();

 42


Re: Move VisualD to github/d-programming-language ?

2013-09-17 Thread Bruno Medeiros

On 16/09/2013 16:33, Paulo Pinto wrote:


And bashing from people that use InteliJ, Netbeans and Eclipse,
depending on the customer?

 From these three, Eclipse is the one that always gives me more
headaches in terms of responsiveness, the workspace concept, build tools
that don't make to external build tools, loosing metadata just because
and unstable plugins.

--
Paulo


That's another discussion altogether, usually about Eclipse's Java and 
Web development tools.


--
Bruno Medeiros - Software Engineer


Re: template alias = parameter

2013-09-17 Thread Dicebot

On Tuesday, 17 September 2013 at 11:24:10 UTC, Luís Marques wrote:
Could you please comment on the following behaviors? Are all of 
them intended? Are they internally coherent, with respect to 
each

 other?


Looks fine to me.


1)
void foo(alias f)(int f)
{
writeln(f);
}

foo(42);

Error: does not match template


`alias` is never inferred so error is expected. You did not 
provide any template parameters to foo. `void foo(T)(T f)` would 
have worked because `T` can be inferred.



2)
...
foo!(42)(42);

 42


Explicit template parameter + normal parameter. Name of normal 
parameter shadows alias name (would have expected a warning/error 
here tbh).



3)
...
foo!(7)(42);

 42


Same as (2).


4)
void foo(alias f)(int g=f)
{
writeln(g);
}

foo(42);

Error: does not match template


Again, you do not provide template parameter, it can't match. 
`foo!(42)()` should have worked here.



5)
void foo(alias f=42)(int g=f)
{
writeln(g);
}

foo();

 42


Default parameters can be used everywhere so no need to provide 
any parameter explicitly.


Re: Move VisualD to github/d-programming-language ?

2013-09-17 Thread Bruno Medeiros

On 16/09/2013 22:39, Brad Roberts wrote:

On 9/16/13 8:52 AM, Bruno Medeiros wrote:

Correct me if I'm wrong, but I think Manu's point with regards with
IDE official endorsement was
more to try to have the D language organization devs (Walter, Andrei,
etc.) *use* VisualD or another
IDE and understand the issues around it (especially with regards to
compiler/debugger integration).


If that's the definition of official endorsement, then sorry, not likely
to ever happen.  Demanding that the core devs develop with specific
tools is ridiculous in concept.  Would you switch because someone told
you to?  Me either.  I've been using vi(m) for about 20 years now.  My
fingers know what to do without conscious control.. I don't have the
free time nor the desire to retrain myself like that.



I agree, I don't think it's a realistic to expect that. I was just 
pointing out Manu's idea, not agreeing with it.



Just having them make an official endorsement of an IDE, or putting
it in the DLang github, but
without actually using it much, that I'm not sure what it would
achieve. The vast majority of other
D users will just use the IDE of their choice regardless. The number
of contributors to VisualD is
likely to not change much either, I suspect.


There's value in just elevating something to the label official.
Bundling with releases.  Including on the downloads page.  Increased
discussion and awareness.  Etc.


Is that going to happen? Bundling VisualD with DMD releases? Or just 
including it in the downloads page?


--
Bruno Medeiros - Software Engineer


Re: template alias = parameter

2013-09-17 Thread Luís.Marques
Thanks. I think what is weird is that the template parameters are 
allowed to have the same name as the normal parameters, which 
confused my mental model and made me wonder what was even the 
expected behavior.


These examples came from a set of experiments where I was trying 
to do something which I expected would probably not be possible: 
make a template function generate different code 1) without 
varying the function types, 2) without explicitly instantiating 
the template using !. (this was for compatibility purposes).


Re: template alias = parameter

2013-09-17 Thread Dicebot

On Tuesday, 17 September 2013 at 11:43:24 UTC, Luís Marques wrote:
These examples came from a set of experiments where I was 
trying to do something which I expected would probably not be 
possible: make a template function generate different code 1) 
without varying the function types, 2) without explicitly 
instantiating the template using !. (this was for 
compatibility purposes).


It should not be possible as template instances with same 
template parameter list share same body in code gen.


Re: Move VisualD to github/d-programming-language ?

2013-09-17 Thread Bruno Medeiros

On 17/09/2013 12:37, Bruno Medeiros wrote:

On 16/09/2013 22:39, Brad Roberts wrote:

On 9/16/13 8:52 AM, Bruno Medeiros wrote:

Correct me if I'm wrong, but I think Manu's point with regards with
IDE official endorsement was
more to try to have the D language organization devs (Walter, Andrei,
etc.) *use* VisualD or another
IDE and understand the issues around it (especially with regards to
compiler/debugger integration).


If that's the definition of official endorsement, then sorry, not likely
to ever happen.  Demanding that the core devs develop with specific
tools is ridiculous in concept.  Would you switch because someone told
you to?  Me either.  I've been using vi(m) for about 20 years now.  My
fingers know what to do without conscious control.. I don't have the
free time nor the desire to retrain myself like that.



I agree, I don't think it's a realistic to expect that. I was just
pointing out Manu's idea, not agreeing with it.



Clarification: I think it's unrealistic to expected the core devs to use 
the IDE for all of their D development, yes. But it would be good to 
have them *try* it, to see how it works, to understand how others users 
would develop in D, what quality issues there could be with it, etc. In 
this regard I agree with Manu's comments.



--
Bruno Medeiros - Software Engineer


Re: Move VisualD to github/d-programming-language ?

2013-09-17 Thread Bruno Medeiros

On 17/09/2013 02:30, Manu wrote:

On 17 September 2013 01:52, Bruno Medeiros
brunodomedeiros+...@gmail.com mailto:brunodomedeiros+...@gmail.com
wrote:

On 13/09/2013 08:46, eles wrote:

On Saturday, 7 September 2013 at 19:05:03 UTC, Walter Bright wrote:

Recent threads here have made it pretty clear that VisualD is a
critical piece of D infrastructure. (VisualD integrated D
usage into
Microsoft Visual Studio.)


Allow me to support this idea, however to suggest that also add a
cross-platform IDE/plug-in.

This is important for the Linux world.

Current choices are DDT, for Eclipse and Mono-D, for MonoDevelop.

I would vote for the two for the time being and see how things
develop.

Official endorsement should increase their visibility, their use
and,
why not, patches.

In the future, they could also be integrated in the installer.

I would also suggest to move DDT on github (Mono-D is already
there).

All these, of course, only if respective authors agree. I kindly ask
them to provide their POV.


It's not clear to me what any of these measures would help with.

Correct me if I'm wrong, but I think Manu's point with regards with
IDE official endorsement was more to try to have the D language
organization devs (Walter, Andrei, etc.) *use* VisualD or another
IDE and understand the issues around it (especially with regards to
compiler/debugger integration).

Just having them make an official endorsement of an IDE, or
putting it in the DLang github, but without actually using it much,
that I'm not sure what it would achieve. The vast majority of other
D users will just use the IDE of their choice regardless. The number
of contributors to VisualD is likely to not change much either, I
suspect.


Well, currently the number of Visual-D contributors is exactly 1. I
don't find it that impossible to see a 2x, maybe even 3x increase in
contributors.
I think the most important point though, is that the bugs are in the
same tracker as all the rest, and in all contributors faces. Which means
all contributors, regardless of their ...orientation, will have some
sense of the health of a critically important part of the eco-system. It
also offers better data to strategy discussions and whatnot.

Remeber, this isn't about 'the vast majority of other D users'. This is
about the VAST majority who _are not yet D users_. And many of them
consider lack of VisualStudio, or maybe another full featured IDE
offering, a hands-down deal breaker. It's also a statement about the
polish/ready-ness of the language.
So I think it's in the interest of all D users to know about the health
of this part of the ecosystem if they want to see the language
succeed... which will eventually lead to abundance of libraries, and
tested frameworks that the community today is simply too small to
develop/maintain.


Maybe, maybe not. The health of this part of the ecosystem might 
become more visible, yes, but it won't necessarily mean it will get 
better. The case with DWT is a very close parallel: it got promoted as 
an official GUI toolkit, yet it didn't seem to have a visible effect on 
contributions.


But at this point I don't think it's worth guessing, we'll just have to 
wait and see.


--
Bruno Medeiros - Software Engineer


Re: template alias = parameter

2013-09-17 Thread Luís.Marques

On Tuesday, 17 September 2013 at 11:46:07 UTC, Dicebot wrote:
It should not be possible as template instances with same 
template parameter list share same body in code gen.


Well, my long shot idea was to use an alias template parameter, 
that way different values would mean different template 
parameters. But it seems I can't make the alias template 
parameter implicitly match in any way.


Re: template alias = parameter

2013-09-17 Thread Dicebot

On Tuesday, 17 September 2013 at 11:50:56 UTC, Luís Marques wrote:

On Tuesday, 17 September 2013 at 11:46:07 UTC, Dicebot wrote:
It should not be possible as template instances with same 
template parameter list share same body in code gen.


Well, my long shot idea was to use an alias template parameter, 
that way different values would mean different template 
parameters. But it seems I can't make the alias template 
parameter implicitly match in any way.


Any two different alias parameter values mean different template 
instances. Static introspection demands it:


```
auto foo(alias T)()
{
static if (is(typeof(T) : int)  (T == 42))
return true;
else
return false;
}
```


Re: template alias = parameter

2013-09-17 Thread Luís.Marques

On Tuesday, 17 September 2013 at 12:10:11 UTC, Dicebot wrote:
Any two different alias parameter values mean different 
template instances. Static introspection demands it:


```
auto foo(alias T)()
{
static if (is(typeof(T) : int)  (T == 42))
return true;
else
return false;
}
```


Yes, that's what I was saying (or trying? thanks anyway). The 
problem is that I can't get that and implicit instantiation at 
the same time.


I mean, if void foo(T)(T x) makes T=int when called with foo(42), 
I was hoping that maybe void foo(alias V)(int V) would make V=42. 
But no. Well, it was a long shot, but it was worth the try.


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread PauloPinto

On Tuesday, 17 September 2013 at 08:19:12 UTC, deadalnix wrote:

On Tuesday, 17 September 2013 at 07:24:23 UTC, PauloPinto wrote:

Well, they want to sell their own console, Linux based.

So of course they need to create awareness for it.



Well that do make sense. Many widows OpenGL games run faster in 
wine than on windows (obviously that isn't the case for 
DirectX). And we are talking here about the windows version of 
the game, not a native linux one.


Which is good for Linux gaming in general, but like commercial 
UNIXes, unless you use the right distribution, there is 
nothing for you, because of the typical fragmentation issues.


And people are still working on new way to packages stuff. What 
a waste of everybody's time ! Meanwhile, windows do not have 
any packaging system, and that even worse :D


It is called MSI, blame bad companies for still using exe 
installers.


Re: Move VisualD to github/d-programming-language ?

2013-09-17 Thread Manu
On 17 September 2013 21:48, Bruno Medeiros brunodomedeiros+...@gmail.comwrote:

 On 17/09/2013 12:37, Bruno Medeiros wrote:

 On 16/09/2013 22:39, Brad Roberts wrote:

 On 9/16/13 8:52 AM, Bruno Medeiros wrote:

 Correct me if I'm wrong, but I think Manu's point with regards with
 IDE official endorsement was
 more to try to have the D language organization devs (Walter, Andrei,
 etc.) *use* VisualD or another
 IDE and understand the issues around it (especially with regards to
 compiler/debugger integration).


 If that's the definition of official endorsement, then sorry, not likely
 to ever happen.  Demanding that the core devs develop with specific
 tools is ridiculous in concept.  Would you switch because someone told
 you to?  Me either.  I've been using vi(m) for about 20 years now.  My
 fingers know what to do without conscious control.. I don't have the
 free time nor the desire to retrain myself like that.


 I agree, I don't think it's a realistic to expect that. I was just
 pointing out Manu's idea, not agreeing with it.


 Clarification: I think it's unrealistic to expected the core devs to use
 the IDE for all of their D development, yes. But it would be good to have
 them *try* it, to see how it works, to understand how others users would
 develop in D, what quality issues there could be with it, etc. In this
 regard I agree with Manu's comments.


I'll happily wear that my assertion was heavy handed, mostly due to
long-term frustration, and to some extent, this is just the way I talk
(which never comes across in text to people who don't know me).
Regardless of how I phrased it however, I'm encouraged to see the message
was generally well received and actions have been taken. I'm keen to see
if/how it affects the ecosystem in the future.
I hope it does increase the overall attention/awareness.


(non-)extern(C) function parameter vs templates

2013-09-17 Thread Luís.Marques

This works:

extern(C) alias F = void function();
  alias G = void function();

void foo(F f) {}
void foo(G g) {}

Indeed, the correct foo is called, depending on whether the 
passed function is extern(C) or not (although I must say that the 
syntax for declaring the alias F is not good, IMO; the extern(C) 
should come after the equal sign).


Yet, the following does not work:

void foo(T)(F f) {}
void foo(G g) {}

Error: function foo conflicts with template foo(T)(F f).

or

void foo(F f) {}
void foo(T)(G g) {}

Error: template foo(T)(E e) conflicts with function foo.

It this not incoherent? If non-templated functions can overload 
on extern(C)/non-extern(C) function parameter, why can't 
templated functions?


Re: (non-)extern(C) function parameter vs templates

2013-09-17 Thread Luís.Marques

Nevermind. Lack of sleep --;;

:-)


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Bruno Medeiros

On 17/09/2013 07:24, Manu wrote:


I closed about half my open tabs after my last email (~50 left
open). Down
to 93mb. You must all use some heavy plugins or something.
My current solution has 10 projects, one is an entire game
engine with over
500 source files, hundreds of thousands of LOC. Intellisense
info for all
of it... dunno what to tell you.
Eclipse uses more than 4 times that much memory idling with no
project open
at all...


4 times ? You must have a pretty light instance of eclipse !


It's a fairly fresh eclipse install, and I just boot it up. It showed
the home screen, no project loaded. It was doing absolutely nothing and
well into 400mb.
When I do use it for android and appengine, it more or less works well
enough, but the UI feels like it's held together with stickytape and
glue, and it's pretty sluggish. Debugging (native code) is slow and
clunky. How can I take that software seriously?
I probably waste significant portion of my life hovering and waiting for
eclipse to render the pop-up variable inspection windows. That shit
needs to be instant, no excuse. It's just showing a value from ram.
Then I press a key, it doesn't take ages for the letter to appear on the
screen...


Android and Appengine?
There are two flaws in that comparison, the first is that apparently you 
are comparing an Eclipse installation with a lot more tools than your VS 
installation (which I'm guessing has only C++ tools, perhaps some VCS 
tools too?). No wonder the footprint is bigger. For example, my Eclipse 
instance with only DDT and Git installed, and opened on a workspace with 
D projects takes up 130Mb:

http://i.imgur.com/VmKzrRU.png

With the recommend JVM memory settings (see 
http://code.google.com/p/ddt/wiki/UserGuide#Eclipse_basics ), the usage 
in that startup scenario goes up to 180Mb.
But even so that is not a fair comparison, the second flaw here is that 
Eclipse is running on a VM, and is not actually using all the memory 
that is taken from the OS.


If you wanna see how much memory the Java application itself is using 
for its data structures, you have to use a tool like jconsole (included 
in the JDK) to check out JVM stats. For example, in the DDT scenario 
above, after startup the whole of Eclipse is just using just 40Mb for 
the Java heap:

http://i.imgur.com/yCPtS52.png

--
Bruno Medeiros - Software Engineer


Re: (non-)extern(C) function parameter vs templates

2013-09-17 Thread John Colvin

On Tuesday, 17 September 2013 at 13:36:24 UTC, Luís Marques wrote:

This works:

extern(C) alias F = void function();
  alias G = void function();

void foo(F f) {}
void foo(G g) {}

Indeed, the correct foo is called, depending on whether the 
passed function is extern(C) or not (although I must say that 
the syntax for declaring the alias F is not good, IMO; the 
extern(C) should come after the equal sign).


Yet, the following does not work:

void foo(T)(F f) {}
void foo(G g) {}

Error: function foo conflicts with template foo(T)(F f).

or

void foo(F f) {}
void foo(T)(G g) {}

Error: template foo(T)(E e) conflicts with function foo.

It this not incoherent? If non-templated functions can overload 
on extern(C)/non-extern(C) function parameter, why can't 
templated functions?


This works for me on dmd git master:

extern(C) alias F = void function();
alias G = void function();

void foo(T)(T g) {}
void foo(F f) {}

extern(C) void a(){}
void b(){}

void main()
{
foo(a);
foo(b);
}

It used to be that templates and normal functions couldn't 
overload each other, now they can. I'm not sure when the change 
was made, it might only be in git master.


Re: (non-)extern(C) function parameter vs templates

2013-09-17 Thread Luís.Marques

On Tuesday, 17 September 2013 at 13:50:20 UTC, John Colvin wrote:
It used to be that templates and normal functions couldn't 
overload each other, now they can. I'm not sure when the change 
was made, it might only be in git master.


Ah, OK! I said nevermind because the following works (on 2.063.2):

void foo(T)(F f) { }
void foo(T)(E e) { }

So I guess it's more subtle than that. Thanks!


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Manu
On 17 September 2013 23:46, Bruno Medeiros brunodomedeiros+...@gmail.comwrote:

 On 17/09/2013 07:24, Manu wrote:


 I closed about half my open tabs after my last email (~50 left
 open). Down
 to 93mb. You must all use some heavy plugins or something.
 My current solution has 10 projects, one is an entire game
 engine with over
 500 source files, hundreds of thousands of LOC. Intellisense
 info for all
 of it... dunno what to tell you.
 Eclipse uses more than 4 times that much memory idling with no
 project open
 at all...


 4 times ? You must have a pretty light instance of eclipse !


 It's a fairly fresh eclipse install, and I just boot it up. It showed
 the home screen, no project loaded. It was doing absolutely nothing and
 well into 400mb.
 When I do use it for android and appengine, it more or less works well
 enough, but the UI feels like it's held together with stickytape and
 glue, and it's pretty sluggish. Debugging (native code) is slow and
 clunky. How can I take that software seriously?
 I probably waste significant portion of my life hovering and waiting for
 eclipse to render the pop-up variable inspection windows. That shit
 needs to be instant, no excuse. It's just showing a value from ram.
 Then I press a key, it doesn't take ages for the letter to appear on the
 screen...


 Android and Appengine?
 There are two flaws in that comparison, the first is that apparently you
 are comparing an Eclipse installation with a lot more tools than your VS
 installation (which I'm guessing has only C++ tools, perhaps some VCS tools
 too?). No wonder the footprint is bigger. For example, my Eclipse instance
 with only DDT and Git installed, and opened on a workspace with D projects
 takes up 130Mb:
 http://i.imgur.com/VmKzrRU.png


My VS installation has VisualD, VCS tools, xbox 360, ps3, android,
emsscripten, nacl, clang and gcc tools. (I don't think these offer any
significant resource burden though, they're not really active processes)
If Eclipse has a lot more tools as you say, then it's a problem is that I
never selected them, and apparently they hog resources even when not being
used. That seems like a serious engineering fail if that's the case.
As far as I know, I don't have DDT and git installed, so you're 2 up on me
:) .. I only have android beyond default install (and no project was open).
No appengine in this installation.

With the recommend JVM memory settings (see http://code.google.com/p/ddt/**
 wiki/UserGuide#Eclipse_basicshttp://code.google.com/p/ddt/wiki/UserGuide#Eclipse_basics),
  the usage in that startup scenario goes up to 180Mb.
 But even so that is not a fair comparison, the second flaw here is that
 Eclipse is running on a VM, and is not actually using all the memory that
 is taken from the OS.


It's perfectly fair. Let's assume for a second that I couldn't care less
that it runs in a VM (I couldn't), all you're really saying is that VM's
are effectively a waste of memory and performance, and that doesn't redeem
Eclipse in any way.
You're really just suggesting that Eclipse may be inherently inefficient
because it's lynched by it's VM. So there's no salvation for it? :)

If you wanna see how much memory the Java application itself is using for
 its data structures, you have to use a tool like jconsole (included in the
 JDK) to check out JVM stats. For example, in the DDT scenario above, after
 startup the whole of Eclipse is just using just 40Mb for the Java heap:
 http://i.imgur.com/yCPtS52.png


I don't care how much memory the app is 'really' using beneath it's
overhead. All I care about is how much memory it's using (actually, I don't
really care about that at all, I only care about how it performs, which is
poorly), and the windows task manager surely offers the most fair measure
for comparison available to the OS, at least for the memory consumption
metric ;) .. The problem remains that I find eclipse significantly less
responsive, and the UI is messy and disorganised. I feel a lack of
coherency between different parts of Eclipse.
So in summary, I prefer and use VS whenever I have the option.

I had some experience with kdevelop this past weekend trying to find a
reasonable working environment on linux. It's fairly nice. Certainly come
along since I last tried to take it seriously a year or 2 back.
It would be nice if there was D support though. It has rudimentary support
that some whipped up, but it could do a lot better.

Can any linux MonoDevelop user enlighten me on how to use MonoDevelop4 on
linux? I couldn't find a package for it anywhere... only MD3. It seems
linux MD is way behind... no idea why.


Re: (non-)extern(C) function parameter vs templates

2013-09-17 Thread Luís.Marques

On Tuesday, 17 September 2013 at 13:59:05 UTC, Luís Marques wrote:

So I guess it's more subtle than that.


I meant it didn't have to do with extern(C).



Re: Had another 48hr game jam this weekend...

2013-09-17 Thread deadalnix

On Tuesday, 17 September 2013 at 12:56:56 UTC, PauloPinto wrote:
And people are still working on new way to packages stuff. 
What a waste of everybody's time ! Meanwhile, windows do not 
have any packaging system, and that even worse :D


It is called MSI, blame bad companies for still using exe 
installers.


This is only one piece of the puzzle. Ass reprositories, 
integration into windows update and all the goodies, and then we 
have something.


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Joseph Rushton Wakeling

On 17/09/13 16:19, Manu wrote:

I had some experience with kdevelop this past weekend trying to find a
reasonable working environment on linux. It's fairly nice. Certainly come along
since I last tried to take it seriously a year or 2 back.
It would be nice if there was D support though. It has rudimentary support that
some whipped up, but it could do a lot better.


Do you have any experience/opinion on Qt Creator as an IDE?  My impression is 
that it's nice in and of itself but limited compared to others in the range of 
languages/tools it supports -- but it's a very superficial impression so may be 
wrong.




Re: Had another 48hr game jam this weekend...

2013-09-17 Thread deadalnix

On Tuesday, 17 September 2013 at 14:30:12 UTC, PauloPinto wrote:

On Tuesday, 17 September 2013 at 14:26:59 UTC, deadalnix wrote:
On Tuesday, 17 September 2013 at 12:56:56 UTC, PauloPinto 
wrote:
And people are still working on new way to packages stuff. 
What a waste of everybody's time ! Meanwhile, windows do not 
have any packaging system, and that even worse :D


It is called MSI, blame bad companies for still using exe 
installers.


This is only one piece of the puzzle. Ass reprositories, 
integration into windows update and all the goodies, and then 
we have something.


http://chocolatey.org/


Nice ! A similar tool should really be integrated into windows 
and become the de facto standard.


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread PauloPinto

On Tuesday, 17 September 2013 at 14:26:59 UTC, deadalnix wrote:

On Tuesday, 17 September 2013 at 12:56:56 UTC, PauloPinto wrote:
And people are still working on new way to packages stuff. 
What a waste of everybody's time ! Meanwhile, windows do not 
have any packaging system, and that even worse :D


It is called MSI, blame bad companies for still using exe 
installers.


This is only one piece of the puzzle. Ass reprositories, 
integration into windows update and all the goodies, and then 
we have something.


http://chocolatey.org/


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread PauloPinto
On Tuesday, 17 September 2013 at 13:46:43 UTC, Bruno Medeiros 
wrote:

On 17/09/2013 07:24, Manu wrote:


   I closed about half my open tabs after my last email 
(~50 left

   open). Down
   to 93mb. You must all use some heavy plugins or 
something.
   My current solution has 10 projects, one is an entire 
game

   engine with over
   500 source files, hundreds of thousands of LOC. 
Intellisense

   info for all
   of it... dunno what to tell you.
   Eclipse uses more than 4 times that much memory idling 
with no

   project open
   at all...


   4 times ? You must have a pretty light instance of eclipse !


It's a fairly fresh eclipse install, and I just boot it up. It 
showed
the home screen, no project loaded. It was doing absolutely 
nothing and

well into 400mb.
When I do use it for android and appengine, it more or less 
works well
enough, but the UI feels like it's held together with 
stickytape and
glue, and it's pretty sluggish. Debugging (native code) is 
slow and

clunky. How can I take that software seriously?
I probably waste significant portion of my life hovering and 
waiting for
eclipse to render the pop-up variable inspection windows. That 
shit
needs to be instant, no excuse. It's just showing a value from 
ram.
Then I press a key, it doesn't take ages for the letter to 
appear on the

screen...


Android and Appengine?
There are two flaws in that comparison, the first is that 
apparently you are comparing an Eclipse installation with a lot 
more tools than your VS installation (which I'm guessing has 
only C++ tools, perhaps some VCS tools too?). No wonder the 
footprint is bigger. For example, my Eclipse instance with only 
DDT and Git installed, and opened on a workspace with D 
projects takes up 130Mb:

http://i.imgur.com/VmKzrRU.png

With the recommend JVM memory settings (see 
http://code.google.com/p/ddt/wiki/UserGuide#Eclipse_basics ), 
the usage in that startup scenario goes up to 180Mb.
But even so that is not a fair comparison, the second flaw here 
is that Eclipse is running on a VM, and is not actually using 
all the memory that is taken from the OS.


If you wanna see how much memory the Java application itself is 
using for its data structures, you have to use a tool like 
jconsole (included in the JDK) to check out JVM stats. For 
example, in the DDT scenario above, after startup the whole of 
Eclipse is just using just 40Mb for the Java heap:

http://i.imgur.com/yCPtS52.png


VS is also running in a VM as it is mostly a C# application 
nowadays, since the WPF rewrite done to 2010.


--
Paulo


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Dicebot

On Tuesday, 17 September 2013 at 14:20:03 UTC, Manu wrote:
Can any linux MonoDevelop user enlighten me on how to use 
MonoDevelop4 on
linux? I couldn't find a package for it anywhere... only MD3. 
It seems

linux MD is way behind... no idea why.


Your distro? It is 4.0.12 in Arch Linux official repository :P


Re: Move VisualD to github/d-programming-language ?

2013-09-17 Thread eles

On Monday, 16 September 2013 at 15:52:26 UTC, Bruno Medeiros
wrote:

On 13/09/2013 08:46, eles wrote:
On Saturday, 7 September 2013 at 19:05:03 UTC, Walter Bright 
wrote:

It's not clear to me what any of these measures would help with.


Glad that you answered.

It will help with:

1) people already contributing to the D chains generally use
github, so they are familiar with the workflow, the interface,
the code-review etc. This will increase the probability to
contribute with a PR, even if for small glitches (or
documentation) in the beginning (BTW me, for one, I find the
interface on code.google to be awful at best, when compared to
github).

2) people that are in the D community know about Eclipse/DDT.
However, those passing by and wondering about what the D language
means, *and* are Eclipse users, they tend to not really know
about it. Having it officially endorsed, visible on the download
page and so on, will help them in using it (and, with a bit of
chance, contributing to it).

As a sidenote: we use a lot Eclipse/CDT when working in C/C++,
but with an external Makefile. You have best of two worlds: an
IDE, and an autotools/make integration. Let's not even speak that
the Makefile itself is just a shell around scons/SConstruct.


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Bruno Medeiros

On 17/09/2013 15:19, Manu wrote:

On 17 September 2013 23:46, Bruno Medeiros
brunodomedeiros+...@gmail.com mailto:brunodomedeiros+...@gmail.com
wrote:

On 17/09/2013 07:24, Manu wrote:


 I closed about half my open tabs after my last email
(~50 left
 open). Down
 to 93mb. You must all use some heavy plugins or something.
 My current solution has 10 projects, one is an entire game
 engine with over
 500 source files, hundreds of thousands of LOC.
Intellisense
 info for all
 of it... dunno what to tell you.
 Eclipse uses more than 4 times that much memory idling
with no
 project open
 at all...


 4 times ? You must have a pretty light instance of eclipse !


It's a fairly fresh eclipse install, and I just boot it up. It
showed
the home screen, no project loaded. It was doing absolutely
nothing and
well into 400mb.
When I do use it for android and appengine, it more or less
works well
enough, but the UI feels like it's held together with stickytape and
glue, and it's pretty sluggish. Debugging (native code) is slow and
clunky. How can I take that software seriously?
I probably waste significant portion of my life hovering and
waiting for
eclipse to render the pop-up variable inspection windows. That shit
needs to be instant, no excuse. It's just showing a value from ram.
Then I press a key, it doesn't take ages for the letter to
appear on the
screen...


Android and Appengine?
There are two flaws in that comparison, the first is that apparently
you are comparing an Eclipse installation with a lot more tools than
your VS installation (which I'm guessing has only C++ tools, perhaps
some VCS tools too?). No wonder the footprint is bigger. For
example, my Eclipse instance with only DDT and Git installed, and
opened on a workspace with D projects takes up 130Mb:
http://i.imgur..com/VmKzrRU.png http://i.imgur.com/VmKzrRU.png


My VS installation has VisualD, VCS tools, xbox 360, ps3, android,
emsscripten, nacl, clang and gcc tools. (I don't think these offer any
significant resource burden though, they're not really active processes)
If Eclipse has a lot more tools as you say, then it's a problem is that
I never selected them, and apparently they hog resources even when not
being used. That seems like a serious engineering fail if that's the case.
As far as I know, I don't have DDT and git installed, so you're 2 up on
me :) .. I only have android beyond default install (and no project was
open). No appengine in this installation.



Eclipse is designed such that plugins should be lazy-loaded: they are 
only loaded when needed (for example if you open a 
view/editor/preference-page/project, etc., contributed from a plugin). 
But that requires the plugin to be well-behaved in that regards, and 
some plugins might not be so.
I'm not familiar at all with the Eclipse Android plugins or AppEngine 
plugins so I have no idea how these behave performance wise. I can't 
comment on that. Again it should noted that Eclipse is not a monolithic 
application, and a lot of things are going to depend on what 
plugins/tools you have installed. (neither is VisualStudio a monolithic 
application, but I would argue that Eclipse has more plugins and 
extensions available, and thus more variation in setup and quality of 
installations)




With the recommend JVM memory settings (see
http://code.google.com/p/ddt/__wiki/UserGuide#Eclipse_basics
http://code.google.com/p/ddt/wiki/UserGuide#Eclipse_basics ), the
usage in that startup scenario goes up to 180Mb.
But even so that is not a fair comparison, the second flaw here is
that Eclipse is running on a VM, and is not actually using all the
memory that is taken from the OS.


It's perfectly fair. Let's assume for a second that I couldn't care less
that it runs in a VM (I couldn't), all you're really saying is that VM's
are effectively a waste of memory and performance, and that doesn't
redeem Eclipse in any way.
You're really just suggesting that Eclipse may be inherently inefficient
because it's lynched by it's VM. So there's no salvation for it? :)

If you wanna see how much memory the Java application itself is
using for its data structures, you have to use a tool like jconsole
(included in the JDK) to check out JVM stats. For example, in the
DDT scenario above, after startup the whole of Eclipse is just using
just 40Mb for the Java heap:
http://i.imgur..com/yCPtS52.png http://i.imgur.com/yCPtS52.png


I don't care how much memory the app is 'really' using beneath it's
overhead. All I care about is how much memory it's using (actually, I
don't really care 

Is std.decimal dead?

2013-09-17 Thread ilya-stromberg

I asked about a library with high-precision doubles 3 weeks ago.

Now I find std.decimal module at the Review Queue page:
https://github.com/andersonpd/decimal

The author is Paul D. Anderson. Last commit was 4 months ago.

It's interesting to know a current project state.


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Bruno Medeiros

On 17/09/2013 15:33, PauloPinto wrote:

On Tuesday, 17 September 2013 at 13:46:43 UTC, Bruno Medeiros wrote:

On 17/09/2013 07:24, Manu wrote:


   I closed about half my open tabs after my last email (~50 left
   open). Down
   to 93mb. You must all use some heavy plugins or something.
   My current solution has 10 projects, one is an entire game
   engine with over
   500 source files, hundreds of thousands of LOC. Intellisense
   info for all
   of it... dunno what to tell you.
   Eclipse uses more than 4 times that much memory idling with no
   project open
   at all...


   4 times ? You must have a pretty light instance of eclipse !


It's a fairly fresh eclipse install, and I just boot it up. It showed
the home screen, no project loaded. It was doing absolutely nothing and
well into 400mb.
When I do use it for android and appengine, it more or less works well
enough, but the UI feels like it's held together with stickytape and
glue, and it's pretty sluggish. Debugging (native code) is slow and
clunky. How can I take that software seriously?
I probably waste significant portion of my life hovering and waiting for
eclipse to render the pop-up variable inspection windows. That shit
needs to be instant, no excuse. It's just showing a value from ram.
Then I press a key, it doesn't take ages for the letter to appear on the
screen...


Android and Appengine?
There are two flaws in that comparison, the first is that apparently
you are comparing an Eclipse installation with a lot more tools than
your VS installation (which I'm guessing has only C++ tools, perhaps
some VCS tools too?). No wonder the footprint is bigger. For example,
my Eclipse instance with only DDT and Git installed, and opened on a
workspace with D projects takes up 130Mb:
http://i.imgur.com/VmKzrRU.png

With the recommend JVM memory settings (see
http://code.google.com/p/ddt/wiki/UserGuide#Eclipse_basics ), the
usage in that startup scenario goes up to 180Mb.
But even so that is not a fair comparison, the second flaw here is
that Eclipse is running on a VM, and is not actually using all the
memory that is taken from the OS.

If you wanna see how much memory the Java application itself is using
for its data structures, you have to use a tool like jconsole
(included in the JDK) to check out JVM stats. For example, in the DDT
scenario above, after startup the whole of Eclipse is just using just
40Mb for the Java heap:
http://i.imgur.com/yCPtS52.png


VS is also running in a VM as it is mostly a C# application nowadays,
since the WPF rewrite done to 2010.

--
Paulo


That point was not so much that it is running on a VM, but that the 
actual memory in use is much less than the memory taken from the OS. 
(the same thing could happen on a non-VM process)



--
Bruno Medeiros - Software Engineer


Re: Move VisualD to github/d-programming-language ?

2013-09-17 Thread Bruno Medeiros

On 17/09/2013 15:48, eles wrote:

On Monday, 16 September 2013 at 15:52:26 UTC, Bruno Medeiros
wrote:

On 13/09/2013 08:46, eles wrote:

On Saturday, 7 September 2013 at 19:05:03 UTC, Walter Bright wrote:

It's not clear to me what any of these measures would help with.


Glad that you answered.

It will help with:

1) people already contributing to the D chains generally use
github, so they are familiar with the workflow, the interface,
the code-review etc. This will increase the probability to
contribute with a PR, even if for small glitches (or
documentation) in the beginning (BTW me, for one, I find the
interface on code.google to be awful at best, when compared to
github).



This is more of an issue of project hosting than whether it's officially 
endorsed/listed or not. I could move the hosting of DDT from Google Code 
to Github and potentially reap some of those benefits, regardless of 
DLang endorsement or not. (In hindsight I do agree it might have been 
better to have it hosted on Github. Google Code seems to have stagnated 
a bit while Github is getting more popular and getting better - but 
things were different when I switched away from DSource.org)



--
Bruno Medeiros - Software Engineer


Re: Debug information for enumerator values

2013-09-17 Thread Iain Buclaw
On 17 September 2013 10:52, Iain Buclaw ibuc...@ubuntu.com wrote:
 I've implemented this in gdc.

 https://github.com/D-Programming-GDC/GDC/commit/021dda8feaba282fec60600729ba8abc2c64cf81



Now done the same for manifest constants.

https://github.com/D-Programming-GDC/GDC/commit/6b40c481068530374abb0819b80c7d2ef09072fd


---
enum A { a = 42, b = 45 }
enum foo = A.a;

void main()
{
  enum bar = A.b;
  enum baz = main;
  return;
}
--

(gdb) print 'test.foo'
$1 = enum.A.a

(gdb) print bar
$2 = enum.A.b

(gdb) print baz
$3 = (void (* const)(void)) 0x402a00 D main

(gdb) p (int)bar
$4 = 45

Note that these values are purely in the debug code only - they are
not addressable in memory, and are not emitted in non-debug object
files/binaries - meaning there is no bloat added.

(gdb) p 'test.foo'
Can't take address of test.foo which isn't an lvalue.

(gdb) p baz
Can't take address of baz which isn't an lvalue.


Hope this helps those who use CTFE a lot. ;-)

-- 
Iain Buclaw

*(p  e ? p++ : p) = (c  0x0f) + '0';


Re: std.d.lexer: pre-voting review / discussion

2013-09-17 Thread Dicebot

Discussion has slowed down and thread is fading away.

I personally have not noticed any crucial objections (ones that 
can't be figured out during normal pull request review process). 
Brian, what is your state on this? Is there something you want to 
add/change before the voting gets initiated?


Re: [OT] Which IDE / Editor do you use?

2013-09-17 Thread H. S. Teoh
On Tue, Sep 17, 2013 at 04:25:50AM +0200, Adam D. Ruppe wrote:
 On Tuesday, 17 September 2013 at 01:59:42 UTC, H. S. Teoh wrote:
[...]
 Heh. I was on the other extreme... I reinvented everything from
 the square wheel to the triangular peg in the round hole.
 
 Oh, I've done my share of that too, but my lines were so slow and
 Bresenham's algorithm was so fast, so I had to make the switch!

I never got that far. :-P


 How would you intermix it with character data, though?
 
 If you have a reliable connection it isn't too bad. You can either
 define anything outside a struct to be character info or you can
 have an INPUT_TYPE_CHAR struct that showsit.

Actually, that gives me an idea. What if, instead of defaulting to
character data, the terminal input stream defaults to control
structures? That is, you're sending structs by default. Character data
would then be represented as a length followed by the data, and the
length would be chosen based on how much data is currently available.
So, say we use a single byte for length, then we can reserve lengths
with the high bit set to non-character control data, and values from
0-127 indicates how many subsequent data bytes follow.  Of course, a 0
length is kinda useless, but perhaps could be used for EOF or other such
indications. This lets us send up to 127 bytes of data (128 including
the length) per message, which should minimize the overhead of
defaulting to control mode instead of pure data mode.


 That's the problem with the Unix design. The control stream and
 the data stream is intermixed, which is the source of much of the
 headaches in terminal handling.
 
 Yup. I've thought before about doing up to five standard streams:
 
 1) system control in, the event stream
 2) user control in, a character stream
 3) standard file in, a plain file. might be user control or might be
 another file
 4) standard file out, might be the terminal or might be a file
 5) interactive output, the terminal.
 
 The #3 and #4 are different from unix stdin/out because they aren't
 necessarily the terminal. Suppose you want to edit a temporary file.
 You can'd do
 
 echo initial data | vi
 
 since that would be considered user input and be interpreted by vi
 as a command. So what you end up doing is something like this
 
 echo initial data  /tmp/filexxx
 vi /tmp/filexxx
 
 And ditto on output, you'd tell vi to write to the tmpfile since
 redirecting stdout would screw up the user interactivity.

I'm not sure what the bash syntax is, but couldn't you just pipe echo
to, say, fd 3 (altin?)? Assuming that vim is changed to understand that,
of course. If this convention becomes widely adopted, then it would
effectively become non-terminal input.  Similarly, fd 4 could be used
as altout, for non-terminal output.

As a transition, programs could check if fd 3 and fd 4 are valid fd's;
if they are, then assume the shell (or whatever invoked the process)
knows about altin/altout and wants to send data along those channels,
and adapt accordingly.


 So the other files let you just set up pipes easily without
 necessarily hijacking the interactivity.

Yep. Though I think nowadays some programs already check whether
stdin/stdout is hooked up to a terminal (IIRC using one of those obscure
ioctl calls). I know for sure pagers like 'less' do it: if stdout is a
non-terminal, it simply pipes the data through without attempting to
page.


 But, overall, I think unix does a pretty ok in this department - the
 system is simple, maybe too simple, but it gets the job done.

Yeah, adding more stuff to it makes sense but may introduce a lot more
complexity.


[...]
 Well, ranges are one of D's big selling points, aren't they?
 
 tbh I'm kinda meh on them. When they're great, they're great, but
 otherwise eh, no need to force them in when it isn't necessary.

I know. :) I was half-kidding.


 BTW I did a lot of snippage here since I generally agree, but the
 big fun is I just spent the last half hour playing with the idea of
 doing my own terminal emulator again.
 
 And you know, that might not be so hard. In just this short time, I
 got it started: in about 100 lines with simpledisplay.d and
 eventloop.d as helper libraries, I have it running a basic shell.
 The hard part is still coming: all the escape sequence nonsense, but
 that's kinda additive, I can just do each one as I come to them,
 making it more or less xterm compatible but just enough for the
 programs I use then start doing extensions!

Cool!


 Most the work is actually done by forkpty() apparently. It even
 handles echo automatically and I think it does line buffering too,
 I'll know more as I play with it. And of course, simpledisplay.d
 already does a lot of messy Xlib stuff and input events so this
 might not be that hard at all.
 
 ...until I get to the issue of utf8 font output lol.

Haha, yeah. If I were doing it, I'd say just do .ttf output from the
get-go, render it as an image, whatever, just don't even bother with the

Re: std.d.lexer: pre-voting review / discussion

2013-09-17 Thread Dicebot

On Tuesday, 17 September 2013 at 16:34:01 UTC, deadalnix wrote:

On Tuesday, 17 September 2013 at 15:31:00 UTC, Dicebot wrote:

Discussion has slowed down and thread is fading away.

I personally have not noticed any crucial objections (ones 
that can't be figured out during normal pull request review 
process). Brian, what is your state on this? Is there 
something you want to add/change before the voting gets 
initiated?


I had some comments that nobody addressed. Mostly about firing 
several instances of the lexer with the same identifier pool.


Well, I suppose only Brian can address it :) I am only checking 
if there are no commonly repeated objections that are likely to 
ruin the voting. There are plenty of comments of course and I 
would recommend Brian to at least make some statement about those 
before voting but that is his call.


There is a possibility to mention one issue as a blocker when 
voting though, that will be taken into consideration when 
counting actual votes.


Re: std.logger

2013-09-17 Thread Jose A Garcia Sancio

On Friday, 23 August 2013 at 20:11:38 UTC, H. S. Teoh wrote:
On Fri, Aug 23, 2013 at 12:41:45PM -0700, Andrei Alexandrescu 
wrote:

[...]

(Just hanging this to a random comment in this thread.) I think
there's some pretty good work on logging by myself and another
poster (Jose?) that has since gone abandoned. It included some 
nice

approach to conditional logging and had both compile-time and
run-time configurability.

[...]

Where's the code?


T


The code is here: 
https://github.com/jsancio/log.d/blob/master/src/log.d


For what it is worth, there was a lot of thought and effort that 
was put into the design, implementation and testing of it. If you 
are interested in the design goals of the std.log library then my 
recommendation is to learn about glog 
(http://google-glog.googlecode.com/svn/trunk/doc/glog.html). If 
the community decides that they like those design principles then 
I highly recommend you continue where std.log left off.


Thanks,
-Jose


Re: std.d.lexer: pre-voting review / discussion

2013-09-17 Thread deadalnix

On Tuesday, 17 September 2013 at 15:31:00 UTC, Dicebot wrote:

Discussion has slowed down and thread is fading away.

I personally have not noticed any crucial objections (ones that 
can't be figured out during normal pull request review 
process). Brian, what is your state on this? Is there something 
you want to add/change before the voting gets initiated?


I had some comments that nobody addressed. Mostly about firing 
several instances of the lexer with the same identifier pool.


Re: Improved Phobos dox

2013-09-17 Thread Andrei Alexandrescu
(After traveling on Sunday and Monday, and after wondering why people 
still argue with me after I'd sent the message below, I opened my laptop 
to find it, still unsent, in Drafts. I must have forgotten to send it, 
or sending failed... sorry.)


On 9/16/13 10:07 AM, H. S. Teoh wrote:

I can attest to that. I'm on another mailing list where one of the list
members is sight-impaired, and she complains about how some websites
(i.e. those that suffer from heavy divitis and spanitis) simply can't be
read in any sane way by the screen reader. Using built-in semantic tags
like dl can make a world of difference for these users, since the
screen reader has no idea what class=d_decl means, but it *does* know
what dl means. I wouldn't be so quick to dismiss it.


OK, I think this is a solid argument (Adam also made it but I hadn't 
grokked it).


So the idea here is that the specific HTML attributes do have meaning to 
the renderer that are difficult or impossible to specify in, or infer 
from, the stylesheet. A google search for divitis spanitis destroyed my 
former opinion.



Andrei




Valve developing a new Linux debugger - Good news for D?

2013-09-17 Thread Gary Willoughby
Gabe Newell recently stated that Valve are currently developing a 
new debugger for Linux in addition to helping out with LLDB. 
Hopefully this will be good news for D as currently the options 
are very limited regarding debuggers. I'm hoping it has a nice 
GUI offering... we shall see.


Comments at 18:20

https://www.youtube.com/watch?v=Gzn6E2m3otg#t=18m20s


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Arjan
On Tue, 17 Sep 2013 17:15:12 +0200, Bruno Medeiros  
brunodomedeiros+...@gmail.com wrote:


That said, I do agree that Eclipse is generally slower than Visual  
Studio. Eclipse (and most existing plugins) are almost entirely  
Java-based, which has some JIT and GC overheards. Whereas VS is done in  
C++ and C# (I'm guessing a lot of critical bits are developed in C++, at  
least for VS2010).
But I don't think Eclipse is as bad or as slow as a lot of people make  
it appear to be. And better functionality would make up for it, for sure.


+1

It is slower, but IMO not unbearable slower.


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread John Colvin

On Tuesday, 17 September 2013 at 14:20:03 UTC, Manu wrote:
On 17 September 2013 23:46, Bruno Medeiros 
brunodomedeiros+...@gmail.comwrote:



On 17/09/2013 07:24, Manu wrote:



I closed about half my open tabs after my last email 
(~50 left

open). Down
to 93mb. You must all use some heavy plugins or 
something.
My current solution has 10 projects, one is an entire 
game

engine with over
500 source files, hundreds of thousands of LOC. 
Intellisense

info for all
of it... dunno what to tell you.
Eclipse uses more than 4 times that much memory 
idling with no

project open
at all...


4 times ? You must have a pretty light instance of 
eclipse !



It's a fairly fresh eclipse install, and I just boot it up. 
It showed
the home screen, no project loaded. It was doing absolutely 
nothing and

well into 400mb.
When I do use it for android and appengine, it more or less 
works well
enough, but the UI feels like it's held together with 
stickytape and
glue, and it's pretty sluggish. Debugging (native code) is 
slow and

clunky. How can I take that software seriously?
I probably waste significant portion of my life hovering and 
waiting for
eclipse to render the pop-up variable inspection windows. 
That shit
needs to be instant, no excuse. It's just showing a value 
from ram.
Then I press a key, it doesn't take ages for the letter to 
appear on the

screen...



Android and Appengine?
There are two flaws in that comparison, the first is that 
apparently you
are comparing an Eclipse installation with a lot more tools 
than your VS
installation (which I'm guessing has only C++ tools, perhaps 
some VCS tools
too?). No wonder the footprint is bigger. For example, my 
Eclipse instance
with only DDT and Git installed, and opened on a workspace 
with D projects

takes up 130Mb:
http://i.imgur.com/VmKzrRU.png



My VS installation has VisualD, VCS tools, xbox 360, ps3, 
android,
emsscripten, nacl, clang and gcc tools. (I don't think these 
offer any
significant resource burden though, they're not really active 
processes)
If Eclipse has a lot more tools as you say, then it's a problem 
is that I
never selected them, and apparently they hog resources even 
when not being
used. That seems like a serious engineering fail if that's the 
case.
As far as I know, I don't have DDT and git installed, so you're 
2 up on me
:) .. I only have android beyond default install (and no 
project was open).

No appengine in this installation.

With the recommend JVM memory settings (see 
http://code.google.com/p/ddt/**
wiki/UserGuide#Eclipse_basicshttp://code.google.com/p/ddt/wiki/UserGuide#Eclipse_basics), 
the usage in that startup scenario goes up to 180Mb.
But even so that is not a fair comparison, the second flaw 
here is that
Eclipse is running on a VM, and is not actually using all the 
memory that

is taken from the OS.



It's perfectly fair. Let's assume for a second that I couldn't 
care less
that it runs in a VM (I couldn't), all you're really saying is 
that VM's
are effectively a waste of memory and performance, and that 
doesn't redeem

Eclipse in any way.
You're really just suggesting that Eclipse may be inherently 
inefficient
because it's lynched by it's VM. So there's no salvation for 
it? :)


If you wanna see how much memory the Java application itself is 
using for
its data structures, you have to use a tool like jconsole 
(included in the
JDK) to check out JVM stats. For example, in the DDT scenario 
above, after
startup the whole of Eclipse is just using just 40Mb for the 
Java heap:

http://i.imgur.com/yCPtS52.png



I don't care how much memory the app is 'really' using beneath 
it's
overhead. All I care about is how much memory it's using 
(actually, I don't
really care about that at all, I only care about how it 
performs, which is
poorly), and the windows task manager surely offers the most 
fair measure
for comparison available to the OS, at least for the memory 
consumption
metric ;) .. The problem remains that I find eclipse 
significantly less
responsive, and the UI is messy and disorganised. I feel a lack 
of

coherency between different parts of Eclipse.
So in summary, I prefer and use VS whenever I have the option.

I had some experience with kdevelop this past weekend trying to 
find a
reasonable working environment on linux. It's fairly nice. 
Certainly come

along since I last tried to take it seriously a year or 2 back.
It would be nice if there was D support though. It has 
rudimentary support

that some whipped up, but it could do a lot better.

Can any linux MonoDevelop user enlighten me on how to use 
MonoDevelop4 on
linux? I couldn't find a package for it anywhere... only MD3. 
It seems

linux MD is way behind... no idea why.


If you're on some sort of ubuntu variant: 
https://launchpad.net/~keks9n/+archive/monodevelop-latest


Re: symbol suggestion algorithm goes a bit awry

2013-09-17 Thread H. S. Teoh
On Tue, Sep 17, 2013 at 09:02:43PM +0200, digitalmars-d-boun...@puremagic.com 
wrote:
 Maybe we should tweak the symbol suggestion algorithm :-)
 
 extern(C) void f();
 
 void main()
 {
 f();
 }
 
 $ dmd test.d (v2.063.2)
 Undefined symbols for architecture x86_64:
   _f, referenced from:
   __Dmain in test.o
  (maybe you meant: _D17src/object_.d.80815__unittest_failFiZv,
 _D17src/object_.d.81315__unittest_failFiZv ,
 _D2rt3aaA15__unittest_failFiZv ,
[...]

Heh, that's funny.

Please file a bug at: http://d.puremagic.com/issues/

:)


T

-- 
Why are you blatanly misspelling blatant? -- Branden Robinson


symbol suggestion algorithm goes a bit awry

2013-09-17 Thread Luís.Marques

Maybe we should tweak the symbol suggestion algorithm :-)

extern(C) void f();

void main()
{
f();
}

$ dmd test.d (v2.063.2)
Undefined symbols for architecture x86_64:
  _f, referenced from:
  __Dmain in test.o
 (maybe you meant: 
_D17src/object_.d.80815__unittest_failFiZv, 
_D17src/object_.d.81315__unittest_failFiZv , 
_D2rt3aaA15__unittest_failFiZv , 
_D17src/object_.d.81415__unittest_failFiZv , 
_D17src/object_.d.80915__unittest_failFiZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f4swapMxFNaNbNePvPvZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f5tsizeMxFNaNbNdNeZm , 
_D2rt8typeinfo8ti_float10TypeInfo_f7getHashMxFNaNbNexPvZm , 
_D10TypeInfo_f7__ClassZ , 
_D2rt8typeinfo8ti_float10TypeInfo_f7_equalsFNaNbNeffZb , 
_D16src/object_.d.9815__unittest_failFiZv , 
_D33../druntime/import/object.di.218515__unittest_failFiZv , 
_D16src/object_.d.9715__unittest_failFiZv , 
_D6object19MemberInfo_function6__ctorMFAyaC8TypeInfoPvkZC6object19MemberInfo_function 
, _D6object19MemberInfo_function5flagsMFNaNbNdZk , 
_D6object19MemberInfo_function2fpMFNaNbNdZPv , 
_D6object19MemberInfo_function4nameMFNaNbNdZAya , 
_D6object19MemberInfo_function6__initZ , 
_D6object16MemberInfo_field6__ctorMFAyaC8TypeInfomZC6object16MemberInfo_field 
, _D6object16MemberInfo_field4nameMFNaNbNdZAya , 
_D4core7runtime19defaultTraceHandlerFPvZC6object9Throwable9TraceInfo16DefaultTraceInfo8toStringMxFZAya16__foreachbody353MFNfKmKxAaZi 
, _D3std7complex15__unittest_failFiZv , 
_D16src/object_.d.9515__unittest_failFiZv , 
_D2gc3gcx15__unittest_failFiZv , _D2gc3gcx3Gcx8log_freeMFPvZv , 
_rt_finalize2 , _D17src/object_.d.81215__unittest_failFiZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f8toStringMxFNaNbNeZAya , 
_D4core4time15__unittest_failFiZv , 
_D6object19MemberInfo_function8typeInfoMFNaNbNdZC8TypeInfo , 
_D6object15__unittest_failFiZv , 
_D6object16MemberInfo_field6__initZ , _D10TypeInfo_f6__initZ , 
_D3std8internal7uni_tab15__unittest_failFiZv , 
_D3std8internal3uni15__unittest_failFiZv , 
_D3std7numeric15__unittest_failFiZv , 
_D2rt9critical_15__unittest_failFiZv , 
_D2rt8monitor_15__unittest_failFiZv , 
_D6object16MemberInfo_field6__vtblZ , 
_D2gc2gc15__unittest_failFiZv , 
_D2rt4deh213__eh_finddataFPvZPyS2rt4deh29FuncTable16__foreachbody509MFKS2rt12sections_osx12SectionGroupZi 
, _D2rt4util9container15__unittest_failFiZv , 
_D4core6thread15__unittest_failFiZv , 
_D4core7runtime15__unittest_failFiZv , 
_D16src/object_.d.9315__unittest_failFiZv , 
_D18src/object_.d.121815__unittest_failFiZv , 
_D16src/object_.d.8315__unittest_failFiZv , 
_D2rt5minfo16rt_moduleTlsCtorUZv16__foreachbody544MFKS2rt12sections_osx12SectionGroupZi 
, 
_D2rt5minfo13rt_moduleDtorUZv16__foreachbody546MFKS2rt12sections_osx12SectionGroupZi 
, _D4core9exception15__unittest_failFiZv , 
_D3std9container15__unittest_failFiZv , 
_D6object19MemberInfo_function7__ClassZ , _D10TypeInfo_f6__vtblZ 
, _D3std5regex15__unittest_failFiZv , 
_D6object19MemberInfo_function6__vtblZ , 
_D6object16MemberInfo_field8typeInfoMFNaNbNdZC8TypeInfo , 
_D2rt6memory16initStaticDataGCFZv16__foreachbody518MFKS2rt12sections_osx12SectionGroupZi 
, 
_D2rt5minfo17moduleinfos_applyFMDFKPS6object10ModuleInfoZiZi16__foreachbody540MFKS2rt12sections_osx12SectionGroupZi 
, _D2rt4util7console15__unittest_failFiZv , 
_D16src/object_.d.8915__unittest_failFiZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f4initMxFNaNbNeZAxv1ryf , 
_D3std5array15__unittest_failFiZv , 
_D3std9exception15__unittest_failFiZv , 
_D3std6traits15__unittest_failFiZv , 
_D16src/object_.d.5215__unittest_failFiZv , 
_D4core6thread14thread_joinAllUZv16__foreachbody370MFKC4core6thread6ThreadZi 
, _D3std6format15__unittest_failFiZv , 
_D6object16MemberInfo_field6offsetMFNaNbNdZm , 
_D3std5ascii15__unittest_failFiZv , 
_D2rt5minfo13rt_moduleCtorUZv16__foreachbody543MFKS2rt12sections_osx12SectionGroupZi 
, 
_D3std8internal7uni_tab48unicodeInCombining_Diacritical_Marks_for_SymbolsyS3std8internal3uni12CodepointSet 
, _D17src/object_.d.21615__unittest_failFiZv , 
_D2rt5tlsgc15__unittest_failFiZv , _gc_free , 
_D3std9typetuple15__unittest_failFiZv , 
_D3std9stdiobase15__unittest_failFiZv , 
_D3std8typecons15__unittest_failFiZv , 
_D3std6string15__unittest_failFiZv , 
_D3std4math15__unittest_failFiZv , 
_D3std10functional15__unittest_failFiZv , 
_D16src/object_.d.8615__unittest_failFiZv , 
_D18src/object_.d.122215__unittest_failFiZv , 
_D2rt4deh213__eh_finddataFPvPyS2rt4deh29FuncTablePyS2rt4deh29FuncTableZPyS2rt4deh29FuncTable 
, _D18src/object_.d.133515__unittest_failFiZv , 
_D20std/exception.d.142715__unittest_failFiZv , 
_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZi7tryExecMFMDFZvZv14printInfoBlockMFC6object9ThrowableZv16__foreachbody514MFKxAaZi 
, _D2rt8lifetime15__unittest_failFiZv , 
_D3std8bitmanip15__unittest_failFiZv , 
_D2rt8typeinfo8ti_float10TypeInfo_f8_compareFNaNbNeffZi , 
_D3std3utf15__unittest_failFiZv , 
_D2rt12sections_osx12SectionGroup11__fieldDtorMFZv , 
_D6object16MemberInfo_field7__ClassZ , 
_D3std4conv15__unittest_failFiZv , 

Re: symbol suggestion algorithm goes a bit awry

2013-09-17 Thread Walter Bright

On 9/17/2013 12:08 PM, H. S. Teoh wrote:

Please file a bug at: http://d.puremagic.com/issues/


That isn't going to help, as the clang linker devs don't look there.



Re: symbol suggestion algorithm goes a bit awry

2013-09-17 Thread Vladimir Panteleev

On Tuesday, 17 September 2013 at 19:02:44 UTC, Luís Marques wrote:

Maybe we should tweak the symbol suggestion algorithm :-)


That looks like linker output, and thus not a problem with the D 
toolchain. I guess that the linker you're using also has a 
suggestion feature. A quick Google tells me you're using a Mac?


Re: std.d.lexer: pre-voting review / discussion

2013-09-17 Thread Brian Schott

On Tuesday, 17 September 2013 at 16:48:44 UTC, Dicebot wrote:

On Tuesday, 17 September 2013 at 16:34:01 UTC, deadalnix wrote:

On Tuesday, 17 September 2013 at 15:31:00 UTC, Dicebot wrote:

Discussion has slowed down and thread is fading away.

I personally have not noticed any crucial objections (ones 
that can't be figured out during normal pull request review 
process). Brian, what is your state on this? Is there 
something you want to add/change before the voting gets 
initiated?


I had some comments that nobody addressed. Mostly about firing 
several instances of the lexer with the same identifier pool.


Well, I suppose only Brian can address it :) I am only checking 
if there are no commonly repeated objections that are likely to 
ruin the voting. There are plenty of comments of course and I 
would recommend Brian to at least make some statement about 
those before voting but that is his call.


There is a possibility to mention one issue as a blocker when 
voting though, that will be taken into consideration when 
counting actual votes.


I've been busy with things that aren't D-related recently, but I 
should have time the rest of this week to address the lexer.


Re: symbol suggestion algorithm goes a bit awry

2013-09-17 Thread Maxim Fomin

On Tuesday, 17 September 2013 at 19:09:22 UTC, H. S. Teoh wrote:
On Tue, Sep 17, 2013 at 09:02:43PM +0200, 
digitalmars-d-boun...@puremagic.com wrote:

Maybe we should tweak the symbol suggestion algorithm :-)

extern(C) void f();

void main()
{
f();
}

$ dmd test.d (v2.063.2)
Undefined symbols for architecture x86_64:
  _f, referenced from:
  __Dmain in test.o
 (maybe you meant: 
_D17src/object_.d.80815__unittest_failFiZv,

_D17src/object_.d.81315__unittest_failFiZv ,
_D2rt3aaA15__unittest_failFiZv ,

[...]

Heh, that's funny.

Please file a bug at: http://d.puremagic.com/issues/

:)


T


LOL. The question is as funny as the answer is.


Re: symbol suggestion algorithm goes a bit awry

2013-09-17 Thread H. S. Teoh
On Tue, Sep 17, 2013 at 12:20:21PM -0700, Walter Bright wrote:
 On 9/17/2013 12:08 PM, H. S. Teoh wrote:
 Please file a bug at: http://d.puremagic.com/issues/
 
 That isn't going to help, as the clang linker devs don't look there.

lol... that will teach me to reply before reading more carefully. :-P


T

-- 
Doubtless it is a good thing to have an open mind, but a truly open mind
should be open at both ends, like the food-pipe, with the capacity for
excretion as well as absorption. -- Northrop Frye


Re: Improved Phobos dox

2013-09-17 Thread Jonas Drewsen

On Monday, 16 September 2013 at 17:08:38 UTC, H. S. Teoh wrote:
On Mon, Sep 16, 2013 at 06:49:01PM +0200, Vladimir Panteleev 
wrote:
On Monday, 16 September 2013 at 16:44:56 UTC, Andrei 
Alexandrescu

wrote:
I don't find disagreement with what I said.
[...]
Nice, but what I see here is different, not better.

I think we may be disagreeing regarding different things.

You could use both (dl class=d_decl) if you like.

I guess 'dl class=d_decl' is one iota more specific than 
'div

class=d_decl' and would help if one wanted to view the HTML
without any accompanying CSS. I doubt this is a goal to 
pursue.


I refer to my original argument about how this is
borderline-nitpicking. I'd like to add, however, that 
user-agents
such as screen readers might behave better when using 
appropriate

HTML tags.


I can attest to that. I'm on another mailing list where one of 
the list
members is sight-impaired, and she complains about how some 
websites
(i.e. those that suffer from heavy divitis and spanitis) simply 
can't be
read in any sane way by the screen reader. Using built-in 
semantic tags
like dl can make a world of difference for these users, since 
the
screen reader has no idea what class=d_decl means, but it 
*does* know

what dl means. I wouldn't be so quick to dismiss it.


Haven't followed the thread closely but one thing I've missed 
when trying to define a nicer stylesheet is something more 
specific that d_decl.


d_decl is used for all declarations which means that you cannot 
style enums, templates, functions etc. differently in the docs.
It would be nice to have an additional class added to the class 
attribute. For example: class=d_decl d_enum or class=d_decl 
d_template.


/Jonas



Re: std.d.lexer: pre-voting review / discussion

2013-09-17 Thread Dicebot

On Tuesday, 17 September 2013 at 20:14:36 UTC, Brian Schott wrote:
I've been busy with things that aren't D-related recently, but 
I should have time the rest of this week to address the lexer.


Ok, please notify me then once you feel ready for voting / extra 
review ( public at dicebot.lv )


Thanks for you work.


Re: std.d.lexer: pre-voting review / discussion

2013-09-17 Thread ilya-stromberg

On Wednesday, 11 September 2013 at 15:02:00 UTC, Dicebot wrote:
std.d.lexer is standard module for lexing D code, written by 
Brian Schott


Brian, have you got any plans to write common lexer/parser 
generator based on context-free grammar (CFG) or parsing 
expression grammar (PEG), not only for D grammar?


Something like this:
https://github.com/PhilippeSigaud/Pegged


Re: symbol suggestion algorithm goes a bit awry

2013-09-17 Thread Luís.Marques
On Tuesday, 17 September 2013 at 19:22:00 UTC, Vladimir Panteleev 
wrote:
That looks like linker output, and thus not a problem with the 
D toolchain. I guess that the linker you're using also has a 
suggestion feature. A quick Google tells me you're using a Mac?


I'm so used to D suggesting symbols that I didn't think this 
through, even though I remember seeing 'ld' in the output :-)


Yes, llvm/clang on a Mac.


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Manu
On 18 September 2013 00:35, Joseph Rushton Wakeling 
joseph.wakel...@webdrake.net wrote:

 On 17/09/13 16:19, Manu wrote:

 I had some experience with kdevelop this past weekend trying to find a
 reasonable working environment on linux. It's fairly nice. Certainly come
 along
 since I last tried to take it seriously a year or 2 back.
 It would be nice if there was D support though. It has rudimentary
 support that
 some whipped up, but it could do a lot better.


 Do you have any experience/opinion on Qt Creator as an IDE?  My impression
 is that it's nice in and of itself but limited compared to others in the
 range of languages/tools it supports -- but it's a very superficial
 impression so may be wrong.


The extent of my experience with QtCreator is that it has a button
Generate VS Project in the menu, which I clicked on, and then I opened
visual studio.
For the few moments that I used it, I was surprised by now un-like-eclipse
it looked :)
Maybe it's decent? What's it's underlying project/build system?
I have ex-trolltech mates who are now all unemployed... so what's the
future of the tool?


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Manu
On 18 September 2013 00:40, Dicebot pub...@dicebot.lv wrote:

 On Tuesday, 17 September 2013 at 14:20:03 UTC, Manu wrote:

 Can any linux MonoDevelop user enlighten me on how to use MonoDevelop4 on
 linux? I couldn't find a package for it anywhere... only MD3. It seems
 linux MD is way behind... no idea why.


 Your distro? It is 4.0.12 in Arch Linux official repository :P


Mint15... Link me? I can't find it.


Re: [OT] Which IDE / Editor do you use?

2013-09-17 Thread Adam D. Ruppe

On Tuesday, 17 September 2013 at 17:01:55 UTC, H. S. Teoh wrote:
Actually, that gives me an idea. What if, instead of defaulting 
to character data, the terminal input stream defaults to control

structures?


hehe those who don't understand Windows are doomed to reinvent it 
:) :) :)



the length) per message, which should minimize the overhead of
defaulting to control mode instead of pure data mode.


I'm actually not sure if overhead is worth worrying about. On the 
input side, it'd be slow anyway since humans only type so fast, 
and on the output side if you transfer big updates at once the 
few bytes for length and type would be quickly irrelevant anyway.


Besides, we aren't on 300 baud serial lines!

I'm not sure what the bash syntax is, but couldn't you just 
pipe echo to, say, fd 3 (altin?)?


Yes, we'd just have to change the convention. I should patch vim 
myself!


It could probabaly be done with existing programs through named 
pipes too.



Cool!


and it occurs to me that gnu screen is, at its core, just a 
terminal emulator. So... having a little terminal emulation 
library is useful for a bunch of things - a gnu screen 
replacement, a customized xterm, and perhaps even my own putty 
program for Windows. And embedding it in programs as a nice 
widget to use for some gui programming fun.


But wow, these escape sequences are even more annoying. I thought 
dealing with the input was a hassle, being on the other end is no 
walk in the park either!


However, I've implemented a handful and vim and bash are both 
kinda running. Some bugs in vim but it is usable.


Haha, yeah. If I were doing it, I'd say just do .ttf output 
from the get-go, render it as an image, whatever, just don't 
even bother with the antiquated X11 font handling.


I thought about that, but I actually *like* the plain core font 
fixed. (rxvt's default, at least on my system) I use it in a 
number of places and think it looks pretty good.


To the extent that I have two xterm shortcuts: one uses bitstream 
vera mono and the other uses plain old fixed-14.


Oh well, I'm rendering each character individually anyway, so 
switching won't be a problem.


Then when it comes time to add inline images, just treat it as 
a very large character with a custom bitmap font. :-P


indeed. Which brings up an idea too: you could just define custom 
bitmapped glyphs... arguably at this point you might as well just 
use xlib, but hey doing a printf(\033 magic bitmap stuff) is 
kinda enticing!


Re: Had another 48hr game jam this weekend...

2013-09-17 Thread Dicebot

On Wednesday, 18 September 2013 at 00:47:09 UTC, Manu wrote:

Mint15... Link me? I can't find it.


Mint is Debian/Ubuntu based so you should look at PPA mentioned 
above:


If you're on some sort of ubuntu variant: 
https://launchpad.net/~keks9n/+archive/monodevelop-latest


How Compilers Work

2013-09-17 Thread Walter Bright

http://i.imgur.com/OnMc8HO.jpg


Re: [OT] Which IDE / Editor do you use?

2013-09-17 Thread Michael


Besides, we aren't on 300 baud serial lines!



As backup line I have 56k dial-up modem ;)
We still trolling each other about IDE ?) Or Win 8.1 UI is the 
best UI?


Re: How Compilers Work

2013-09-17 Thread Adam Wilson
On Tue, 17 Sep 2013 22:23:03 -0700, Walter Bright  
newshou...@digitalmars.com wrote:



http://i.imgur.com/OnMc8HO.jpg


+1
+1000
+100

--
Adam Wilson
IRC: LightBender
Project Coordinator
The Horizon Project
http://www.thehorizonproject.org/


Re: public alias to private template implementation

2013-09-17 Thread monarch_dodra

On Monday, 16 September 2013 at 23:53:14 UTC, Meta wrote:
So you're really directly accessing a private symbol. Perhaps a 
workaround could be something like this:


//
module Test;
static const fun = Impl!int;
private template Impl(T)
{
void Impl(){}
}

//
module main;
import Test;
void main()
{
fun();
}

I had to do fun = Impl!int because the compiler complained 
about fun = Impl!int.


This seems to be not working, because Impl actually holds an 
overload. It's actually something like:


private template Impl(T)
{
void Impl(){}
void Impl(int){}
}

Grown.


Re: User defined attributes use

2013-09-17 Thread Jacob Carlborg

On 2013-09-16 22:15, Namespace wrote:


Then of course I have not said anything.
The same thing I would suggest for scope. It exists as a library
solution and is rewritten magical.


I think the big difference here is that AA's are safe where scope is 
not. I agree with you, I like to use scope anyway.


--
/Jacob Carlborg


Re: User defined attributes use

2013-09-17 Thread Jacob Carlborg

On 2013-09-17 00:53, H. S. Teoh wrote:


Hmm. I find D arrays just fine the way they are, actually. (In fact, I
rather *liked* the way D arrays worked as compared with, say, C/C++.)
What's wrong with them?


I guess one can complain about some of the built-in 
properties/functions, like sort.


--
/Jacob Carlborg


How to compile this template with short type?

2013-09-17 Thread mrd

[code]
Unsigned!T encodeZigZag( T )( inout T v ) pure
if( isSigned!( T ) )
{
 return v  0
 ?
 v * 2
 :
 -v * 2 - 1;
}
unittest
{
 assert( encodeZigZag!long( 2147483647 ) == 4294967294 );
 assert( encodeZigZag!long( -2147483648 ) == 4294967295 );

 assert( encodeZigZag!short( 20 ) == 40 );
 assert( encodeZigZag!short( -20 ) == 39 );
}
[/code]

Error: cannot implicitly convert expression (cast(int)v  0 ?
cast(int)v * 2 : cast(int)-v * 2 - 1) of type int to ushort

int?!


Re: How to compile this template with short type?

2013-09-17 Thread Namespace

On Tuesday, 17 September 2013 at 07:58:40 UTC, mrd wrote:

[code]
Unsigned!T encodeZigZag( T )( inout T v ) pure
if( isSigned!( T ) )
{
 return v  0
 ?
 v * 2
 :
 -v * 2 - 1;
}
unittest
{
 assert( encodeZigZag!long( 2147483647 ) == 4294967294 );
 assert( encodeZigZag!long( -2147483648 ) == 4294967295 );

 assert( encodeZigZag!short( 20 ) == 40 );
 assert( encodeZigZag!short( -20 ) == 39 );
}
[/code]

Error: cannot implicitly convert expression (cast(int)v  0 ?
cast(int)v * 2 : cast(int)-v * 2 - 1) of type int to ushort

int?!



Unsigned!T encodeZigZag( T )( inout T v ) pure
if( isSigned!( T ) )
{
 return cast(Unsigned!T)(v  0
 ?
 v * 2
 :
 -v * 2 - 1);
}



Re: How to compile this template with short type?

2013-09-17 Thread mrd

ahhh, many thanks!

I need more sleep


Re: public alias to private template implementation

2013-09-17 Thread Joseph Rushton Wakeling

On 16/09/13 23:00, monarch_dodra wrote:

Question 1: Is this the correct behavior? I'd have expected that if my alias is
public, it would allow any one from outside to make the call correctly.


See: http://d.puremagic.com/issues/show_bug.cgi?id=10996


Question 2: Is there a correct way to do this? I possible, I'd want to avoid
nesting the template, eg:
auto fun(){return Impl!int();}
As that would:
a) require more typing ^^
b) incur an extra function call in non-inline
c) if at all possible, I actually need fun to be a template, so that it can be
inlined.


Indeed, I used that workaround of manually nesting the functions in some code of 
mine:

https://github.com/WebDrake/Dgraph/blob/master/dgraph/graph.d#L492-L516

... but that's not a general solution, I was able to tolerate it because it's a 
limited and predictable set of instructions.


Jacob Carlborg suggested using opDispatch (cf. how it's done in Proxy), which 
should automate the nesting of template functions.  I avoided it simply 
because in my case I thought that doing it manually would be less hassle than 
getting opDispatch set up to cover every possible case, but depending on your 
use case it might be the better option.


Re: public alias to private template implementation

2013-09-17 Thread monarch_dodra
On Tuesday, 17 September 2013 at 08:47:25 UTC, Joseph Rushton 
Wakeling wrote:

On 16/09/13 23:00, monarch_dodra wrote:
Question 1: Is this the correct behavior? I'd have expected 
that if my alias is
public, it would allow any one from outside to make the call 
correctly.


See: http://d.puremagic.com/issues/show_bug.cgi?id=10996

Question 2: Is there a correct way to do this? I possible, 
I'd want to avoid

nesting the template, eg:
auto fun(){return Impl!int();}
As that would:
a) require more typing ^^
b) incur an extra function call in non-inline
c) if at all possible, I actually need fun to be a template, 
so that it can be

inlined.


Indeed, I used that workaround of manually nesting the 
functions in some code of mine:

https://github.com/WebDrake/Dgraph/blob/master/dgraph/graph.d#L492-L516

... but that's not a general solution, I was able to tolerate 
it because it's a limited and predictable set of instructions.


Jacob Carlborg suggested using opDispatch (cf. how it's done in 
Proxy), which should automate the nesting of template 
functions.  I avoided it simply because in my case I thought 
that doing it manually would be less hassle than getting 
opDispatch set up to cover every possible case, but depending 
on your use case it might be the better option.


Thanks. I'm not very fluent with opDispatch though. Doesn't that 
only work if you have an struct/class instance though? My fun 
is a free frunction.


I you are able to adapt it to my trivial usecase, it might be 
clearer to me what you have in mind.


Re: public alias to private template implementation

2013-09-17 Thread Joseph Rushton Wakeling

On 17/09/13 11:30, monarch_dodra wrote:

Thanks. I'm not very fluent with opDispatch though. Doesn't that only work if
you have an struct/class instance though? My fun is a free frunction.


Ack.  Sorry, I overlooked that. :-(

Still, I think this provides greater impulse for Issue 10996 to be fixed, since 
your issue clearly stems from the same access implementation issues.  If you 
make a public alias, you'd expect public members of whatever you're aliasing to 
be public through that alias.


I guess it might be desirable to require some clear indication Yes, I really, 
really know what I'm doing and I do want this alias to be public -- e.g. 
compelling you to use the public keyword explicitly.


License of RosettaCode examples (for bearophile:-)

2013-09-17 Thread Joseph Rushton Wakeling
This message is especially for bearophile, but applies to anyone posting 
examples on RosettaCode :-)


Can I ask you to clarify your licensing intentions for these examples?  By 
default all on RosettaCode is GNU Free Documentation License, which does not 
really play in a friendly way with ... just about any actual software license.


I imagine that all these examples were posted with the intention that they be 
used by others, but the default RosettaCode situation makes that impossible 
without direct permission.  So ... I'm asking. :-)


Thanks  best wishes,

-- Joe


Re: GC.collect bug ?

2013-09-17 Thread Temtaime
I cannot use the delete/destroy. I want to call dtor at all 
unreferenced objects.
Manual from Dlang size says that GC.collect triggers a full 
collection. But it doesn't.


Re: License of RosettaCode examples (for bearophile:-)

2013-09-17 Thread Iain Buclaw
On Tuesday, 17 September 2013 at 11:04:13 UTC, Joseph Rushton 
Wakeling wrote:
This message is especially for bearophile, but applies to 
anyone posting examples on RosettaCode :-)


Can I ask you to clarify your licensing intentions for these 
examples?  By default all on RosettaCode is GNU Free 
Documentation License, which does not really play in a friendly 
way with ... just about any actual software license.


I imagine that all these examples were posted with the 
intention that they be used by others, but the default 
RosettaCode situation makes that impossible without direct 
permission.  So ... I'm asking. :-)




An example of what the situation is using GNU FDL - last time I 
checked material under the GNU FDL could not be put into GPL code 
and GPL code could not be put into a GNU FDL manual.  So watch 
out! :-)



Regards
Iain.


Re: public alias to private template implementation

2013-09-17 Thread Dicebot
That is actually very weird because you can override protection 
attribute with alias for an aggregate:


// b.d
private struct A_
{
}

public alias A = A_;

// a.d
void main() { A a; } // fine!

That inconsistency feels plain wrong. Worth enhancement request 
at least.


Re: License of RosettaCode examples (for bearophile:-)

2013-09-17 Thread bearophile

Joseph Rushton Wakeling:

This message is especially for bearophile, but applies to 
anyone posting examples on RosettaCode :-)


Can I ask you to clarify your licensing intentions for these 
examples?  By default all on RosettaCode is GNU Free 
Documentation License, which does not really play in a friendly 
way with ... just about any actual software license.


I am just following the common licensing you see in that site:
http://www.gnu.org/licenses/fdl-1.2.html

Recently the author of most of the PicoLisp entries has collected 
them in a commercial book, this has caused some troubles.


If you want info about Rosettacode licensing I suggest you go in 
the rosettacode IRC channel and talk with Mike Mol about it.


Bye,
bearophile


Re: N step fft in D language

2013-09-17 Thread kraybit
On Sunday, 15 September 2013 at 20:58:54 UTC, Kadir Erdem Demir 
wrote:

On Sunday, 15 September 2013 at 15:39:14 UTC, John Colvin wrote:
On Sunday, 15 September 2013 at 15:15:28 UTC, Kadir Erdem 
Demir wrote:

I am using fft function from std.numeric

Complex!double[] resultfft = fft(timeDomainAmplitudeVal);

The parameter timeDomainAmplitudeVal is audio amplitude data. 
Sample rate 44100 hz and there is 131072(2^16) samples


I am seeing that resultfft has the same size as 
timeDomainAmplitudeVal(131072) which does not fits my 
project(also makes no sense).


That's what the FFT does. See here: 
http://stackoverflow.com/questions/4364823/how-to-get-frequency-from-fft-result


I believe I am well aware of the things which are explained in 
the link. There is a sentence in link which says  : The first 
bin in the FFT is DC (0 Hz), the second bin is Fs / N, where Fs 
is the sample rate and N is the size of the FFT.


My question how can I determine the N which is the size of 
FFT ?

In fftw library one can define N like :
fftw_create_plan(N, FFTW_FORWARD, FFTW_ESTIMATE);
In D do we have a way to do that ?


Hi!

Haven't tried this, but looking at the docs it looks like you 
have to:


auto mySample = getSampleData();
auto fftData0 = fft(mySample[0..512]);
auto fftData1 = fft(mySample[512..1024]);
...

This would give you the frequency correlation data for two 
windows in time, and by reading that stackoverflow I assume for 
256 frequencies each.


Docs also says there's a class you can reuse if you know the max 
size, which should be faster.


auto ffter = new Fft(512);
foreach(chunk; getSampleByChunk(512))
{
  auto fftData = ffter.fft(chunk);
  ...
}


The FFT size, N, is the same as the number of samples you 
provide it. So the more data you provide, the finer correlation 
detail you get. I think it makes sense?


Hmm, what it seems you have done is pass the entire sample 
though, which gives you an FFT of size 131072. So you get 
phenomenally good detail in frequency correlation, but just one 
huge time window—the entire sample! I think what you're simply 
looking for is chopping it up into smaller pieces and run fft on 
each—that's at least what most audio tools do I believe.


kind regards
k



Re: User defined attributes use

2013-09-17 Thread Artur Skawina
On 09/17/13 00:53, H. S. Teoh wrote:
 On Mon, Sep 16, 2013 at 10:59:10PM +0200, Artur Skawina wrote:
 On 09/16/13 22:38, Namespace wrote:
 [1] Obviously, not a practical short term option for the existing
 D2 language.  That's probably clear from the context, and the
 question was meant to be rhetorical -- but it could actually be
 done and would make sense; it's just not a change that would
 make enough of a difference on its own; the cost would be to
 high.

 Why to high? Too much compiler magic or dmd internal dependences?

 Too much (language) change for too little gain; there are many, many
 much more important things that need to be fixed. Being able to have
 several user-defined kinds of arrays is a nice-to-have feature, but
 not one that determines whether the language is usable or not.
 [...]
 
 Hmm. I find D arrays just fine the way they are, actually. (In fact, I
 rather *liked* the way D arrays worked as compared with, say, C/C++.)
 What's wrong with them?

Not that much, at least not enough to worry about it right now, 
considering all the other language issues. (eg some conversions, like
to-bool, static-array-to-slice; syntax ambiguity [1]; some properties)

But removing magic from the compiler and making the language more
expressive, so that the magic could be done by the user, would be an
improvement. Not a regression, which the original question implied.
For example:

1)
   // in semi-pseudocode
   alias utf8string = utf8octet[];
   utf8string s = abc;
   foreach (c; s)
  // iterate by codepoints, not bytes

Yep, this is like what can be done today with built-in strings --
except that it could be done by overloading array-ops in 'utf8octect'.
No type-specific compiler magic, and then you can use it for many other
kinds of variable-element-length array types.

2)
SIMD optimizations; again, w/o explicit compiler support. It could
just map array ops to an optional
'static @inline T.opArrayOp(string op, size_t minAlignent, B)(T[] a, B b)'
method, etc.


In general, much of the built-in compiler 'magic' gets in the way of
emitting optimal code, for example the hardwired (d)runtime calls
prevent many optimizations. (eg removing (hacking around for just one 
built-in type is easy enough) the 'typeid()' calls from your stand-alone
AAs makes a huge difference. Or at least it did ~ a year ago when i
looked at how much inherent overhead the std AAs have).

artur

[1]
--
   auto f(T[2] a) {
  /* 'a' is what it looks like - a static array, right? Oops... */
   }

   template Tuple(A...) { alias Tuple = A; }
   alias T = Tuple!(int, double, long);
--


Re: License of RosettaCode examples (for bearophile:-)

2013-09-17 Thread Joseph Rushton Wakeling

On 17/09/13 13:17, Iain Buclaw wrote:

An example of what the situation is using GNU FDL - last time I checked material
under the GNU FDL could not be put into GPL code and GPL code could not be put
into a GNU FDL manual.  So watch out! :-)


Indeed.  An unfortunate situation, no?



Re: License of RosettaCode examples (for bearophile:-)

2013-09-17 Thread Joseph Rushton Wakeling

On 17/09/13 13:32, bearophile wrote:

I am just following the common licensing you see in that site:
http://www.gnu.org/licenses/fdl-1.2.html

Recently the author of most of the PicoLisp entries has collected them in a
commercial book, this has caused some troubles.

If you want info about Rosettacode licensing I suggest you go in the rosettacode
IRC channel and talk with Mike Mol about it.


Would you be prepared to license your own examples under Boost?  I don't know 
what your intentions were for others' use of your code, but as it stands the FDL 
license makes them impossible to re-use.


Re: License of RosettaCode examples (for bearophile:-)

2013-09-17 Thread bearophile

Joseph Rushton Wakeling:


Would you be prepared to license your own examples under Boost?
 I don't know what your intentions were for others' use of your 
code, but as it stands the FDL license makes them impossible to 
re-use.


I am writing code for Rosettacode since years, I have written, 
rewritten, I have modified code written by others, and so on. I 
have also written many entries before having an account in that 
site, so there's no proof the author is me. I have also written 
many entries in Python, several in Haskell and C, some in C++, 
etc. While there are several entries that are written only by me, 
finding them is not easy. I didn't care about the owners of the 
code there. So I own nothing there. For re-use ask to Mike Mol.


Bye,
bearophile


Re: License of RosettaCode examples (for bearophile:-)

2013-09-17 Thread Joseph Rushton Wakeling

On 17/09/13 14:03, bearophile wrote:

I am writing code for Rosettacode since years, I have written, rewritten, I have
modified code written by others, and so on. I have also written many entries
before having an account in that site, so there's no proof the author is me. I
have also written many entries in Python, several in Haskell and C, some in C++,
etc. While there are several entries that are written only by me, finding them
is not easy. I didn't care about the owners of the code there. So I own nothing
there. For re-use ask to Mike Mol.


I have a specific interest in your circular queue implementation:
http://rosettacode.org/wiki/Queue/Usage#Faster_Version

I used this (or rather, I adapted it) in a private project which is not being 
distributed, so hence there were no licensing issues.  I can't remember how I 
found it but I think it was when you posted it to the digitalmars.D mailing 
list: http://forum.dlang.org/post/grepielsmapflndpk...@forum.dlang.org


... and at the time I think I just assumed that since you were pointing people 
to it and were the author, you'd licensed it permissively.


However, more recently I rather stupidly copied my adapted version into a public 
project of mine, and I suddenly realized the licensing situation.


In the worst case scenario, I'll strip it out of the code, but I was hoping that 
you might be willing to license this specific code under Boost or something else 
GPL-compatible.


Re: License of RosettaCode examples (for bearophile:-)

2013-09-17 Thread bearophile

Joseph Rushton Wakeling:

I have a specific interest in your circular queue 
implementation:

http://rosettacode.org/wiki/Queue/Usage#Faster_Version


If you restrict your desires to just one D program, instead of
the about one thousand of Rosettacode the situation becomes
_much_ simpler :-)

I wrote that D code myself because Phobos still lacks a queue,
but the original idea of growable circular queues is decades old.
For Phobos I suggest a different and more complex implementation
(dynamic array of pointers to freelist-linked fixed sized chunks).


However, more recently I rather stupidly copied my adapted 
version into a public project of mine, and I suddenly realized 
the licensing situation.


In the worst case scenario, I'll strip it out of the code, but 
I was hoping that you might be willing to license this specific 
code under Boost or something else GPL-compatible.


I have put that code only on Rosettacode, and in an archive in my
site. I am willing to release it to public domain if you want :-)
But what do you want me exactly to do? :-)

Bye,
bearophile


Re: License of RosettaCode examples (for bearophile:-)

2013-09-17 Thread Joseph Rushton Wakeling

On 17/09/13 15:18, bearophile wrote:

Joseph Rushton Wakeling:


I have a specific interest in your circular queue implementation:
http://rosettacode.org/wiki/Queue/Usage#Faster_Version


If you restrict your desires to just one D program, instead of
the about one thousand of Rosettacode the situation becomes
_much_ simpler :-)


Very true. :-)  I'm sorry for not being sufficiently specific straight away, but 
I thought the general question might be of interest.


I did try and write you a personal email about the specific code earlier today, 
before even writing to the list, but your given email address doesn't work.  I 
take it that I need to make some manual tweaks to what appears in the Reply: 
field ... ?



I wrote that D code myself because Phobos still lacks a queue,
but the original idea of growable circular queues is decades old.
For Phobos I suggest a different and more complex implementation
(dynamic array of pointers to freelist-linked fixed sized chunks).


I made use of it ... because Phobos still lacks a queue. :-P  And I'll surely 
use Phobos' queue in its place once that is implemented.



I have put that code only on Rosettacode, and in an archive in my
site. I am willing to release it to public domain if you want :-)
But what do you want me exactly to do? :-)


Well, I guess the best thing would be just to write here, I license the code 
under the terms of the Boost license or something similar (public domain is in 
some ways less good because not every jurisdiction recognizes it, but as far as 
I'm concerned it's fine too).  I'm just looking for something that I can 
reference to say the code is used under these terms.


If you could add such a notice to the copy on your own site and on RosettaCode 
it would be even better because that means that it's then clear to everyone what 
the use terms of the code are (I think RosettaCode allows you to add more 
permissive licenses to your code submissions, no?).  But that's up to you.  An 
explicit permission here is all I'm really looking for.


Whatever you decide, thanks very much for being so understanding and 
accommodating.  I'm very embarrassed about this, it is very unlike me to neglect 
code licensing in this way. :-(


Thanks  best wishes,

 -- Joe


  1   2   >