Re: object.Exception@generated\gtkd\gtkd\Loader.d(125):Library load failed(libgio-2.0.0.dll)

2017-11-21 Thread Mike Wey via Digitalmars-d

On 21-11-17 11:19, PECman wrote:

On Sunday, 19 November 2017 at 13:39:39 UTC, Mike Wey wrote:

On 19-11-17 08:35, PECman wrote:
I complied the D application with gtkD successfully.However,I cant 
run it successfully.My settings are OK.I dunno why it happened to me:-(

Who can help me?


That line usually includes the error returned from LoadLibrary which 
should give an indication of why it failed.


I assume you installed the GTK runtime for the architecture you are 
building for ( 32 or 64 bit ).


But the error is the messy code.
I have already installed the GTK runtime 32 bit(on Windows 7 32 bit)
What shall I do next?


That's unfortunate, usually there is some info on why it fails after the 
`(libgio-2.0-0.dll)`.


First check if the `bin` directory of the GTK installation is on the 
PATH, and if there are any other GTK installs on the PATH, GtkD should 
try to detect the correct runtime to use but that might have failed.


--
Mike Wey


Re: object.Exception@generated\gtkd\gtkd\Loader.d(125):Library load failed(libgio-2.0.0.dll)

2017-11-19 Thread Mike Wey via Digitalmars-d

On 19-11-17 08:35, PECman wrote:
I complied the D application with gtkD successfully.However,I cant run 
it successfully.My settings are OK.I dunno why it happened to me:-(

Who can help me?


That line usually includes the error returned from LoadLibrary which 
should give an indication of why it failed.


I assume you installed the GTK runtime for the architecture you are 
building for ( 32 or 64 bit ).


--
Mike Wey


Re: Symbols missing, unmangle!

2017-08-31 Thread Mike Wey via Digitalmars-d

On 30-08-17 23:51, Moritz Maxeiner wrote:
2) Try to get demangling of D symbols into upstream of the currently 
common linkers (GNU linker, gold, lld, etc.)


The GNU linker and gold support demangling D symbols, so if you are on 
linux try adding `-L--demangle=dlang` to the dmd commandline.


--
Mike Wey


Re: Named multi-imports

2017-08-16 Thread Mike Wey via Digitalmars-d

On 16-08-17 09:58, Gary Willoughby wrote:

On Tuesday, 15 August 2017 at 03:37:39 UTC, rikki cattermole wrote:

On 15/08/2017 2:59 AM, Johnson wrote:

Not only that, but it requires adding more files to the command line.

I currently have 3 import files to separate the gtk from gdk that and 
the only reason they exist is to combine them in to one named import ;/



Doesn't seem like much but that's 3 extra files that don't really 
need to exist.


Hopefully D already implements a way to do what I'm asking.


Or instead of a new language feature, the gtk-d guys could have 
package files ;)


This! Just create a PR for Gtk-D to add packages.


Wouldn't that just move the problem?

You then get an package that imports gtk.Window and a other package that 
imports gdk.Window, and if you want to use both you still need to add a 
renamed import or a static import in your own file.


--
Mike Wey


Re: NG technical issues: Is it just me?

2017-08-01 Thread Mike Wey via Digitalmars-d


On 21-04-17 19:03, Mike Wey wrote:

On 04/21/2017 10:27 AM, Vladimir Panteleev wrote:

On Thursday, 20 April 2017 at 23:37:25 UTC, Ali Çehreli wrote:
*Looks* like a server/network issue but behaves like a screwy local 
issue.


Started happening more in recent weeks.

I don't select automatic checking for messages. I just click on a 
newsgroup and it fails at differing rates. (Pretty good in the last 
couple of days.) When it fails, for me the cure is to click on 
another D newsgroup to make a successful connection and then come 
back to the failed one; then it always succeeds.


It would be helpful if someone could record a packet capture log (e.g. 
with Wireshark) of the problem. The information therein could be the 
first step towards diagnosing the problem.




Ok, here is an Wireshark export of the error and a few successful 
packets beforehand. Hopefully this gives some insight in whats going on.


https://drive.google.com/open?id=0B6DxRRR3v-n9QzhtZmNEbUQzWmM



The errors seem to be getting more frequent lately. But i nog also get 
these errors on the GtkD newsgroup (vibenews) so it might be a 
Thunderbird issue.


Is anybody getting the errors with a different client?

--
Mike Wey


Re: [your code here] Pure RPN calculator

2017-07-26 Thread Mike Wey via Digitalmars-d

On 26-07-17 16:40, Iakh wrote:

