Re: I'm porting some go code to D

2013-08-25 Thread Rory McGuire
On 24 Aug 2013 23:55, Paulo Pinto p...@progtools.org wrote:

 Funny, I always thought otherwise, because Windows only has threads.

 Processes are just a means of grouping threads on Windows, as there
 isn't the distinction between threads and processes that UNIX systems
used to make.

 Then again, I lost track how the performance on Linux systems changed
across the whole Processes - LinuxThreads - NPTL - Posix Threads
evolution.

 --
 Paulo

Just did a quick search to see if I was right. I'm not sure if it's still
the case but it appears that is actually the scheduler that causes windows
to be much slower than Linux.

Ideally one would want a hybrid of threads and fibres anyway. I wonder how
much of the standard library would need to change.


Anybody else going to GoingNative? Sep 4-6

2013-08-25 Thread Walter Bright

http://channel9.msdn.com/Events/GoingNative/2013

I'll be there, as will be Andrei.


Re: GHC 2013 in Paris

2013-08-25 Thread monarch_dodra

On Saturday, 24 August 2013 at 22:52:50 UTC, Iain Buclaw wrote:


Hi Guys,

Thanks for making it down.  Are you going to be around 
tomorrow?  Feel

free to ping me or message me and we'll arrange something. :o)

Will be at the IRIS building at 9.00am (this time I will be 
present at
that time).  And will be staying in Paris until around 2.00pm, 
which

is when I have to check in for train back to London.


Regards


Sorry for being there so little time. It *was* a *GNU* conference 
to begin with, and I kind of appeared only for your talk, out of 
nowhere, so I didn't want to stay un-invited for what followed 
(dinner and whatnot). Sorry I left without saying goodbye, I 
didn't want to bother anyone during a talk.


I enjoyed your talk very much, and learned a lot about things I 
knew nothing about.


Sorry I can't make it back down to Paris today, but as you may 
have noticed, moving is a bit difficult for me at the moment. In 
any case, I hope you'll enjoy your last day in Paris, even under 
the rain :/


Re: glad OpenGL loader generator

2013-08-25 Thread David
Am 13.08.2013 19:38, schrieb David:
 glad now supports also EGL, GLX and WGL
 

You can add GLES to the list

TODO:
 * GLES loader
 * lazy loading
 * debugging (tracing function calls and error-checks with glGetError)
 * helperfunctions like gladGetErrorString(GLenum) or
gladEnumToString(GLenum) etc.


Arch Linux D news digest

2013-08-25 Thread Dicebot

Greetings to fellow Arch Linux users - quite a lot of stuff has
happened there recently in relation to D and this should sum it
up.

Some changes may have not been synchronised to all mirrors yet,
so please wait a bit before reporting :)

--
   Changes
--

1) After long period of bothering him with package change
proposals previous D maintainer, Sven-Hendrik Haase, decided to
transfer responsibilities for their maintenance to me. After
formal voting I have been added to Trusted User list with
intention to take care of anything D-related in Arch Linux.

2) `gdc` package has been added to the [community]. It uses 4.8.1
branch to match gcc version in Arch repositories. I know this one
is relatively old and hope to fix this one day with Iain's help ;)

3) All D compilers now have common naming/path convention.
Library:
 - libphobos.a
 - liblphobos.a
 - libgphobos.a

Imports:
 - /usr/include/dlang/dmd
 - /usr/include/dlang/ldc
 - /usr/include/dlang/gdc/{gcc-version}

4) Four package groups has been defined: 'dlang', 'dlang-dmd',
'dlang-ldc', 'dlang-gdc'. Those can used as install/remove
targets for pacman to get full development stack.

5) More preparations for shared library support. `libphobos`
package currently contains only libphobos.so (with fixed SONAME)
and is intended to be used as a dependency for user applications.
Static library and import sources are available via
`libphobos-devel`. GDC and LDC currently have only -devel
versions of phobos as they don't seem to provide share one (I
will be happy to add one if I am wrong).

6) `dtools` package now also provides DustMite!

--
Sources  bug reports
--

I am inevitably going to screw something at at some point and you
will inevitably want to make a tweaked versions of official
packages in AUR.