On Wednesday, 26 July 2017 at 09:46:45 UTC, Timon Gehr wrote:

 readln.split.fold!((stack,op){
 switch(op){
 static foreach(c;"+-*/") case [c]:
 return stack[0..$-2]~mixin("stack[$-2] "~c~" 
stack[$-1]");

 default: return stack~op.to!real;
 }
 })((real[]).init).writeln;


What does "case [c]:" mean?



In the static foreach c is a `immutable char` by putting it between [ 
and ] you create an array of immutable characters (string).


--
Mike Wey


Re: Let's paint those bikesheds^Werror messages!

2017-06-28 Thread Mike Wey via Digitalmars-d

On 28-06-17 01:34, Moritz Maxeiner wrote:


All these can even do true colors on Windows:
- 
https://blogs.msdn.microsoft.com/commandline/2016/09/22/24-bit-color-in-the-windows-console/ 



On Windows 10, and in that case you can even use the vt100 escape 
sequences: 
https://msdn.microsoft.com/en-us/library/windows/desktop/mt638032(v=vs.85).aspx



--
Mike Wey


Re: Phobos PR in need of review/merge

2017-06-27 Thread Mike Wey via Digitalmars-d

On 27-06-17 08:49, Walter Bright wrote:

You can also specifically request a review from one of Team Phobos:

https://github.com/orgs/dlang/teams/team-phobos/members

Just click on the [Reviwers] link.


Is that page private? I get an 404 error, and i can't find the page on 
github.


--
Mike Wey


Re: Replacing Make for the DMD build

2017-06-16 Thread Mike Wey via Digitalmars-d

On 06/16/2017 03:16 PM, Joakim wrote:
As for Meson, never dealt with it much, do you have an example for D 
code we can look at?


The meson files for tilix might be a good example:
https://github.com/gnunn1/tilix/tree/master/experimental/meson

--
Mike Wey


Re: DIP 1004 Preliminary Review Round 1

2017-05-03 Thread Mike Wey via Digitalmars-d

On 05/03/2017 05:09 PM, Andrej Mitrovic wrote:

On Wednesday, 3 May 2017 at 12:58:17 UTC, Daniel N wrote:
The trick is that your child class need to have defined at least 1 
constructor before the alias.


This should work:
this() {}
alias __ctor = super.__ctor;

This will give the error message you saw:
alias __ctor = super.__ctor;
this() {}


I see. It does look like an accidental feature (as in, that it could 
break in the future).


You could switch to:

```
this(A...)(auto ref A a)
{
import std.functional;
super(forward!a);
}
```

but that doesn't work with all the parameter storage classes.
lazy is no longer lazy for example.

--
Mike Wey


Re: NG technical issues: Is it just me?

2017-04-21 Thread Mike Wey via Digitalmars-d

On 04/21/2017 10:27 AM, Vladimir Panteleev wrote:

On Thursday, 20 April 2017 at 23:37:25 UTC, Ali Çehreli wrote:
*Looks* like a server/network issue but behaves like a screwy local 
issue.


Started happening more in recent weeks.

I don't select automatic checking for messages. I just click on a 
newsgroup and it fails at differing rates. (Pretty good in the last 
couple of days.) When it fails, for me the cure is to click on another 
D newsgroup to make a successful connection and then come back to the 
failed one; then it always succeeds.


It would be helpful if someone could record a packet capture log (e.g. 
with Wireshark) of the problem. The information therein could be the 
first step towards diagnosing the problem.




Ok, here is an Wireshark export of the error and a few successful 
packets beforehand. Hopefully this gives some insight in whats going on.


https://drive.google.com/open?id=0B6DxRRR3v-n9QzhtZmNEbUQzWmM

--
Mike Wey


Re: Seemingly patternless optlink premature termination

2017-01-09 Thread Mike Wey via Digitalmars-d

On 01/09/2017 08:05 AM, Walter Bright wrote:



There isn't even an Optlink specific bug list.


I found the list I posted by searching bugzilla for "optlink". If there
are any I missed, please let me know.


https://issues.dlang.org/show_bug.cgi?id=15418

Is there anything i should add to mark it as an optlink bug?

--
Mike Wey


Re: Using dlopen/dlsym

2016-12-27 Thread Mike Wey via Digitalmars-d

On 12/27/2016 06:02 AM, Adam D. Ruppe wrote:

On Tuesday, 27 December 2016 at 00:05:39 UTC, Andrei Alexandrescu wrote:

I'm building with no flags using dmd.


Do dmd -v for verbose output and see what linker flags it is doing.
Perhaps you have a configuration difference that is causing it not to
export the symbol (`fun` isn't marked `export`... I don't think that
matters on linux but it might on some versions or with some
configurations).


dmd will need to pass "--export-dynamic" to the linker, so that the 
symbol is actually exported.


--
Mike Wey


Re: GtkD Binaries

2016-08-12 Thread Mike Wey via Digitalmars-d

On 08/12/2016 09:03 AM, Sean Campbell wrote:

Does anyone know where i could find the DLLs not included in the gtk+
runtime installer for GtkD, as I don't have the necessary environment to
build the gtk+ runtime.

I have already located a copy of "libgtksourceview-3.0-1.dll" (Found it
on the pbone rpm archive).

I still need to find "libvte-2.91.dll" and a bunch of others.


The Binaries in the gtk+ installer used by GtkD are coming from MSYS2. 
So if your missing anything you could check there, although they don't 
have binaries for Vte.


GtkSourceview should have been included in the installer.

--
Mike Wey


Re: Gnome Builder IDE

2016-05-04 Thread Mike Wey via Digitalmars-d

On 05/04/2016 03:51 PM, WebFreak001 wrote:

On Monday, 2 May 2016 at 11:17:27 UTC, Karabuta wrote:

On Sunday, 1 May 2016 at 16:21:16 UTC, WebFreak001 wrote:

On Tuesday, 19 April 2016 at 16:29:41 UTC, Karabuta wrote:

Anyone tried this IDE for D coding? Seems to work pretty well. It
deserves some D attention.

https://wiki.gnome.org/Apps/Builder


I would make a plugin but it seems that you can't make external
plugins without recompiling builder from source yet



You should contact Hegert(the lead developer). I think that's what he
wrote in his blog. Try issues in the github repo.


ok I asked in the IRC right now. There is a plugins directory where it
dynamically loads it from. However nobody in there actually knew how to
do it with anything else than Python. Gonna try to get it to work somehow


There are a few plugins written in C in the gnome-builder git[1].

It seems you an static extern(C) function named "peas_register_types" to 
register your plugin. The plugins seem to implement one of the 
interfaces from gnome-builder/libide, but i haven't looked at the 
details of that.


[1]: https://git.gnome.org/browse/gnome-builder/tree/plugins

--
Mike Wey


Re: How can I report what I think a compiler's frontend bug

2016-03-20 Thread Mike Wey via Digitalmars-d

On 03/20/2016 11:37 PM, Vincent R wrote:

On Sunday, 20 March 2016 at 19:06:32 UTC, Johan Engelen wrote:

On Sunday, 20 March 2016 at 17:57:12 UTC, Vincent R wrote:

On Sunday, 20 March 2016 at 16:16:18 UTC, Marco Leise wrote:

Am Sun, 20 Mar 2016 11:28:19 +
schrieb Vincent R :


Hi,

I would like to start a new project (a bonjour/zeroconf wrapper
and a gui browser using it).
For the gui part I would like to use my existing skills using
wxWidgets wrapper (wxD).
So I have started to report a problem a few months ago:
https://forum.dlang.org/post/rtarlodeojnmedgsn...@forum.dlang.org

But so far(DMD32 D Compiler v2.070.2) it's still not fixed.
Do you think it will be fixed one day ?

Thanks


Yes, I think it will be fixed one day, since - as you know
by reading the very thread you linked - it is already reported
and the GDC developers chimed in and considered it critical.
There are also 118 open critical/blocker bugs that were
reported before yours. Most of them by people here on the
forums and you would need to explain to us why your bug
deserves higher attention than the others (154 in total).

Dlang is free open-source software and there is only a hand full of
people who are fixing bugs in the compiler just for the sake of
improving it. Most people contribute occasionally when they are
interested in a solution to a particular problem.

If you really need this fixed now ... you know the drill. I suggest
you analyze the problem and start a discussion about it. Honestly
asking why the compiler emits duplicate symbols in a reduced test
case might have yielded you some good responses from the people who
wrote the code.


Ok first maybe it's already reported to GDC but to me it's not only a
gdc bug since it also happens with dmd. So I don't know how bugs are
fixed in the differents compilers but I suppose they share the same
frontend (maybe I am mistaken) and in this case I prefer not to wait
for gdc developers to fix it but to see if for instance some dmd
developers have some time to fix it.
I just want to use the language and don't have time to dig inside its
inner workings, so I think D is not for me. This project was the
opportunity to learn the language by fixing an unmaintained library
(wxD) but it's not as easy as I thought.


What may speed-up bug fixing a lot is preparing a nice testcase that
is *as small as possible*.
As you can see in the bug report [1], there is already a testcase. It
is a good start, but it is not very minimal: contains a lot of
comments etc. That is a lot of distraction / bother (for me at least).
One way to help here is to minimize it further, and distill it down to
the essential thing that appears to trigger the bug. You can do that
without knowing any compiler internals.
It can be very time consuming to make such a testcase, which may
discourage developers fixing of your bug.

[1] https://issues.dlang.org/show_bug.cgi?id=15324


Ok I think I have found the problem, here is the testcase:

alias TreeItemId wxTreeItemId;
 public class TreeItemId : wxObject
 {
 public this(IntPtr wxobj)
 {
 super(wxobj);
 }

 private this(IntPtr wxobj, bool memOwn)
 {
 super(wxobj);
 this.memOwn = memOwn;
 }

 public this()
 {
 this(wxTreeItemId_ctor(), true);
 }

 public this(void* pItem)
 {
 this(wxTreeItemId_ctor2(pItem), true);
 }

 override protected void dtor() { wxTreeItemId_dtor(wxobj); }
 }

The problem is I think between public this(void* pItem) and public
this(IntPtr wxobj)
because from what I understand they are the same.
If I comment one of the two constructors it seems to remove the warning
about duplicated symbols. Now I need to understand what the original
author wanted to do by declaring these 2 constructors.



AFIAK IntPtr used to be a typedef from void*, this probably changed to 
an alias when typedef was deprecated.


--
Mike Wey


Re: Localization (i18n) Options

2016-01-18 Thread Mike Wey via Digitalmars-d

On 01/18/2016 04:06 PM, Luis wrote:

Were I can find the script to generate ddox for GtkD ?


https://github.com/gtkd-developers/GtkD/blob/master/makeddox.sh

--
Mike Wey


Re: Why doesn't mktspec() use clock_gettime?

2015-01-10 Thread Mike Wey via Digitalmars-d

On 01/10/2015 08:16 AM, ketmar via Digitalmars-d wrote:

On Fri, 09 Jan 2015 19:17:49 -0800
Andrei Alexandrescu via Digitalmars-d 
wrote:


On 1/9/15 6:13 PM, weaselcat wrote:

On Saturday, 10 January 2015 at 02:03:17 UTC, Andrei Alexandrescu wrote:

cc Sean Kelly

https://github.com/D-Programming-Language/druntime/blob/master/src/core/sync/config.d#L28


Looks like that use has been disable with static if (false). What was
the reason?

A coworker spent a few hours debugging a matter that pointed to this
issue. He removed the "false" and replaced CLOCK_REALTIME with
CLOCK_MONOTONIC in our druntime tree.

Any insight into the matter? How should we address it by supporting
multiple clock types portably?


Thanks,

Andrei


https://github.com/D-Programming-Language/druntime/commit/998739c


Thanks. What library would that be? Is it unavailable on some platforms?
If always available, couldn't we just link with it? -- Andrei

on older GNU/Linux systems it requires -lrt. it doesn't with relatively
new glibc (something that is 1.5 year old is ok, AFAIR), and i see no
reasons to be conservative here, but...



And on Linux we already link with librt anyway.

--
Mike Wey


Re: Invalid reference in a wikipedia - D related article

2014-12-09 Thread Mike Wey via Digitalmars-d

On 12/09/2014 04:34 PM, BBaz wrote:

I was writing some things when I suddently realized that the wikipedia page

http://en.wikipedia.org/wiki/Const_%28computer_programming%29

hyperlinks an invalid article:

"Here A Const, There A Const"
http://www.digitalmars.com/d/const.html

I let someone more aware fix it.


Looks like it was removed in this commit:;
https://github.com/D-Programming-Language/dlang.org/commit/995e538cea03d32764326f8cb45143f2dbe28194

--
Mike Wey


Re: GTKD2 GValue Type

2014-11-19 Thread Mike Wey via Digitalmars-d

On 11/19/2014 03:50 AM, Sergey wrote:

 Hello everyone!

I try to use gtkd + d in production, and of course I started with
gtk.TreeView and gtk.ListStore objects. But I encounter a problem with
GValyue type:

GValue[] array_values = cast(GValue[])["str1","str2","str3","str4"];
file_1.d(92): Error: e2ir: cannot cast "str1" of type string to type GValue
...

ListStore1.setValuesv(itr, [0,1,2,3], "str1","str2","str3","str4");
file_1.d(98): Error: function gtk.ListStore.ListStore.setValuesv
(TreeIter iter, int[] columns, GValue[] values) is not callable using
argument types (TreeIter, int[], string, string, string, string)

GValue ggg = cast(GValue)"123";
file_1.d(78): Error: cannot cast from string to GValue

GValue ggg = "123";
file_1.d(79): Error: cannot implicitly convert expression ("123") of
type string to GValue

How to deal with this type?

thanks in advance.


If it's really just strings you can use;
ListStore1.setValues(itr, [0,1,2,3], ["str1","str2","str3","str4"]);

Otherwise you'll need to make multiple calls to ListStore.setValue.

For setValuesv there is an error in the generated code it should except 
an array of gobject.Value, in stead of the the C equivalent.


--
Mike Wey


Re: rpath options to linkers, OSX issue

2014-09-07 Thread Mike Wey via Digitalmars-d

On 09/06/2014 05:51 PM, Russel Winder via Digitalmars-d wrote:

Ariovistus originally reported Issue 2940 against SCons and the D
toolset (http://scons.tigris.org/issues/show_bug.cgi?id=2940). The gdc
tool uses "-Wl,-rpath=." in the gdc command to set the rpath for gdc.
The dmd tool uses "-L-rpath=." in the dmd command to set the rpath for
dmd.

This all works fine on Linux. I haven't managed to find a way to test
this on Windows.

It seems for the first time (which surprised me as I thought I had
checked this), I am running the tests on OSX and "-L-rpath=." generates
"-rpath=." to the ld which is Clang and it rejects this option.

I am assuming the problem is in my OSX set up and not in what dmd is
doing. I get dmd via MacPorts, it is v2.066-devel.

Is there an OSX user out there having no problem with dmd and dynamic
libraries I can prevail upon to give me a hand with this?


Windows doesn't support rpath or something like it, the best alternative 
there would be using "SetDllDirectory" or "AddDllDirectory" in the 
executable.


For OSX this might help: 
http://stackoverflow.com/questions/4513799/how-to-set-the-runtime-path-rpath-of-an-executable-with-gcc-under-mac-osx



--
Mike Wey


Re: Linker not working under dmd

2014-04-05 Thread Mike Wey

On 04/05/2014 02:28 AM, Adam D. Ruppe wrote:

I had this problem too with the new dmd version on a CentOS server.

My solution was to link it manually. First, run your dmd command with -v
at the end to get the verbose output. The last line it outputs will be
the linking command.

Copy/paste that and find where it does the -l:phobos2 or whatever it
exactly looks like. Delete it and instead use plain -lphobos2, no weirdo
colon.

Then it should work. I changed my makefile to always compile and link
separately on that box so I wouldn't have to worry about it later.


Or add "-defaultlib=phobos2" to dmd.conf


(i also had to recompile phobos on that box because the libc was too old
for the qsort_r druntime now uses. If you have that problem too, let me
know and I'll tell you what I did.)


--
Mike Wey


Re: visual c++ licensing issues

2013-12-23 Thread Mike Wey

On 12/22/2013 10:43 PM, Brad Anderson wrote:

On Sunday, 22 December 2013 at 21:14:54 UTC, Stephen Jones wrote:

Isn't there a problem using Microsoft's visual studio to link for 64
bit in that visual studio 2013 is free only for enrolled students?


Recent versions of Visual Studio Express (which is free for
everyone) should work fine.


Just installing the Windows SDK is enough to build 64bits D applications.

--
Mike Wey


Re: forum.dlang.org moved to a new server

2013-12-22 Thread Mike Wey

On 12/22/2013 03:12 PM, Vladimir Panteleev wrote:

I suppose that DFeed could have its own NNTP server (similarly to what
Vibe.news does), allow logging in with the forum username/password, and
mark messages downloaded via NNTP as "read" in the web interface...


Don't forget to extend the NNTP protocol to include this information, 
and then get Thunderbird to support it ;)


--
Mike Wey


Re: Gtkd-2

2013-11-13 Thread Mike Wey

On 11/13/2013 09:51 AM, Mike James wrote:

"Steve Teale"  wrote in message
news:sbthddptgdozwiivi...@forum.dlang.org...

I'd like to publicly thank and commend Mike Wey for his hard work and
perseverance on Gtkd.

It is now fully up-to-date with GTK3, and with it and D, writing GUI
programs has rarely if ever been easier.

If you have not been there recently - http://gtkd.org.

Thanks Mike.


+1

Is it about time to replace digitalmars.D.dwt forum with a
digitalmars.D.GtkD one and make it the official Gui for D?

-=mike=-


Well, don't jinx it ;)

--
Mike Wey


Re: Undefined reference to _d_throw

2013-11-03 Thread Mike Wey

On 11/02/2013 10:08 PM, Jacob Carlborg wrote:

On 2013-11-02 21:12, Steve Teale wrote:


CodeBlocks is supervising the compilation. I had added the libraries to
its recipe in the wrong order:

pthread
m
phobos2

The opposite way round it links OK, bu there's still something strange
going on. When I try to run it, it fails with:

./compo: error while loading shared libraries: libphobos2.so.0.2: cannot
open shared object file: No such file or directory

This is true, there is no such file. In /usr/lib/i386-linux-gnu there's
only libphobos2.so - a real file - which in my understanding should be a
link to an actual shared library file.

Is there a working shared Phobos library in 2.063, or is this a .deb
file error. If I have /usr/lib/i386-linux-gnu/libphobos.a instead of
phobos2, the program links and at least attempts to run. It may crash
later, but that's my fault.

This is not just a CodeBlocks thing. I made a simple makefile instead
that links the libraries in the right order. That links, but also fails
with the missing Phobos shared library error.


Shared libraries are quite a new thing in D. I'm pretty sure it's
supposed to link with the static library by default. Usually you can
force linking with a static library by doing
-L-l:/path/to/staticlibrary.a. Note the colon in the beginning of the
path. Although I don't know if you can do that with Phobos. It seems
like CodeBlocks is doing something strange here.



You could try putting:

:libphobos2.a

in the list of libraries for CodeBlocks, as it doesn't require the full 
path.


--
Mike Wey


Size of float_t

2013-10-26 Thread Mike Wey

I need to interface with an C lib that uses float_t and double_t.
Druntime provides aliases for these in core.stdc.math but it aliases 
then to float and double respectively.


Now on 64-bits Linux (Arch) this work without any problems, but on a 
32-bits copy of ArchLinux both float_t and double_t are defined as long 
double.


This can be observed by running the following C code on both systems:

```
#include 
#include 

int main(int argc,char **argv)
{
printf("%i ", sizeof(float_t));
printf("%i ", sizeof(float));
printf("%i ", sizeof(double_t));
printf("%i \n", sizeof(double));
}
```
Prints 4 4 8 8 on 64-bits ArchLinux.
And 12 4 12 8 on 32-bits ArchLinux.


Does anybody know if float_t and double_t being long doubles is common 
among 32-bits Linux distros, or if it may depend on the compiler 
version, processor type or something else?


--
Mike Wey


Re: D2 is really that stable as it is claimed to be?

2013-09-22 Thread Mike Wey

On 09/22/2013 12:36 AM, Walter Bright wrote:

On 9/21/2013 3:11 PM, Maxim Fomin wrote:

On Saturday, 21 September 2013 at 22:06:07 UTC, Walter Bright wrote:

On 9/21/2013 2:40 PM, Maxim Fomin wrote:

Thanks, that is clear. Unfortunately, I cannot say that the
explanation improves
my attidute to the language - dmd still breaks too often code and some
significant features (like AAs, scope, shared) are at risk to be
seriously
changed which is a serious problem to the user.


I'm curious - was there a logic bug in your code with the overflow,
or had
that been the intended behavior?


This was bug in gtkd sources when I tried to compile its most recent
version
(tried even from github) with git-head dmd. I think it is a problem of
gtkd
developers rather than dmd.


Ok, so it found a latent bug in the source code - I don't think that's a
good example of dmd being unstable - it was a good change.


I've reduced the code causing the error to this:
```
public enum GTokenType
{
NONE,
}

public enum GtkRcTokenType
{
INVALID = GTokenType.NONE,
INCLUDE,
}
```

In this case the value of INVALID + 1 isn't large enough the overflow an 
int.


In the actual code:
https://github.com/gtkd-developers/GtkD/blob/master/src/gtkc/glibtypes.d#L1310
Setting NONE to a value lower than 87 makes it so the code compiles 
without error, which only makes things weirder.


--
Mike Wey


Re: GtkD

2013-08-11 Thread Mike Wey

On 08/11/2013 10:19 AM, Russel Winder wrote:

On Sat, 2013-08-10 at 23:01 +0200, Mike Wey wrote:
[…]

The linker probably can't find the GtkD library.


I have tried using dmd and ldc with a -L-L/path/to/library and gdc with
-L/path/to/library but get subtly different error messages. Certainly
all the unfound references are _D... ones so I assume they are D
references.


On linux if you used "make install" to install the GtkD libraries you
could use pkg-config:

dmd $(pkg-config --cflags --libs gtkd-2) MyApp.d


Well putting the PGK_CONFIG_PATH in so as to find the .pc file, this
give very large numbers of errors. The first three are:

 helloWorld_d_gtkd.o:(.data+0xb0): undefined reference to 
`_D3gtk10MainWindow12__ModuleInfoZ'
 helloWorld_d_gtkd.o:(.data+0xb8): undefined reference to 
`_D3gtk5Label12__ModuleInfoZ'
 helloWorld_d_gtkd.o:(.data+0xc0): undefined reference to 
`_D3gtk4Main12__ModuleInfoZ'

from then everything is internal to libgtkd-2.a not having references.
This means though that it has found libgtkd-2.a so. An example:

/home/users/russel/lib.Linux.x86_64/GtkD/lib//libgtkd-2.a(ObjectG.o):(.data+0xb0):
 undefined reference to `_D4gtkc7gobject12__ModuleInfoZ'

All of them appear to be a lack of ModuleInfoZ as far as I can tell,
which may make this an obvious problem?


Unfortunately that doesn't make it obvious. Could you check the exact 
name of the ModuleInfo in the library?


nm --defined-only libgtkd-2.a | grep ModuleInfo | grep gobject | grep gtkc


Will gdc be able to cope with:

PKG_CONFIG_PATH=$HOME/lib.Linux.x86_64/GtkD/share/pkgconfig pkg-config
--cflags --libs gtkd-2

-I/home/users/russel/lib.Linux.x86_64/GtkD/include/d/gtkd-2/
-L-L/home/users/russel/lib.Linux.x86_64/GtkD/lib/ -L-lgtkd-2 -L-ldl

These look appropriate to DMD and LDC but not GDC, and in a Linux
context GDC is likely the compiler of choice.


When the GtkD library is compiled with gdc the .pc file will contain the 
appropriate flags for gdc.



Is there an issue of you have to use the same compiler to link code to
libraries as was used to build the libraries in the first place?  This
is not the issue here as I get the same problem for all three compilers,
some else is wrong possibly as well.



The different compilers aren't binary compatible so you will need to use 
the same compiler to build the lib and the application.


for linking its usually best to also use the compiler, using ld directly 
is an option but you'll then need to add the flags and libraries the 
compiler adds to the command yourself.



On Windows you will need to list gtkd.lib on the commandline with it's
relative or absolute path.


What's Windows?  ;-)


:)

--
Mike Wey


Re: GtkD

2013-08-10 Thread Mike Wey

On 08/10/2013 05:46 PM, Russel Winder wrote:

I have built and installed GtkD from master/HEAD of a clone of the Git
repository. At least I hope it is successful!

A simple hello world in a label application is the trial. Sadly I get
pages and pages of linker errors. Is there a canonical command line to
build a single file applications that someone can tell me so I can try
it.

Thanks.



The linker probably can't find the GtkD library.

On linux if you used "make install" to install the GtkD libraries you 
could use pkg-config:


dmd $(pkg-config --cflags --libs gtkd-2) MyApp.d

On Windows you will need to list gtkd.lib on the commandline with it's 
relative or absolute path.


--
Mike Wey


Re: Error after installing DMD v2.063

2013-06-03 Thread Mike Wey

On 06/03/2013 08:25 PM, Russel Winder wrote:

Also there should be a symbolic link libphobos2.so.0 shouldn't there?


At some point yes, the minor version should be dropped from the 
so/symlink used by the application and is set as the soname.
But i would wait for phobos/dmd to stabilize, so there whould be no need 
to increase the so version every release.


--
Mike Wey


Re: Arch AUR DMD missing?

2013-06-03 Thread Mike Wey

On 06/02/2013 10:50 PM, Dicebot wrote:

On Sunday, 2 June 2013 at 14:04:51 UTC, simendsjo wrote:

What happened to the DMD package in Arch AUR?
New name or something? Does anyone have a link to the package?


It has been moved to main repos for quite a while now, something about
half an year or even more. If you want to have a look at PKGBUILD used
or build manually -
https://github.com/Dicebot/Arch-PKGBUILDs/tree/master/dmd (it will be
used for 2.063 unless official maintainer finds some issues there)