Official Arch Linux stuff:
 [community] bug tracker:
https://bugs.archlinux.org/index.php?project=5do=indexswitch=1
 packaging script sources:
https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/{package-name}

However, I do prefer git/Github for development and exact mirror
can be found here (together with my AUR packages):
 https://github.com/Dicebot/Arch-PKGBUILDs

Both accepting pull requests and checking for bug reports there.

--
Adding new D packages
--

https://wiki.archlinux.org/index.php/AUR_Trusted_User_Guidelines#The_TU_and_.5Bcommunity.5D.2C_Guidelines_for_Package_Maintenance
:

Only popular packages may enter the repo, as defined by 1%
usage from pkgstats or 10 votes on the AUR.

Yes, that is correct. I have a legitimate reasons to move any D
package from  AUR to [community] once it reaches 10 votes. Please
don't forget to vote! At least tools like `dub` and `dstep`, in
my opinion, are prime candidates for inclusion ;)

If there are any D packages that match that criteria and I have
missed it - please, ping me via pub...@dicebot.lv or on IRC
(Dicebot @ irc.freenode.net)


Re: Arch Linux D news digest

2013-08-25 Thread Johannes Pfau
Am Sun, 25 Aug 2013 21:11:51 +0200
schrieb Dicebot pub...@dicebot.lv:

 Greetings to fellow Arch Linux users - quite a lot of stuff has
 happened there recently in relation to D and this should sum it
 up.
 
 Some changes may have not been synchronised to all mirrors yet,
 so please wait a bit before reporting :)

Awesome!

I updated the gdc-4.8 branch. (Well I actually just synced it with
master which is still compatible with gcc-4.8)



Re: Arch Linux D news digest

2013-08-25 Thread Dicebot

On Sunday, 25 August 2013 at 19:45:38 UTC, Johannes Pfau wrote:

Am Sun, 25 Aug 2013 21:11:51 +0200
schrieb Dicebot pub...@dicebot.lv:


Greetings to fellow Arch Linux users - quite a lot of stuff has
happened there recently in relation to D and this should sum it
up.

Some changes may have not been synchronised to all mirrors yet,
so please wait a bit before reporting :)


Awesome!

I updated the gdc-4.8 branch. (Well I actually just synced it 
with

master which is still compatible with gcc-4.8)


Nice, which is the current FE version supported then? (Will do an 
update pretty soon)


Re: Arch Linux D news digest

2013-08-25 Thread Jordi Sayol
On 25/08/13 21:11, Dicebot wrote:
 Greetings to fellow Arch Linux users - quite a lot of stuff has
 happened there recently in relation to D and this should sum it
 up.
 
 Some changes may have not been synchronised to all mirrors yet,
 so please wait a bit before reporting :)
 
 --
Changes
 --
 
 1) After long period of bothering him with package change
 proposals previous D maintainer, Sven-Hendrik Haase, decided to
 transfer responsibilities for their maintenance to me. After
 formal voting I have been added to Trusted User list with
 intention to take care of anything D-related in Arch Linux.

Congratulations! :-)

 
 2) `gdc` package has been added to the [community]. It uses 4.8.1
 branch to match gcc version in Arch repositories. I know this one
 is relatively old and hope to fix this one day with Iain's help ;)
 
 3) All D compilers now have common naming/path convention.
 Library:
  - libphobos.a
  - liblphobos.a
  - libgphobos.a

Is it not better:
- libphobos2.a
- liblphobos2.a
- libgphobos2.a

 
 Imports:
  - /usr/include/dlang/dmd
  - /usr/include/dlang/ldc
  - /usr/include/dlang/gdc/{gcc-version}

Current debian path is without dlang directory, but I think that this is not 
a problem.

 
 4) Four package groups has been defined: 'dlang', 'dlang-dmd',
 'dlang-ldc', 'dlang-gdc'. Those can used as install/remove
 targets for pacman to get full development stack.
 
 5) More preparations for shared library support. `libphobos`
 package currently contains only libphobos.so (with fixed SONAME)
 and is intended to be used as a dependency for user applications.

Is it not better:
- libphobos2.so