The versioned so's seem to be missing from phobos.

--
Mike Wey


Re: Error after installing DMD v2.063

2013-06-03 Thread Mike Wey

On 06/03/2013 01:30 AM, Ellery Newcomer wrote:

On 06/02/2013 04:12 PM, Russel Winder wrote:

On Sun, 2013-06-02 at 16:03 -0700, Ellery Newcomer wrote:
[…]

$ objdump -p libphobos2.so | grep SONAME
SONAME   libphobos2.so.0.63


Exactly, the actual file should have the fully qualified soname and all
other filenames should be symbolic links to that file. Currently the DMD
deb reverses this and therefore violates the standard for deb
installation.



actually, your resource above says that the soname should have the format

lib{lib}.so.X

and the real name should have the format

lib{lib}.so.X.Y.Z

where

X = version number
Y = minor version number
Z = release number

so the generated .so itself violates the standard.


Currently the Phobos make file generates: libphobos2.so.0.63.0 and 
creates two simlinks libphobos2.so and libphobos2.so.0.63, and sets the 
soname to libphobos2.s0.0.63.


The soname currently includes the minor version number because the 
compatibility currently breaks every release, when the phobos abi is 
more stable it should be removed from the soname.


--
Mike Wey


Re: Long symbol names (Was: demangle doesn't work with...)

2013-05-29 Thread Mike Wey

On 05/29/2013 09:09 AM, Johannes Pfau wrote:

We only have to do the library versioning right.


The phobos make file currently builds libphobos2.so.0.63.0 and uses 
libphobos2.so.0.63 as the soname. So an app linked with the shared 
phobos will be using libphobos2.so.0.63, the .63 comes from the 
dmd/phobos version and can be dropped when the ABI is stable.


--
Mike Wey


Re: [ gtkD ] Question about mouse press event in Notebook ...

2013-04-24 Thread Mike Wey

On 04/24/2013 08:43 AM, Super66Super wrote:

Sorry, you don't understand me.

I want something like this:

ACII ART

I know that function addOnButtonPressd() prevents change the order of
the tabs ...

Did you have any idea ?

Thanks for your time.


I see what you mean, using the enterNotify and leaveNotify events you 
can track if the mouse is over an tab and skip the mousePress event.

The tab label do need to be wrapped in an EventBox for this to work.

http://dpaste.dzfl.pl/3bb9ab78

--
Mike Wey


Re: [ gtkD ] Question about mouse press event in Notebook ...

2013-04-23 Thread Mike Wey

On 04/23/2013 08:13 AM, Super66Super wrote:

"The begingMoveDrag call in mousepressevent makes it so that you drag
the window around when holding the left mouse on on of the tabs. And
that prevents you from reordering the tabs."
I understand, thanks for the valuable information.

"What are you trying to achieve with mousepressevent?"
I want to:
*have undecorated window with Notebook - ok, no problem
*reorderable tabs - ok, no problem
*begin move window when press on Notebook - I need that


You will need to add the event handler to the containers you are addin 
to the page. And in the case of the small example you posted, where you 
add only a single Label to the page it needs to be wrapped in an 
EventBox. Is far as i know that shouldn't be necessary when you are 
adding an other container to the page.


http://dpaste.dzfl.pl/adc350a4


Can I check if the mouse is above a tab in Notebook with mouse move /
motion event ?
If I could do it, then I can put a condition that checks it and assigns
a value to a Boolean variable.
Thus, in the event of pressing the left mouse button I check this
variable and dependent on this I can move a window or not.



--
Mike Wey


Re: [ gtkD ] Question about mouse press event in Notebook ...

2013-04-22 Thread Mike Wey

On 04/22/2013 10:48 PM, Super66Super wrote:

"Look how this issue could be solved for 'general' gtk+. As GtkD is a
wrapper on gtk+, the answer to your question should not be D-specific."

Hmmm ...
Thanks, but I'm not sure is it a real bug.

"If you are not doing so already, try returning false from the function
you pass to addOnButtonPress so it doesn't stop the event from
propagating."

Better ...
But it isn't exactly solved my problem ...

I created a simple window without decorations, and I added the Notebook
to the window.
I want to add the ability to move the window after capturing the left
mouse button press event on Notebook.

When I return true I can only move window.
When I return false I can move window and switch between tabs.
I can't reorder my tabs. I can do it after comment out the line with
addOnButtonPress ().

My code is:
http://pastebin.com/dz6XZZj6
Compiled successful ...

Is it a bug ?
I think it's my mistake ...

P.S.
Sorry for my English.

Thanks for your help.


The begingMoveDrag call in mousepressevent makes it so that you drag the 
window around when holding the left mouse on on of the tabs.

And that prevents you from reordering the tabs.

What are you trying to achieve with mousepressevent?

--
Mike Wey


Re: [ gtkD ] Question about mouse press event in Notebook ...

2013-04-22 Thread Mike Wey

On 04/22/2013 12:05 PM, Super66Super wrote:

I'm programming in gtkD on Funtoo Linux.
I want to catch mouse press event in Notebook, but I would like to don't
touch the tabs and their contents.
I'm using function: addOnButtonPress () in Notebook,
but after that the tabs aren't reorderable ( previously yes ).
Or similarly, how to catch mouse events only on the selected window /
widget without touching it's children.
Thanks for any help.


If you are not doing so already, try returning false from the function 
you pass to addOnButtonPress so it doesn't stop the event from propagating.


--
Mike Wey


Re: Vote for std.process

2013-04-12 Thread Mike Wey

Yes.

--
Mike Wey


Re: Make dur a property?

2013-01-23 Thread Mike Wey

On 01/23/2013 09:33 PM, Jacob Carlborg wrote:


This is how it should look like. Date ranges in Ruby on Rails can be
really beautiful:

date = 2.days.ago

I think we should have the same in D.


As long as your not using -property:
http://dpaste.dzfl.pl/56960911

--
Mike Wey


Re: DMD build

2012-12-29 Thread Mike Wey

On 12/28/2012 10:39 PM, Brad Roberts wrote:

What impact does this have on the open pull requests?  If it's going to
suddenly break every one of them, then I think it's a particularly bad
idea.  The benefit is debatable and the cost is pretty annoying.


You could always pull some of the requests into your local copy to check 
if it's causing a lot of conflicts or not.


--
Mike Wey


Re: New std.process revival

2012-12-10 Thread Mike Wey

On 12/09/2012 07:34 PM, Andrej Mitrovic wrote:

I'm having a hard time figuring out how to "fork" your own fork, IOW I
have no idea how to make pull requests towards your own fork of
phobos. Your name doesn't show up in the base repo dropdown list when
I try to make a pull, otherwise I'd be of more help.


Create a new branch, AFAIK you can create pull requests between 
different branches of the same repo.


--
Mike Wey


Re: Status of wxD?

2012-12-07 Thread Mike Wey

On 12/07/2012 10:07 PM, Nick Sabalausky wrote:

Anyone know the status of wxD?

Is this page correct in its implication that it's primarily D1 and
stalled since DMD 1.030?:

http://wxd.sourceforge.net/



The source has been moved to github.
https://github.com/afb/wxd

Which indicates DMD 2.054 / 1.064 as the compilers that were used around 
the time of the last release.


--
Mike Wey


Re: wrapping functions with variadic-parameter wrappers

2012-12-05 Thread Mike Wey

On 12/05/2012 04:40 PM, Gor Gyolchanyan wrote:

A function with variadic template parameters is just a function which
takes a set of compile-time known parameters.
My goal is to have a non-template function taking variadic parameters.

long bar(...)
{
 return foo(...);
}

This is necessary to be able to pass variables to functions without
knowing the type of the functions.


--
Bye,
Gor Gyolchanyan.


Something like this?

long bar(...)
{
if( _arguments[0] == typeid(int) && _arguments[1] == typeid(char) )
{
return foo(va_arg!(int)(_argptr), va_arg!(char)(_argptr));
}
else
throw;
}

--
Mike Wey


Re: Array Operations: a[] + b[] etc.

2012-11-22 Thread Mike Wey

On 11/22/2012 01:10 PM, John Colvin wrote:

On Wednesday, 21 November 2012 at 19:40:25 UTC, Mike Wey wrote:

If you want to use this syntax with images, DMagick's ImageView might
be interesting:
http://dmagick.mikewey.eu/docs/ImageView.html


I like it :)
 From what I can see it provides exactly what i'm talking about for 2D.
I haven't looked at the implementation in detail, but do you think that
such an approach could be scaled up to arbitrary N-dimensional arrays?


Every dimension has it's own type, so it won't scale well to a lot of 
dimensions. When sliceing every dimension would create an temporary.


--
Mike Wey


Re: Array Operations: a[] + b[] etc.

2012-11-21 Thread Mike Wey

On 11/21/2012 07:02 PM, John Colvin wrote:

//An example, lets imagine a greyscale image, stored as an array of
pixel rows:

double[][] img = read_bmp(fn,"grey");

//we want to crop it to some user defined co-ords (x1,y1),(x2,y2):

//Version A, current syntax

auto img_cropped = img[y1..y2].dup;
foreach(ref row; img_cropped) {
 row = row[x1..x2];
}
//3 lines of code for a very simple idea.

//Version B, new syntax

auto img_cropped = img[y1..y2, x1..x2];

//Very simple, easy to read code that is clear in it's purpose.

I propose that Version B would be equivalent to A: An independent window
on the data. Any reassignment of a row (i.e. pointing it to somewhere
else, not copying new data in) will have no effect on the data. This
scales naturally to higher dimensions and is in agreement with the
normal slicing rules: the slice itself is independent of the original,
but the data inside is shared.

I believe this would be a significant improvement to D, particularly for
image processing and scientific applications.


If you want to use this syntax with images, DMagick's ImageView might be 
interesting:

http://dmagick.mikewey.eu/docs/ImageView.html

--
Mike Wey


Re: Multidimensional array operator overloading

2012-11-19 Thread Mike Wey

On 11/19/2012 07:04 PM, H. S. Teoh wrote:

I'm experimenting with implementing "true" multidimensional arrays in D.
It's actually very nice, compared with the hassle of memory management
in C/C++, and it even lets you give opIndex multiple parameters so that
you can write things like arr[1,2] instead of the uglier arr[1][2] (or
worse, arr[2][1]).

Two questions, though:

1) Is multidimensional slicing supported? I.e., does opSlice support
notation like arr[1..2, 2..3]?


This is currently not supported. Would be nice to have tough.


2) Is opDollar supported for multidimensional arrays? I.e., when you
write arr[1..$, 2..$], the $ in each dimension can potentially be
different values (say you have a 2x3 array, so the first $ is 2, and the
second $ is 3)?


size_t opDollar(int dim)()
{

}

Where dim is the dimension in witch the $ is being used.


D will totally rock if these features are supported.


T



--
Mike Wey


Re: [GtkD] Error 1: Previous Definition Different : __Dmain

2012-10-28 Thread Mike Wey

On 10/27/2012 10:18 PM, "Adrien Tétar" " wrote:

On Saturday, 27 October 2012 at 20:02:16 UTC, Mike Wey wrote:


Did you already check if your code doesn't actually defines main twice?


I don't think so... here's the code:

module primary;

import gtk.Main;

void main(string[] args)
{
 Main.init(args);
 Main.run();
}

Thanks for your help.


Did you run the dgen executable from the src directory, otherwise it 
might be possible that some of the demos got compiled into the library.


--
Mike Wey


Re: [GtkD] Error 1: Previous Definition Different : __Dmain

2012-10-27 Thread Mike Wey

On 10/27/2012 05:33 PM, "Adrien Tétar" " wrote:

Hi,

I have compiled GtkD 2.0 on Windows. Source files are passed to the
compiler as well as library to the linker.
I followed instructions from here :
https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows

But there is an error appearing when GtkD.lib is passed to the linker:
Error 1: Previous Definition Different : __Dmain

This is supposed to mean that there are two main function in the code,
but how do I fix it ?

Thanks in advance.

PS: I use DMD 2.060.


Did you already check if your code doesn't actually defines main twice?

--
Mike Wey


Re: make install; where do .di files go?

2012-10-17 Thread Mike Wey

On 10/17/2012 05:39 PM, Jordi Sayol wrote:

Al 17/10/12 14:03, En/na Manu ha escrit:


why include/d2? include/d/ seems much better... what are the chances a library 
have both a d1 and d2 version which may conflict in include/d?



A practical example:
Imagine that you installs the libray "foo" for D, and places the sources at 
"/usr/include/d/foo" directory, so you need to add "-I/usr/include/d" as compiler 
argument.

In Debian/Ubuntu there is the "libtango-headers" package, which install, among others, 
"/usr/include/d/object.di". This Tango "object.di" breaks d2, so you will not be able to compile anything 
with the "-I/usr/include/d" argument, and so, you cannot compile against your "foo" library.

The problem here is that the "libtango-headers" maintainer decided to place "object.di" 
directly into "/usr/include/d", overriding to use this directory for any other D compiler/version.



Is there any chance of getting the package changed?

--
Mike Wey


Re: make install; where do .di files go?

2012-10-16 Thread Mike Wey

On 10/16/2012 06:55 PM, Manu wrote:

Okay, I don't feel like my question is any clearer...

Why wouldn't you want a standard shared include path?
/usr/include works great for C, I don't see why there wouldn't be
something like that for D for compiler-agnostic 3rd party libs.

But my question is, where do I install includes? I'm not really a linux
user, I just want someone to tell me where to put it :) .. and if there
isn't a direct answer, then perhaps that's a problem that needs to be
addressed?


/usr/[local/]include/d seems to be the most common, and it should work 
great for compiler-agnostic libs.
But for the standard library like D1-Tango mentioned earlier it probably 
isn't the right place.