What's the Arch Linux way to name shared libraries? On debian, libphobos2.so 
(libphobos2-dev) is a symlink to real libphobos2.so.0.63.0 (libphobos2-63) 
shared library. libphobos2.so.0.63 (libphobos2-63) SONAME symlink is created 
with the ldconfig command during the deb package (un)installation.

 Static library and import sources are available via
 `libphobos-devel`. GDC and LDC currently have only -devel
 versions of phobos as they don't seem to provide share one (I
 will be happy to add one if I am wrong).
 
 6) `dtools` package now also provides DustMite!
 
 --
 Sources  bug reports
 --
 
 I am inevitably going to screw something at at some point and you
 will inevitably want to make a tweaked versions of official
 packages in AUR.
 
 Official Arch Linux stuff:
  [community] bug tracker:
 https://bugs.archlinux.org/index.php?project=5do=indexswitch=1
  packaging script sources:
 https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/{package-name}
 
 However, I do prefer git/Github for development and exact mirror
 can be found here (together with my AUR packages):
  https://github.com/Dicebot/Arch-PKGBUILDs
 
 Both accepting pull requests and checking for bug reports there.
 
 --
 Adding new D packages
 --
 
 https://wiki.archlinux.org/index.php/AUR_Trusted_User_Guidelines#The_TU_and_.5Bcommunity.5D.2C_Guidelines_for_Package_Maintenance
 :
 
 Only popular packages may enter the repo, as defined by 1%
 usage from pkgstats or 10 votes on the AUR.
 
 Yes, that is correct. I have a legitimate reasons to move any D
 package from  AUR to [community] once it reaches 10 votes. Please
 don't forget to vote! At least tools like `dub` and `dstep`, in
 my opinion, are prime candidates for inclusion ;)
 
 If there are any D packages that match that criteria and I have
 missed it - please, ping me via pub...@dicebot.lv or on IRC
 (Dicebot @ irc.freenode.net)
 

Great work! awesome!

-- 
Jordi Sayol


Re: GoingNative 2013

2013-08-25 Thread Adam Wilson

On Sun, 25 Aug 2013 13:41:00 -0700, Adam Wilson flybo...@gmail.com wrote:

On Mon, 29 Jul 2013 15:12:39 -0700, Walter Bright  
newshou...@digitalmars.com wrote:



http://channel9.msdn.com/Events/GoingNative/2013

The last one was a lot of fun, so I signed up for this one, too. Note  
that Andrei is a speaker! Recommended. See y'all there!


(P.S. It's entirely possible that I may get my mythical '72 Dodge  
running in time for this, and I can drive it to the conference. It  
blarts out enough CO2 to melt at least 3 Priuses.)


It looks like I'll be there! I was able to beg the time off. The ability  
to connect to the WiFi and the sweet setup they have for laptops there  
was what got my boss to agree. :-)




Also looking forward to heckling Andrei! ;-)

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


Re: GoingNative 2013

2013-08-25 Thread Adam Wilson
On Mon, 29 Jul 2013 15:12:39 -0700, Walter Bright  
newshou...@digitalmars.com wrote:



http://channel9.msdn.com/Events/GoingNative/2013

The last one was a lot of fun, so I signed up for this one, too. Note  
that Andrei is a speaker! Recommended. See y'all there!


(P.S. It's entirely possible that I may get my mythical '72 Dodge  
running in time for this, and I can drive it to the conference. It  
blarts out enough CO2 to melt at least 3 Priuses.)


It looks like I'll be there! I was able to beg the time off. The ability  
to connect to the WiFi and the sweet setup they have for laptops there was  
what got my boss to agree. :-)


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


Re: Anybody else going to GoingNative? Sep 4-6

2013-08-25 Thread Adam Wilson
On Sun, 25 Aug 2013 01:10:05 -0700, Walter Bright  
newshou...@digitalmars.com wrote:



http://channel9.msdn.com/Events/GoingNative/2013

I'll be there, as will be Andrei.


Oops, missed this. I will be there. My boss relented when I convinced him  
that I could respond to support incidents just as well from my laptop and  
the WiFi there as I could from anywhere else, and that learning about the  
low-level is helpful to my job. :-)