--
Mike Wey


Re: Creating a shared library under Linux?

2012-07-29 Thread Mike Wey

On 07/29/2012 02:34 PM, Jens Mueller wrote:

Mike Wey wrote:

I've successfully build GtkD as a shared library using LDC using the
following steps:

Compiling the source files with fPIC:
ldc -O -m64 -relocation-model=pic -Isrc -c (source file)

Combine all the GtkD object file into one big object file:
ld -r (all GtkD object files) -o output.o

Create the shared lib using LDC:
ldc -shared output.so -L-soname=(so version) output.o


Thanks a lot.
This does work if the last command is changed to
ldc2 -shared -of=output.so -L-soname=1 output.o
and ldc was built using -DBUILD_SHARED_LIBS=ON.

Jens




I looks like i didn't get the soname quite right, it should have been:
ldc -shared output.so -L-soname=output.so.(so version) output.o


the soname is the name of the library ld will try to load at program 
startup. if you are not going to use to typical linux approach of 
setting up symlinks to get both a versioned and a unversioned lib in the 
filesystem. Then you don't have to specify a somane as the default 
soname is the name of the lib.


--
Mike Wey




Re: Creating a shared library under Linux?

2012-07-27 Thread Mike Wey

On 07/27/2012 09:33 AM, Alex Rønne Petersen wrote:

On 27-07-2012 09:31, Jens Mueller wrote:

Alex Rønne Petersen wrote:

On 27-07-2012 07:23, Jens Mueller wrote:

Hi,

I've read several threads that about creating shared libraries. But I
could not make it work.
Does anybody know how to create a shared library? I don't care which
compiler I have to use to accomplish it.

Jens



Well, all three compilers (DMD, GDC, LDC) can create shared
libraries at this point. But DMD doesn't actually ship libphobos2
(druntime+phobos) as a shared library yet, so this is not going to
work out so well. If, however, you don't use stock libphobos2, you
can pass -shared -fPIC to create a shared library.


But I can build druntime+phobos as shared libraries and then it should
work with dmd?


No, exceptions and TLS will still be broken, and the runtime doesn't
know how to deal with shared libraries as they are loaded, so the GC
might break in funny ways.




GDC and LDC, as far as I know, can both create shared libraries. GDC
does it with the standard options you'd pass to GCC. LDC's command
line is very similar to DMD's if memory serves.


I tried both gdc and ldc but failed. I will write more specifically what
I did later.


But (another one!): druntime is not yet ready to handle shared
libraries properly. This means that exceptions thrown across library
boundaries, TLS, etc are not likely to work properly.


I think I can avoid all of these limitations.


Well, so long as you don't use exceptions and TLS, it might work. But I
wouldn't recommend relying on it.




So, in short: If you're using stock libphobos2, don't bother. If
you're not using stock libphobos2, you can probably trivially create
shared libraries.


I see. Then I will try to build a shared libphobos2 first.
Many thanks.

Jens







I've successfully build GtkD as a shared library using LDC using the 
following steps:


Compiling the source files with fPIC:
ldc -O -m64 -relocation-model=pic -Isrc -c (source file)

Combine all the GtkD object file into one big object file:
ld -r (all GtkD object files) -o output.o

Create the shared lib using LDC:
ldc -shared output.so -L-soname=(so version) output.o

--
Mike Wey




Re: Vote for std.uuid

2012-06-21 Thread Mike Wey

Yes.

--
Mike Wey




Re: valid uses of shared

2012-06-09 Thread Mike Wey

On 06/09/2012 04:01 AM, mta`chrono wrote:

Would this be legal?

class A
{
  private static shared int counter; // shared across all instances

  this()
  {
   auto i = ++counter;
   pragma(msg, typeof(i)); // prints int
  }
}



Would it also be legal if the variable wasn't static?

int opApply(int delegate(ref Pixels) dg)
{
shared(int) progress;

foreach ( row; taskPool.parallel(iota(extent.y, extent.y + 
extent.height)) )

{
int result = dg(Pixels(image, extent.x, row, extent.width, 1));

if ( result )
 return result;

if ( image.monitor !is null )
{
atomicOp!"+="(progress, 1);
image.monitor()("ImageView/" ~ image.filename, progress, 
extent.height);

}
    }
    return 0;
}

--
Mike Wey


Re: Ddoc and manifest constants

2012-05-30 Thread Mike Wey

On 05/30/2012 12:52 AM, Alex Rønne Petersen wrote:

On 30-05-2012 00:35, Jonathan M Davis wrote:

On Tuesday, May 29, 2012 21:42:29 Alex Rønne Petersen wrote:

Hi,

Is it by design that Ddoc does not emit documentation for manifest
constants, or is it a bug? I'd really like to have documentation for
some public manifest constants in my code, and I can't really think of a
reason why Ddoc shouldn't handle them.


I'd definitely argue that any public declaration outside of a function or
unittest block which has a ddoc comment on it and is compiled in (e.g.
not
part of another version block or static if) should appear in the
generated
ddoc. If there's one that doesn't, it's a bug.

- Jonathan M Davis


OK, filed: http://d.puremagic.com/issues/show_bug.cgi?id=8160



There doesn't seem to be any problem with dmd 2.095 (Linux 64bits).

This code:
/// Defines the version of ImageMagick where these headers are based on.
enum MagickLibVersion = 0x677;
///ditto
enum MagickLibVersionText = "6.7.7";

Results in the folowing documentation:
file:///home/mike/Projects/DMagick/docs/c/magickVersion.html

--
Mike Wey


Re: dmd link mystery on linux

2012-05-20 Thread Mike Wey

On 05/20/2012 01:58 AM, John Belmonte wrote:

I'm having a problem where the link command line generated by dmd is
picking up the globally-installed version of the phobos library instead
of my local one. I'm using a dmd.conf pointing at my local phobos build
so this shouldn't be happening. From output of "dmd rdmd.d -v":

gcc rdmd.o -o rdmd -m64 -Xlinker
-L/home/john/dev/d/phobos/generated/linux/release/64 -lphobos2 -lpthread
-lm -lrt

which looks right to me (referenced dir contains libphobos2.a). I know
this is picking up the wrong phobos2 because the globally-installed
version is missing some required symbols. If I move the global .a out of
the way my local lib is picked up and the link and subsequent run are fine.

More strangely, if I remove -Xlinker from that link line my local lib is
again picked up. From my understanding, omitting -Xlinker causes gcc to
interpret the -L option natively. Does anyone know why this would make a
difference, or can anyone point out what I'm missing?

Also, I'm wondering if anyone else would find it useful for the
update.sh tool to automatically generate a dmd.conf which points to the
local druntime and phobos.



On my system it looks like the order of the commands passed on to ld 
differ depending on if -Xlinker is used.
gcc passes some default paths to the linker like: -L/lib/ and 
-L/usr/lib/, now commands passed on to the linker with -Xlinker are 
added after these paths, while if you don't use -Xlinker the path is 
passed before the default paths.


So if your global phobos lib is installed in /lib or /usr/lib it will be 
picked up by the linker if it searches those directories before the one 
that contains the local one. The search order for ld depends on the 
order in which they appear on the commandline.


--
Mike Wey


Re: GTK and D

2012-04-22 Thread Mike Wey

On 04/22/2012 05:45 PM, Russel Winder wrote:

What is the way of checking  access if not via a browser?  Using the
source.list entry:

deb http://d-apt.googlecode.com/files ./

I get the result:

Failed to fetch http://d-apt.googlecode.com/files/./Packages  404  Not
Found



Odd trying to download http://d-apt.googlecode.com/files/./Packages with 
a browser or wget completes without any errors.


--
Mike Wey


Re: GTK and D

2012-04-22 Thread Mike Wey

On 04/22/2012 04:51 AM, Russel Winder wrote:

I guess a heads up for folk working on D bindings to GTK+:

http://www.gtk.org/language-bindings.php

Indicates D has bindings to 2.12, 2.14, 2.16, 2.18, 2.20 and 2.22, but
not 2.24 and, most problematically, not 3.0.


Git/svn currently binds GTK 2.24.
But 3.0 and up is indeed not supported jet.


The link from this page points at:
http://www.dsource.org/projects/gtkd. (It is interestingly ironic that
this tells Linux users to have the latest GTK+ libraries installed given
the data from the previous paragraph ;-)


Up untill the GTK 3.0 release using GtkD with an newer release didn't 
cause any problems, i've changed it to latest 2.x release.



On the other hand it seems that https://github.com/gtkd-developers/GtkD
is the actual home, but I am not sure there is a reference to this on
the dsource page.


Both pages are up to date.


Being a Debian user I was interested in https://code.google.com/p/d-apt/
but it seems the instructions for using this break since
http://d-apt.googlecode.com/files results in a 404.  Also I am assuming
it is an oversight that Tango-D2 is packaged but Phobos is not?



While you can't view the directory with a browser, all the needed files 
are accessible.


And i think Phobos is in the dmd package.

--
Mike Wey


Re: dmd's linking order

2012-04-11 Thread Mike Wey

On 04/11/2012 09:54 PM, eles wrote:

if you tried to link:

gcc my_program.o -lB -lA (so, in reverse order)


read:

gcc my_program.o -lB -lA (so, in unnatural order)



this looked a bit like:

gcc my_program.o -lA -lB


read:

"it looked like the order is arbitrary"



BUT what really happened was that the true link command was now:

gcc my_program.o -lA -lB -lC -lB


read:

gcc my_program.o -lB -lA -lB -lC (so that the symbols of libA *were*
resolved)



where the "-lA -lB -lC" is the expansion of the previous "-lA".






And to tell ld to not depend on the order in which the libs are 
specifies, you can use --start-group and --end-group.


From the ld man page:

--start-group archives --end-group
The archives should be a list of archive files.  They may be either
explicit file names, or -l options.

The specified archives are searched repeatedly until no new
undefined references are created.  Normally, an archive is searched
only once in the order that it is specified on the command line.
If a symbol in that archive is needed to resolve an undefined
symbol referred to by an object in an archive that appears later on
the command line, the linker would not be able to resolve that
reference.  By grouping the archives, they all be searched
repeatedly until all possible references are resolved.

Using this option has a significant performance cost.  It is best
to use it only when there are unavoidable circular references
between two or more archives.

--
Mike Wey


Re: -m64 doesn't work?

2012-02-12 Thread Mike Wey

On 02/12/2012 03:21 PM, Andre Tampubolon wrote:

Hmm doesn't work. The same error still applies.

On 02/12/2012 08:36 PM, Mike Wey wrote:

On 02/12/2012 09:26 AM, Andre Tampubolon wrote:

And this is my dmd.conf:
[Environment]
DFLAGS=-I/opt/dmd-dev/import -I/opt/dmd-dev/phobos -L-L/opt/dmd-dev/lib32 
-L-L/opt/dmd-dev/lib64


Try adding -L--no-warn-search-mismatch





Can you post the output of dmd when compiling with: "-v" ?

--
Mike Wey


Re: -m64 doesn't work?

2012-02-12 Thread Mike Wey

On 02/12/2012 09:26 AM, Andre Tampubolon wrote:

And this is my dmd.conf:
[Environment]
DFLAGS=-I/opt/dmd-dev/import -I/opt/dmd-dev/phobos -L-L/opt/dmd-dev/lib32 
-L-L/opt/dmd-dev/lib64


Try adding -L--no-warn-search-mismatch

--
Mike Wey


Re: enum scope

2012-01-28 Thread Mike Wey

On 01/26/2012 12:55 PM, Michel Fortin wrote:

On 2012-01-26 01:12:40 +, Jonathan M Davis  said:


On Thursday, January 26, 2012 02:06:45 Trass3r wrote:

When writing C bindings I usually create lots of aliases via a
string mixin to pull enum members into the enclosing scope so
it's compatible to C.
Would it be wise to let the compiler do this automatically for
extern(C) enums?


Why? You're using them in D code, not C code. What difference does it
make if
the enum is one that's used in C code or not? Why would you use such
aliases
with enums from C but not those from D/ What makes enums from C
different?


Often C enum value naming takes into account that they'll live in the
outer scope. For instance:

enum UITableViewRowAnimation {
UITableViewRowAnimationFade,
UITableViewRowAnimationRight,
UITableViewRowAnimationLeft,
UITableViewRowAnimationTop,
UITableViewRowAnimationBottom,
UITableViewRowAnimationNone,
UITableViewRowAnimationMiddle,
UITableViewRowAnimationAutomatic = 100
}

So if you're doing direct bindings where you don't want to change the
names, how do you use that in D?

UITableViewRowAnimation.UITableViewRowAnimationFade



I would probably use:

enum UITableViewRowAnimation {
Fade,
Right,
Left,
Top,
Bottom,
None,
Middle,
Automatic = 100
}

Then you can use it like so:

UITableViewRowAnimation.Fade

--
Mike Wey


Re: Discussion about D at a C++ forum

2012-01-10 Thread Mike Wey

On 01/10/2012 08:47 AM, Alexander Malakhov wrote:

On Tuesday, 10 January 2012 at 00:04:31 UTC, Sean Kelly wrote:

On Jan 9, 2012, at 3:45 PM, Iain Buclaw wrote:


On 9 January 2012 21:29, Walter Bright 
wrote:

On 1/9/2012 11:45 AM, Jonathan M Davis wrote:


Please fix the wikipedia entry!



With what? Make it say 2003 for D1 and 2007 for D2?



Yes, but 2001 for D1.


[citation needed]


How about the changelog? Or does it have to be an actual article.
Maybe Walter's written something at DDJ?


D1 changelog starts with 1.001, 2007-01-23


D 0.00 was released on 9 December 2001.

http://www.digitalmars.com/d/1.0/changelog1.html#new000

--
Mike Wey


Re: compact library for creating window + OpenGL context + input handling?

2012-01-09 Thread Mike Wey

On 01/09/2012 04:05 AM, Trass3r wrote:

(other than SDL)

Basically something like the SFML Window module, but written in D and
working on Windoze/Linux.


This one might be useful: 
https://github.com/AndrejMitrovic/DNeonHelium/blob/master/Samples/win32/lesson01.d


--
Mike Wey


Re: System programming in D (Was: The God Language)

2011-12-31 Thread Mike Wey

On 12/31/2011 02:59 AM, so wrote:

On Sat, 31 Dec 2011 03:40:43 +0200, Iain Buclaw  wrote:


Take a pick of any examples posted on this ML. They are far better
fit to use as a test bed. Ideally one that does number crunching and
can't be easily folded away.


Well not them but another dummy function, i didn't think it would differ
this much.



real test() nothrow pure


real test() // test.d
real test() @inline // test_inl.d
{
real a=423123, b=432, c=10, d=100, e=4045, f=123;
a = a / b * c / d + e - f;
b = a / b * c / d + e - f;
c = a / b * c / d + e - f;
d = a / b * c / d + e - f;
e = a / b * c / d + e - f;
f = a / b * c / d + e - f;
a = a / b * c / d + e - f;
b = a / b * c / d + e - f;
c = a / b * c / d + e - f;
d = a / b * c / d + e - f;
e = a / b * c / d + e - f;
f = a / b * c / d + e - f;
a = a / b * c / d + e - f;
b = a / b * c / d + e - f;
c = a / b * c / d + e - f;
d = a / b * c / d + e - f;
e = a / b * c / d + e - f;
f = a / b * c / d + e - f;
return f;
}

void main()
{
for(uint i=0; i<1_000_000_0; ++i)
test();
}


When marking the function as pure and nothrow dmd is able to optimize 
the loop:


.text._Dmainsegment
assume  CS:.text._Dmain
_Dmain:
pushRBP
mov RBP,RSP
xor EAX,EAX
L6: inc EAX
cmp EAX,0989680h
jb  L6
xor EAX,EAX
pop RBP
ret
.text._Dmain    ends


--
Mike Wey


Re: CURL Wrapper: Vote Thread

2011-12-18 Thread Mike Wey

Yes.

--
Mike Wey


Re: Documentation 'quick index'

2011-11-28 Thread Mike Wey

On 11/28/2011 09:38 PM, Piotr Szturmaj wrote:

Hi,

I'm trying to make ddoc index more readable. Here are some early
results:

http://bot.neostrada.pl/dpl.org/std.datetime.html

Do you know some free icons of class, enum, function, etc? I'm thinking
of something like this: http://msdn.microsoft.com/en-us/library
/y47ychfe%28v=vs.80%29.aspx

Thanks


CandyDoc comes with class, struct and other images:
http://www.dsource.org/projects/helix/browser/trunk/doc/candydoc/img/outline

--
Mike Wey


Re: is D ncurses-only language?

2011-11-28 Thread Mike Wey

On 11/28/2011 05:08 PM, Gour wrote:

On Wed, 23 Nov 2011 22:58:00 +0100
Mike Wey  wrote:


Yes, I'll probably update GtkD to the latest 2.x release before
looking at GTK+ 3.


Have you considered using SWIG to provide GtkD bindings?


I'll have to check it out, currently updating the lookup files will be 
the easiest way to update GtkD.



btw, do you have any influence @dsource forums?

I registered 8 days ago and still neither received confirmation email
that my account was activated nor I can login.


You'll probably have to contact Brad.


Sincerely,
Gour





--
Mike Wey


Re: is D ncurses-only language?

2011-11-23 Thread Mike Wey

On 11/23/2011 01:58 PM, Trass3r wrote:

c) gtkD looks it's in best shape...works with Phobos and Tango, with D
1.0 and D 2.0, 64 bits support, wraps GTK+ 2.22.x API.

Quite good, although a bit behind GTK+ schedule. The problem might be
there is only one developer (Mike) working on it.


So he's still working on it?
GTK+3 is a major step.


Yes, I'll probably update GtkD to the latest 2.x release before looking 
at GTK+ 3.


--
Mike Wey


Re: Phobos Wish List/Next in Review Queue?

2011-11-20 Thread Mike Wey

On 11/20/2011 04:02 AM, dsimcha wrote:

* Streams. (Another item where the bottleneck is mostly at the design
level and people not really knowing what they want.)


Steven Schveighoffer's new-stdio included a nice stream interface.
I don't know what the current state of the module is.

--
Mike Wey


Re: Vote on std.regex (FReD)

2011-10-24 Thread Mike Wey

Yes.

--
Mike Wey


Re: Selective and renamed imports

2011-10-16 Thread Mike Wey

On 10/16/2011 12:08 PM, Christian Kamm wrote:

These are the reasons why my pull request changes the selective import
behavior to not merge overload sets. It makes 'import base : foo;' treat
'foo' exactly the same way as 'import base;' would have done; it does not
matter whether an symbol was imported selectively or not. You can get the
old behavior by using an explicit alias.

Does this work as you'd expect? Please write a short reply even if you just
agree. I hope the feedback will convince Walter to give this serious
consideration. You can also let me know that this is totally bananas, of
course.

Regards,
Christian



Yes, this is how i would expect it to work.

--
Mike Wey


Re: RFC - mysqlD

2011-10-10 Thread Mike Wey

On 10/10/2011 01:46 AM, Jonathan M Davis wrote:

On Sunday, October 09, 2011 16:35:20 Sean Kelly wrote:

On Oct 9, 2011, at 2:42 PM, Jonathan M Davis wrote:

On Sunday, October 09, 2011 14:35:35 Jonathan M Davis wrote:

On Sunday, October 09, 2011 19:37:31 GrahamC wrote:

The C types which may differ between x86 and x86_64 are defined in
core.stdc.config.


Though it currently only does so for the integral types.


Which other standard C types vary between x86 and x86_64?


On Windows, I don't believe that there's a difference on anything. On Linux,
long int, unsigned long int, and long double all differ. I thought that long
long int differed too (being 128 bit on 64-bit systems), but trying it now on
my 64-bit Linux box, it's 64-bit for both -m32 and -m64, so I guess that it
doesn't differ. But regardless, the primary one missing from core.stdc.config is
long double.

- Jonathan M Davis


real is the same size as long double, on both 32 and 64 bits linux.

--
Mike Wey


Re: Std.path: Final Vote

2011-08-05 Thread Mike Wey

Op 5-8-2011 15:26, dsimcha schreef:

My apologies for not announcing this yesterday. For some reason I
thought today was the official end of review. Anyhow, Lars Kyllingstad's
new std.path module, which has been in review for the past 3 weeks, is
up for vote. Please vote yes or no in this thread.

Code:
https://github.com/kyllingstad/phobos/blob/std-path/std/path.d

Docs
http://www.kyllingen.net/code/std-path/phobos-prerelease/std_path.html

Voting ends next Friday, August 12, since it started a day late.


Yes.


Re: gtkD MenuItem addOnActivate

2011-07-24 Thread Mike Wey

On 07/24/2011 06:32 PM, Steve Teale wrote:

Can anyone who knows about gtkD tell me what is the intention of the MenuItem
argument to the delegate passed as the first argument to this method.

I was hoping that this was to allow the transfer of some userdata to the
handler, but I don't see any such provision for adding userdata in the
MenuItem class.

I have Googled on this topic at some length, but not found any clue. Of
course, I could be asking the wrong questions.

Thanks
Steve


The MenuItem in the delegate is the MenuItem that has received the 
signal. To add some userdata you can do one of two things:


1. Use setData and getData to set and retrieve the data these only 
accept pointers though.

2. ₢eating a derived class that includes the userdata should also work.

--
Mike Wey


Re: Proposed improvements to the separate compilation model

2011-07-24 Thread Mike Wey

On 07/23/2011 11:54 PM, Andrei Alexandrescu wrote:

The problem with this setup is that it's extremely fragile, in ways that
are undetectable during compilation or runtime. For example, just
swapping a and b in the implementation file makes the program print
"08.96566e-31344". Similar issues occur if fields or methods are added
or removed from one file but not the other.

In an attempt to fix this, the developers may add an "import a" to a.d,
thinking that the compiler would import a.di and would verify the bodies
of the two classes for correspondence. That doesn't work - the compiler
simply ignores the import. Things can be tenuously arranged such that
the .d file and the .di file have different names, but in that case the
compiler complains about duplicate definitions.


If the .di files are this fragile, the compiler should just always check 
if the .d file matches (if present) .di file, then there is no need for 
the extra import.


--
Mike Wey


Re: std.getopt

2011-07-17 Thread Mike Wey

On 07/17/2011 03:49 PM, Jens Mueller wrote:

That's true. It's only that changing it means breaking code. Though I
don't believe that there are many scripts out there. But for example dmd
uses long options without double dashes.
I'm up to change this hoping it won't break too much code.


One problem with the long options with a single dash is that getopt 
supports bundling. So when enabled does "-timeout" equal "-t -i -m -e -o 
-u -t" or "--timeout" ?


--
Mike Wey


Re: std.getopt

2011-07-17 Thread Mike Wey

On 07/17/2011 11:06 AM, Jens Mueller wrote:

Andrei Alexandrescu wrote:

On 7/16/11 8:58 AM, Jens Mueller wrote:

Trass3r wrote:

Why doesn't std.getopt support standard unix style like 'make -j 4'?

"uint timeout;
getopt(args, "timeout|t",&timeout);
To set timeout to 5, use either of the following: --timeout=5,
--timeout 5, --t=5, --t 5, or -t5. Forms such as -t 5 and -timeout=5
will be not accepted."

Also it doesn't make any sense to me that --t=5 and --t 5 is allowed
in this case.
I expected the short alias only to be used with a single dash.


I agree. Not supporting -t 5 is no good. std.getopt took its inspiration

>from Perl's Getopt::Long (http://perldoc.perl.org/Getopt/Long.html)

which supports it as well.

I'm unsure about --t=5 and --t 5. I don't like them but I don't have to
use them. But without them the rules would be simpler but removing them
may break code. Adding -t 5 is safe I think.
And maybe we enhance the documentation a bit such that more common
choices are given first and less known but still supported later.

If Andrei agrees maybe you or I can create a pull request for -t 5 and
enhancing the documentation regarding -- for short options.

BTW
-timeout=5 is accepted but it shouldn't. I just wrote unittests for all
combinations.

Jens


Yes please. So, this stuff should work if we have t|timeout bound to
an integral:

-t5, -t 5, --timeout 5, --timeout=5

This stuff should not:

-t=5, -timeout 5, -timeout=5

Right?


--timeout 5 and --timeout=5 work as expected.
--timeout5 fails as expected.

-t5 works as expected.
But -t 5 fails (I will try to fix).

And you don't want -t=5, -timeout 5, and -timeout=5 to work?
Currently they all pass as unexpected. Should I make them fail?
-timeout5 fails as expected.

What about
--t 5 (works currently)
--t=5 (works currently)
--t5 (fails currently)

These are all 12 combinations of "--" or "-" and "t" or "timeout" and
"=5", " 5", or "5".

Jens


I think you generally want long arguments like "timeout" to start with 
"--" and the one character ones like "t" to start with "-".


Also with "--timeout5" the 5 might be seen as part of the flag and 
shouldn't be allowed.


--
Mike Wey


Re: Strange gtkd behaviour

2011-07-14 Thread Mike Wey

On 07/14/2011 07:53 AM, maarten van damme wrote:

when I leave destroy out the inputbox always stays visible even after
I've pressed ok.
here are the other files
http://dl.dropbox.com/u/15024434/Main.d
http://dl.dropbox.com/u/15024434/InputBox.d
http://dl.dropbox.com/u/15024434/MessageBox.d


I see you are calling Main.run twice, although you would only call it 
once it will work. But you'll also need to call Main.Quit twice, 
probably when the second 'Messagebox' is closed.


This is because Main.run() runs the gtk eventloop and returns when 
Main.Quit is called.


Yoe might also want to look at gtk.Dialog and gtk.MessageDialog for your 
"InputBox" and "MessageBox" respectively.
gtk.Dialog has it's own run method which returns a response code when 
the user closes the dialog, by clicking ok/cancel/etc... or just closes it.


--
Mike Wey


Re: Strange gtkd behaviour

2011-07-13 Thread Mike Wey

On 07/13/2011 11:00 PM, maarten van damme wrote:

Hello everyone,
I wrote two classes that inherit from the Mainwindow class, one is a
dialog that asks for your input and one is a plain old messagebox.
you can check out the input class here, I think thats the one with the
problem: http://dl.dropbox.com/u/15024434/InputBox.d
or read the method most likely containing the error:
void onclicked(Button button){
*answer=input.getText();
destroy();
Main.quit();
}

Then I have a main class where I create an inputbox and do Main.run(),
then when the user closes the window or presses ok everything after the
first main.run gets runned and that displays a messagebox that depends
on what the user entered followed by another Main.run();

The problem is that when you press ok to close the first input window
and then close the next messagebox the program keeps running in memory.
Everything after the second Main.run never gets executed. When you
however close the first window using the close button and then close the
next messagebox the program terminates correctly.
I'm assuming I don't completely destroy the inputbox in the onclicked
method?

If what I gave you is not enough I can give you the links to all the
files. Note that these classes are simply me learning gtkd and the d
language in general. If you see me doing something "dirty" or bad please
tell me so I learn a bit from my mistakes :)

Maarten


I'm not sure if the Main.Quit gets executed after you've destroyed the 
InputBox, does it work correctly without the call to destroy?


If not links to the other files would be helpfull.

--
Mike Wey


Re: Why I'm hesitating to switch to D

2011-07-02 Thread Mike Wey

On 06/30/2011 11:45 PM, Daniel Gibson wrote:

Am 30.06.2011 23:41, schrieb simendsjo:

On 30.06.2011 23:39, bearophile wrote:

Jonathan M Davis:


Actually, I find the backticks to be by far the most pleasant way to
get raw
strings in D.


I don't have backticks on my keyboard, so I use them only when they
are needed. They have even removed the backticks in the Python2 ->
Python3 transition partially because of this (and partially because
there is a more obvious way to do it in Python, and Python tries to
keep only one obvious way to do things).

Bye,
bearophile


Yeah, I hate backticks too.. I have to press Shift+` followed by space.
But often space won't work as the text editor understands that space
cannot be accented or something. So I often press ` twice and backspace
to delete the last one. This gives me 4 key presses just for a single
character... Wee...


On Linux/X11 this could be fixed by disabling "dead keys" (at least as
long as you don't need them to place accents on letters, which depends
on the languages you're writing in).
Dunno what the equivalent to this setting for Windows or OSX is though.

Cheers,
- Daniel


And if you still need some accents you can enable the compose key:
http://www.hermit.org/Linux/ComposeKeys.html

--
Mike Wey


Re: how to set up eclipse with ddt and gtkd with dmd the proper way?

2011-06-26 Thread Mike Wey

On 06/26/2011 04:02 PM, maarten van damme wrote:

A little update: I've succesfully compiled gtkD and I now have a gtkD.lib.
I've copied it to the lib folder where dmd was installed. now I try to
compile my first example without eclipse to start with.
I use dmd -IC:\D\gtkD\src -L C:\D\gtkD\src\build\gtkD.lib main.d
and I get as output

..



How did you build the gtkD.lib?

Also this thread http://www.dsource.org/forums/viewtopic.php?t=5954 
might be usefull.


--
Mike Wey


Re: DIP11: Automatic downloading of libraries

2011-06-15 Thread Mike Wey

On 06/15/2011 11:10 PM, Andrei Alexandrescu wrote:

On 6/15/11 3:48 PM, Mike Wey wrote:

First i didn't read all of the posts in this thread, so some of these
might already be answered.

In the first paragraph the DIP talks about Automatic downloading of
*libraries* while all the posts here talk about downloading files.
This is also reflected in the "Package case" paragraph since the
compiler / separate tool will first try to download a .di file.
Which generally is a d import or header file, which doesn't need to
include the implementation, so the compiled library should also be
downloaded or linking would fail, right?


That is correct. We need to address the scenario in which a .di file
requires the existence of a .a/.lib file.


Also the proposal doesn't do anything with versioning, while larger
updates will probably get a different url, bug fixes might still
introduce regressions that silently break an application that uses the
library.


I think this is a policy matter that depends on the URLs published by
the library writer.


But a different url for every bugfix would be difficult to maintain.




And now you'll have to track down witch library introduced the
bug, and more importantly your app broke overnight and while you didn't
change anything. (other that recompiling)

To find out how downloading the files would work i did some tests with
GtkD.

Building GtkD itself takes 1m56.
Building an Helloworld app that uses the prebuild library takes 0m01.

The Helloworld app need 133 files from GtkD.
Building the app and the files it needs takes 0m24.

The source of the HelloWord application can be found here:
http://www.dsource.org/projects/gtkd/browser/trunk/demos/gtk/HelloWorld.d



Thanks for the measurements. So my understanding is that the slow
helloworld essentially compiles those 133 files from GtkD in addition to
helloworld itself?


Yes, thats correct.




Thanks,

Andrei


--
Mike Wey


Re: DIP11: Automatic downloading of libraries

2011-06-15 Thread Mike Wey
First i didn't read all of the posts in this thread, so some of these 
might already be answered.


In the first paragraph the DIP talks about Automatic downloading of 
*libraries* while all the posts here talk about downloading files.
This is also reflected in the "Package case" paragraph since the 
compiler / separate tool will first try to download a .di file.
Which generally is a d import or header file, which doesn't need to 
include the implementation, so the compiled library should also be 
downloaded or linking would fail, right?


Also the proposal doesn't do anything with versioning, while larger 
updates will probably get a different url, bug fixes might still 
introduce regressions that silently break an application that uses the 
library. And now you'll have to track down witch library introduced the 
bug, and more importantly your app broke overnight and while you didn't 
change anything. (other that recompiling)


To find out how downloading the files would work i did some tests with GtkD.

Building GtkD itself takes 1m56.
Building an Helloworld app that uses the prebuild library takes 0m01.

The Helloworld app need 133 files from GtkD.
Building the app and the files it needs takes 0m24.

The source of the HelloWord application can be found here:
http://www.dsource.org/projects/gtkd/browser/trunk/demos/gtk/HelloWorld.d

--
Mike Wey


Re: gtkD program fails to run

2011-06-07 Thread Mike Wey

On 06/07/2011 01:40 AM, Mike James wrote:

"Mike Wey"  wrote in message
news:isjg1b$2qel$1...@digitalmars.com...

On 06/05/2011 11:37 PM, Mike James wrote:

When I run the "hello world" program in the gtkD demos I get the
following
error message...

The procedure entry point gdk_app_launch_context_get_type could not be
located in the dynamic link library libgdk-win32-2.0-0.dll

Does anybody know what I need to do to rectify the problem?

I am using the latest gtkD download, gtk version 2.22 and D Compiler
2.053
to build it.

Thanks,

-=mike=-




Are you using the gtk runtime linket from the GtkD dsource page ?
If so could you try the one from the gnome ftp:
ftp://ftp.gnome.org/Public/gnome/binaries/win32/gtk+/2.22/gtk+-bundle_2.22.1-20101227_win32.zip

--
Mike Wey


Thanks Mike,

Yes I'm using that gtk version. The error message is mentioned on the
dsource gtkD site but no solution was provided there.

I'm looking round for a cross-platform GUI library - I'll guess I'll have to
cross gtkD off the list :-/

  -=mike=-




So far in can think of only two thing that might cause this error, 
either the the installer linked from the GtkD dsource page is flawed.
Or you have a application on your pc that includes an older version of 
gtk and this causes dll problems. For the first one you could try the 
bundle from the Gnome ftp.


--
Mike Wey


Re: gtkD program fails to run

2011-06-06 Thread Mike Wey

On 06/05/2011 11:37 PM, Mike James wrote:

When I run the "hello world" program in the gtkD demos I get the following
error message...

The procedure entry point gdk_app_launch_context_get_type could not be
located in the dynamic link library libgdk-win32-2.0-0.dll

Does anybody know what I need to do to rectify the problem?

I am using the latest gtkD download, gtk version 2.22 and D Compiler 2.053
to build it.

Thanks,

-=mike=-




Are you using the gtk runtime linket from the GtkD dsource page ?
If so could you try the one from the gnome ftp:
ftp://ftp.gnome.org/Public/gnome/binaries/win32/gtk+/2.22/gtk+-bundle_2.22.1-20101227_win32.zip

--
Mike Wey


Re: Vote here for best article iPad2 contest

2011-06-06 Thread Mike Wey

[2] Concurrency, Parallelism and D by Dave Simcha

--
Mike Wey


Re: std.log version 2

2011-06-05 Thread Mike Wey

On 06/04/2011 07:04 PM, Jose Armando Garcia wrote:

Hi everyone,

I went back and incorporated a lot of the community requested changes.
The module has changed quite a bit. Some notable changes are:

* Got rid of all the *Config struct. You can now configure some parts
of std.log even after logging as started. See Configuration
* Got rid of the initLogging methods/templates they are not need
anymore. The module should work without initialization.
* Added the log severity critical which throws when logged.
* Gave in and made LogFilter a final class
* Fixed compile time disabling by using a template to get the
LogFilter. The new syntax is log!info.
* Added rich boolean support! More on that below.

code: https://github.com/jsancio/phobos/blob/master/std/log.d
doc: http://jsancio.github.com/phobos/phobos/std_log.html

Note: I had to make changes to std.datetime (was getting a segfault;
changes are in my repo) and druntime (patch attached).

Now on to rich boolean. I wanted to be able to print in the log
message why the when() expression is true. To achieve this I added a
struct Rich(Type)
which encapsulate the value and the reason for that value. Right now
the implementation is not every smart and just stores the reason as a
string.

For example if you write:

log!info.format("You passed %s argument(s)", args.length - 1);
log!info.when(richGreater(args.length, 1))("Arguments: ", args[1 .. $]);
log!info.when(richOr(richIsNull(obj), richEqual(10, 20)))("Something strange");

you get the following log lines:

20110604T152711.0138317Z:93d780 src/justo/main.d:11 INFO You passed 4
argument(s)
20110604T152711.0142393Z:93d780 src/justo/main.d:12 INFO when(true =
(a>  b)) Arguments: [--minloglevel=info,
--logtostderr, --stderrThreshold=info, --v=0]
20110604T152711.0150535Z:93d780 src/justo/main.d:14 INFO when(true =
(a || b)', b = 'false = (a == b)
'>) Something strange!

I am interested to hear people's option of this. How can it be improved?

Many thanks,
-Jose


It it possible to get a more Human readable date and time, i didn't see 
any options for it in the docs?


--
Mike Wey


Re: std.log available for viewing

2011-05-31 Thread Mike Wey

On 05/31/2011 09:29 PM, Steven Schveighoffer wrote:

On Tue, 31 May 2011 15:09:07 -0400, Steven Schveighoffer
 wrote:


On Tue, 31 May 2011 14:48:57 -0400, Andrei Alexandrescu
 wrote:



I'm operating under the assumption that logCritical and logFatal are
at a different log level (i.e. the primary function of a logging
facility is to have different degrees of importance, which you can
turn on or off depending on the level set). Is that not the case? So I
can't have a situation where logError does nothing, but logCritical
logs a message?


Rereading the docs, it seems that fatal is actually a separate level, so
I still assert this is not a good design. I should be able to access all
levels without having the program abort or throw an exception.

I also note that critical is nowhere to be seen in the docs. Am I
missing something?

If we change fatal and critical to be the same level as error (and
enabled/disabled with error), I think it would be more sensible than
what you have proposed. It could be argued that it's not enough levels.
Typically, I've only needed 4 levels with logging:

fatal errors -- print a message then exit the application (gracefully!).
You cannot disable this level.
non-fatal errors -- print a message but the program continues.
info -- print a message for information so the flow of execution can be
followed (i.e. xyz logged in, xyz executed this program, etc.)
debug -- print all details, down to printouts of internal
structures/protocols.

I've never had much use for a warning level.


-Steve


I agree with Steven that terminating the app when logging a fatal 
message is a horrible design choice. You would almost always want to 
stop gracefully, witch you can't with the current fatal log.


A logging library should log messages, is shouldn't control the flow of 
the application.


--
Mike Wey


Re: using dylib with dmd

2011-04-23 Thread Mike Wey

On 04/22/2011 10:18 PM, frostmind wrote:

Thank you for your response! Hopefully I've done it right.

Now when everything is within the same folder,
and I execute:
dmd test_d_client.d -L.

(so I'm telling to look for libs in current dir)
Response is now different:

ld: in ., can't map file, errno=22
collect2: ld returned 1 exit status
--- errorlevel 1

What else could be done here to resolve it?


Asuming your lib is named libRatings an is in the current directory, 
this should work:


dmd test_d_client.d -L-L. -L-lRatings

--
Mike Wey


Re: std.parallelism: VOTE IN THIS THREAD

2011-04-19 Thread Mike Wey

YES

--
Mike Wey


Re: Struct copy and destruction

2011-04-10 Thread Mike Wey

On 04/09/2011 04:34 PM, Morlan wrote:

It sounds reasonable. But I cannot find information about this behaviour in the
Language Reference or TDPL book. Can you point to a relevant source?


Section 7.1.3.6 of TPLD talks about struct destructors, but like the 
online documentation it only talks about calling the destructors when 
they go out of scope.


But what whould you think it should do when there is no longer any 
reference to one of the structs?


--
Mike Wey


Re: Struct copy and destruction

2011-04-09 Thread Mike Wey

On 04/09/2011 12:42 PM, Morlan wrote:

The essence of my problem is why is the destructor called as a
result of the assignment in the first place? There is no
information about this behaviour in the language reference. Can
anyone explain this?


Because you assign a copy of s2 to s1 the struct that was originally in 
s1 gets has it's destructor called, sine it ceases to exist.


--
Mike Wey


Re: GtkD: Dead or Alive?

2011-03-04 Thread Mike Wey

On 03/04/2011 12:55 AM, David Bryant wrote:

Hi Mike, It's good to hear from an official GtkD maintainer that the
project isn't dead!

I understand that GTK 3.0 is supposed to be more amenable to language
bindings than previous GTK versions but don't have any details of how it
achieves this. This is good from a GtkD point-of-view. I think it's
important to have GTK 3.0 support in GtkD early because by the time some
GtkD projects mature GTK 3.0 will be in wide use.


I haven't looked at it jet, but if it offers better support for language 
bindings that would be great.



The GtkD repository contains the already generated D bindings. I was
deterred from attempting the generation step myself because it involved
setting up wine and htod. I can't help but wonder how much effort would
be involved in an htod alternative, even if only worked for the
GTK/glib/etc header files, which follow very consistent patterns...


htod shouldn't be needed, at one point the code generator generated some 
opengl headers, but those are only used for the demos, and generating 
the opengl headers is currently disabled in the generator.



The callback scheme in GtkD is quite simple and I wonder if you've
considered anything more elaborate? Gtkmm leverages a callback framework
called libsigc++. It allows fancy things like binding arguments to
callbacks, amongst other things.

Would you like help working on GtkD? I will have another go at setting
up wine/htod and performing the code generation step. Then I will
attempt to understand how that step works.

Regards,
Dave


Help would be nice, i should probably write down some of the idea's i have.

--
Mike Wey


Re: GtkD: Dead or Alive?

2011-03-04 Thread Mike Wey

On 03/04/2011 12:35 AM, David Bryant wrote:


Could you provide this patched version of yours publicly ? I would be
interested in it.


Here is the patch I apply. Note, that it is being applied to generated
code, rather than fixing the problem at the root. However I'm yet to
delve into running the code generator. As a linux user I believe I will
need to get htod running under wine...

Patch does the following:
* Adds "-w -wi" flags to dmd. I use these to build my own software so
gtkd must also compile correctly with these flags
* Adds several "override" qualifiers to appease dmd with said flags enabled
* Small changes to compile with recent changes to dmd 2.052 (core.vararg)
* Fixes memory leak in cairo/Context (apparently there are more leaks
though, I fixed this one because it brings my program to its knees)


Thanks for the patch, i see you that some functions are commented out, 
are there any problems with these functions ?


As for the code generator it doesn't need htod under wine.

--
Mike Wey


Re: GtkD: Dead or Alive?

2011-03-03 Thread Mike Wey

On 03/03/2011 06:15 AM, dsimcha wrote:

I've been using GtkD for my Plot2kill plotting library, and overall it
appears to be the most mature D GUI library available. However, I've
noticed that no commits have taken place for several months, and nobody
seems to want to test the 64-bit support patch I submitted.

Is the lack of GtkD activity because the project is mature and not much
still needs to be done, or because GtkD has been abandoned?


It's not abandoned, but i haven't had enough spare time lately to work 
on it. there is still enough to be done though.


The biggest issues are probably:
* Update to GTK 3.0
* Support GtkBuilder.
* There are memoryleaks.

--
Mike Wey


Re: dflplot/Plot2Kill, Most Mature *nix GUI For D2

2010-07-17 Thread Mike Wey

On 07/16/2010 03:34 PM, dsimcha wrote:

What turned me off was the Drawable class, which I'd be using heavily.  There's 
no
way to construct it w/o explicitly creating a pointer to a C struct and then
passing it in.


gdk.Drawable is meant to be used as either a gdk.window or a gdk.Pixmap 
it more or less acts as a abstract class.


Or you can get the Drawable of a Drawing Area like this:

DrawingArea area = new DrawingArea();
Drawable draw = area.getWindow();

You're probably going to use cairo for drawing so it might be a good 
idea to look at the cairo demos/examples:


http://www.dsource.org/projects/gtkd/browser/trunk/demos/cairo/text_image/text_image.d

Cairo also allows drawing to files: png. svg, pdf and ghostscript.

--
Mike Wey


Re: Anomaly on Wiki4D GuiLibraries page

2009-01-16 Thread Mike Wey

Piotrek wrote:

Tim M wrote:

It's brainwashing people into think that dwt is the best thing around.


IMHO, It's better then anything around. It works on Linux/Windows and is 
easy to use. There's only one competitor named gtkD, but... the button 
usage example from the project site with such a nice line of code:

char** names = (new char*[2]).ptr;
just doesn't look D-style for me.

Cheers


That should have been updated with the last release, setAuthors uses a 
string[] now.


I've changed the Example: 
http://dsource.org/projects/gtkd/wiki/CodeExamples?action=diff&version=12


--
Mike Wey