For the IRC denizens, I'll be on IRC so I write about what's going on if  
they don't live stream it... And of course participate in the heckling of  
Andrei! ;-)


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


Re: Arch Linux D news digest

2013-08-25 Thread Dicebot

On Sunday, 25 August 2013 at 20:33:49 UTC, Jordi Sayol wrote:

Is it not better:
- libphobos2.a
- liblphobos2.a
- libgphobos2.a


It is libphobos2.a, of course, typo-paste :)


Is it not better:
- libphobos2.so


Same here (blush)

What's the Arch Linux way to name shared libraries? On debian, 
libphobos2.so (libphobos2-dev) is a symlink to real 
libphobos2.so.0.63.0 (libphobos2-63) shared library. 
libphobos2.so.0.63 (libphobos2-63) SONAME symlink is created 
with the ldconfig command during the deb package 
(un)installation.


On Arch currently there are only libphobos2.so (actualy binary) 
and libphobos2.so.0.63 (automatically created during 
installation). I am going to ask on IRC if any other symlinks are 
expected.


Re: Arch Linux D news digest

2013-08-25 Thread Iain Buclaw
On 25 August 2013 21:51, Dicebot pub...@dicebot.lv wrote:
 On Sunday, 25 August 2013 at 19:45:38 UTC, Johannes Pfau wrote:

 Am Sun, 25 Aug 2013 21:11:51 +0200
 schrieb Dicebot pub...@dicebot.lv:

 Greetings to fellow Arch Linux users - quite a lot of stuff has
 happened there recently in relation to D and this should sum it
 up.

 Some changes may have not been synchronised to all mirrors yet,
 so please wait a bit before reporting :)


 Awesome!

 I updated the gdc-4.8 branch. (Well I actually just synced it with
 master which is still compatible with gcc-4.8)


 Nice, which is the current FE version supported then? (Will do an update
 pretty soon)

If it's sync'd with master, then it's 2.063.2.  :)

-- 
Iain Buclaw

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


Re: Arch Linux D news digest

2013-08-25 Thread John Colvin

On Sunday, 25 August 2013 at 19:11:52 UTC, Dicebot wrote:

Greetings to fellow Arch Linux users - quite a lot of stuff has
happened there recently in relation to D and this should sum it
up.

Some changes may have not been synchronised to all mirrors yet,
so please wait a bit before reporting :)

--
   Changes
--

1) After long period of bothering him with package change
proposals previous D maintainer, Sven-Hendrik Haase, decided to
transfer responsibilities for their maintenance to me. After
formal voting I have been added to Trusted User list with
intention to take care of anything D-related in Arch Linux.

2) `gdc` package has been added to the [community]. It uses 
4.8.1
branch to match gcc version in Arch repositories. I know this 
one
is relatively old and hope to fix this one day with Iain's help 
;)


3) All D compilers now have common naming/path convention.
Library:
 - libphobos.a
 - liblphobos.a
 - libgphobos.a

Imports:
 - /usr/include/dlang/dmd
 - /usr/include/dlang/ldc
 - /usr/include/dlang/gdc/{gcc-version}

4) Four package groups has been defined: 'dlang', 'dlang-dmd',
'dlang-ldc', 'dlang-gdc'. Those can used as install/remove
targets for pacman to get full development stack.

5) More preparations for shared library support. `libphobos`
package currently contains only libphobos.so (with fixed SONAME)
and is intended to be used as a dependency for user 
applications.

Static library and import sources are available via
`libphobos-devel`. GDC and LDC currently have only -devel
versions of phobos as they don't seem to provide share one (I
will be happy to add one if I am wrong).

6) `dtools` package now also provides DustMite!

--
Sources  bug reports
--

I am inevitably going to screw something at at some point and 
you

will inevitably want to make a tweaked versions of official
packages in AUR.

Official Arch Linux stuff:
 [community] bug tracker:
https://bugs.archlinux.org/index.php?project=5do=indexswitch=1
 packaging script sources:
https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/{package-name}

However, I do prefer git/Github for development and exact mirror
can be found here (together with my AUR packages):
 https://github.com/Dicebot/Arch-PKGBUILDs

Both accepting pull requests and checking for bug reports there.

--
Adding new D packages
--

https://wiki.archlinux.org/index.php/AUR_Trusted_User_Guidelines#The_TU_and_.5Bcommunity.5D.2C_Guidelines_for_Package_Maintenance
:

Only popular packages may enter the repo, as defined by 1%
usage from pkgstats or 10 votes on the AUR.

Yes, that is correct. I have a legitimate reasons to move any D
package from  AUR to [community] once it reaches 10 votes. 
Please

don't forget to vote! At least tools like `dub` and `dstep`, in
my opinion, are prime candidates for inclusion ;)

If there are any D packages that match that criteria and I have
missed it - please, ping me via pub...@dicebot.lv or on IRC
(Dicebot @ irc.freenode.net)


OT:

This might be the final straw that takes me over to Arch.

How are things over on that side of linux? I've been using
ubuntu/lubuntu/fedora/mint on various machines for years but
never really tried out the more DIY distros.


Re: I'm porting some go code to D

2013-08-25 Thread Rory McGuire
On Sat, Aug 24, 2013 at 3:26 PM, bearophile bearophileh...@lycos.comwrote:

 David Nadlinger:


  It's a cute idea, but not really practical, I'm afraid – Goroutines are
 managed by a scheduler in the Go runtime library, whereas D threads
 directly map to OS threads.


 Can't Rory McGuire add a scheduler to his code? How much code does it take?

 Bye,
 bearophile



Here is a basic co-operative scheduler based version of go!(F)  that uses a
channel to keep things simple, its co-op so Fiber.yield has to be called at
some point. If the channel detects its in a Fiber it calls yield if there
is nothing available in it:

void go(alias F)() {
scheduler._ = new Fiber(F);
}

shared chan!Fiber scheduler; // channel contains Fibers waiting for their
time slice
static this () {
if (scheduler is null) {
scheduler = makeChan!Fiber(100);

// create the workers
auto goprocs = environment.get(GOPROCS);
int num_threads = 1;
if (goprocs != null) {
num_threads = to!int(goprocs);
}
foreach (i; 0..num_threads) {
// create threads that process the live fibers
auto t = new Thread(() {
for (;;) {
auto fiber = scheduler._;
fiber.call();
if (fiber.state != Fiber.State.TERM) {
scheduler._ (fiber);
}
}
});
t.start();
}

}
}

Just need to figure out a way to detect when main() has exited.


Re: Arch Linux D news digest

2013-08-25 Thread Andrei Alexandrescu

On 8/25/13 12:11 PM, Dicebot wrote:

Greetings to fellow Arch Linux users - quite a lot of stuff has
happened there recently in relation to D and this should sum it
up.

Some changes may have not been synchronised to all mirrors yet,
so please wait a bit before reporting :)


Awesome! Please let me know when this is ready to go on reddit etc.

Andrei




Re: I'm porting some go code to D

2013-08-25 Thread Timon Gehr

On 08/26/2013 12:55 AM, Rory McGuire wrote:


shared chan!Fiber scheduler; // channel contains Fibers waiting for
their time slice
static this () {
 if (scheduler is null) {



You want 'shared static this' instead to avoid a race condition.


Re: I'm porting some go code to D

2013-08-25 Thread Rory McGuire
Awesome thanks, thought what I did there was dodgy. It was really weird
when this() started multiple schedulers at least now I see the obvious
reason.

BTW: gist is at: https://gist.github.com/rjmcguire/6336931

Could someone point me at the correct linked list to use inside the
channel. I'd prefer to use a range container of some kind if it exists in
the std lib. I tried SList and had a bad experience hence the custom
implementation.



On Mon, Aug 26, 2013 at 1:21 AM, Timon Gehr timon.g...@gmx.ch wrote:

 On 08/26/2013 12:55 AM, Rory McGuire wrote:


 shared chan!Fiber scheduler; // channel contains Fibers waiting for
 their time slice
 static this () {
  if (scheduler is null) {



 You want 'shared static this' instead to avoid a race condition.