Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread Adam D. Ruppe
On Saturday, 8 June 2013 at 22:45:36 UTC, maarten wrote: Very good news that I can now compile it on my 64 bit machine, because dmd not only refused to in the past but I couldn't even get -m32 working. (Probably installed something somewhere incorrectly?) It should pretty much just work if you

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread Adam D. Ruppe
On Sunday, 9 June 2013 at 05:53:40 UTC, Marco Leise wrote: Does that mirror XCB (independent of XCB, implements RPC) or add a wrapper layer around the C bindings? Because it would be kinda cool to have a real X sever binding in D and not just D bindings to the C bindings to the X server. :p It

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread bearophile
Adam D. Ruppe: https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/simpledisplay.d Time ago I tried simpledisplay (on 32 bit Windows) and I remember I had to make the class Image final to have some performance. I used it on Rosettacode too:

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread Adam D. Ruppe
On Sunday, 9 June 2013 at 12:09:03 UTC, bearophile wrote: Time ago I tried simpledisplay (on 32 bit Windows) and I remember I had to make the class Image final to have some performance. I used it on Rosettacode too: Hmm probably putPixel and impl.putPixel is too slow, it is called a lot. I

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread bearophile
Adam D. Ruppe: I got as high as 45 fps using that trick plus the dmd -inline -release -O -noboundscheck flags. (The original code without flags and without final gave me only 30 fps). Some people keep saying how much nice the F# language is, and indeed I like it and it's nice. But on that

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread bearophile
Adam D. Ruppe: I got as high as 45 fps using that trick plus the dmd -inline -release -O -noboundscheck flags. (The original code without flags and without final gave me only 30 fps). Compiled with dmd, on my slower PC I see about 37 fps on the original code. Using ldc2 on the same code I

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread Adam D. Ruppe
On Sunday, 9 June 2013 at 14:00:20 UTC, bearophile wrote: But on that page the F# entry seems to be more than 10 times slower than D entry (the image says 2.9 FPS, but maybe it's in debug mode): They could have ran it on a slow computer too, only way to be fair with these kind of comparisons

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread Adam D. Ruppe
On Sunday, 9 June 2013 at 20:22:24 UTC, bearophile wrote: Using the pointers with ldc2 I see 68 fps. Good speed there. Another problem I just realized though: on Windows, bitmaps are stored upside down so you'd have to draw y-inverted too. Didn't make a difference here because the image

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread bearophile
Adam D. Ruppe: Another problem I just realized though: on Windows, bitmaps are stored upside down so you'd have to draw y-inverted too. Didn't make a difference here because the image doesn't care about orientation but it would be visible with a lot of other programs. Maybe simple

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread Piotr Szturmaj
W dniu 10.06.2013 00:09, bearophile pisze: Delphi has a large and efficient GUI toolkit in the standard library, but I think it's not a good idea to put a GUI toolkit in Phobos. But a little library as simpledisplay is OK. Hmm... What if Lazarus GUI code and/or LCL could be ported to D? I've

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread bearophile
Piotr Szturmaj: Hmm... What if Lazarus GUI code and/or LCL could be ported to D? I've seen full featured Object Pascal parser in their repository. Maybe it's possible to transcode the source to D ;) Just thinking loud. Even if that's possible, I think it's not a good idea to put the

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread Piotr Szturmaj
W dniu 10.06.2013 00:29, bearophile pisze: Piotr Szturmaj: Hmm... What if Lazarus GUI code and/or LCL could be ported to D? I've seen full featured Object Pascal parser in their repository. Maybe it's possible to transcode the source to D ;) Just thinking loud. Even if that's possible, I

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread Andrej Mitrovic
On 6/9/13, Adam D. Ruppe destructiona...@gmail.com wrote: on Windows, bitmaps are stored upside down so you'd have to draw y-inverted too. I have some vague memory about a trick where using a negative height would flip the bitmap automatically. (something like that .. maybe wrong, worth trying

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread Adam D. Ruppe
On Sunday, 9 June 2013 at 22:09:55 UTC, bearophile wrote: This high level library should generate the same image output on all systems it compiles on. Naturally. But if we can get a 10% performance boost that can be worth it in a lot of cases. Maybe the api can actually be an output range

Re: simpledisplay.d now works on as 64 bit on X

2013-06-08 Thread maarten
Very good news that I can now compile it on my 64 bit machine, because dmd not only refused to in the past but I couldn't even get -m32 working. (Probably installed something somewhere incorrectly?) Thank you :)

Re: simpledisplay.d now works on as 64 bit on X

2013-06-08 Thread Marco Leise
Am Thu, 06 Jun 2013 01:27:58 +0200 schrieb Adam D. Ruppe destructiona...@gmail.com: cool... I found one on dsource but not github yet. The dsource one transforms the XML but doesn't seem to implement all needed functions. Shouldn't be hard to complete anyway though. Does that mirror XCB

Re: simpledisplay.d now works on as 64 bit on X

2013-06-05 Thread Dejan Lekic
On Monday, 3 June 2013 at 01:31:27 UTC, Adam D. Ruppe wrote: On Monday, 3 June 2013 at 00:15:20 UTC, Marco Leise wrote: all the remote procedure calls to the X Server. Internally those calls rely on a small generic set of functions that serializes the requests for transmission. I see. I just

Re: simpledisplay.d now works on as 64 bit on X

2013-06-05 Thread Adam D. Ruppe
On Wednesday, 5 June 2013 at 16:33:57 UTC, Dejan Lekic wrote: There is already a functional XCB binding somewhere on GitHub. I managed to compiled it and play with it last year with success. cool... I found one on dsource but not github yet. The dsource one transforms the XML but doesn't

simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread Adam D. Ruppe
I know someone here was asking about my simpledisplay.d on 64 bit a while ago.. I don't remember who so here's a general announcement. I got it working for at least the parts I tried (display image, get keyboard input) compiled with -m64:

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread Marco Leise
I'm sorry to hear that you ran into the unsigned long problem. I noticed it in time and asked about it on the NG and was told that the difference is between Windows and Posix. One takes long as int32, the other as the native machine word size on 64-bit. We do the same stupid mistakes over and

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread Andrej Mitrovic
On 6/2/13, Marco Leise marco.le...@gmx.de wrote: I'm sorry to hear that you ran into the unsigned long problem. This is why we have core.std.config: import core.stdc.config : c_long, c_ulong;

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread Adam D. Ruppe
On Sunday, 2 June 2013 at 22:16:57 UTC, Andrej Mitrovic wrote: This is why we have core.std.config: import core.stdc.config : c_long, c_ulong; I would never have thought to look in config for types! Well, hopefully I'll remember for next time.

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread Adam D. Ruppe
On Sunday, 2 June 2013 at 21:53:56 UTC, Marco Leise wrote: Also eventually we should generate X bindings for all platforms (including Windows) from the XML definitions like XCB does. hmm I don't see an xml file for Xlib.h on my system, do you know if there is supposed to be one? Though I'm

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread bearophile
Andrej Mitrovic: This is why we have core.std.config: import core.stdc.config : c_long, c_ulong; Why isn't that linked in this page? http://dlang.org/phobos/std_stdint.html I'd like to open a little documentation enhancement request for that. Bye, bearophile

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread Andrei Alexandrescu
On 6/2/13 7:10 PM, bearophile wrote: Andrej Mitrovic: This is why we have core.std.config: import core.stdc.config : c_long, c_ulong; Why isn't that linked in this page? http://dlang.org/phobos/std_stdint.html I'd like to open a little documentation enhancement request for that. Bye,

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread bearophile
Why isn't that linked in this page? http://dlang.org/phobos/std_stdint.html It seems it lacks some of them, this gives an import error: import core.stdc.config: c_ulonglong, c_longlong; Bye, bearophile

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread Adam D. Ruppe
On Sunday, 2 June 2013 at 23:19:18 UTC, bearophile wrote: It seems it lacks some of them, this gives an import error: It only defines c_long and c_ulong. I guess this is ok because the other types don't vary, though I kinda think it should do them all just so you can be consistent. Not

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread bearophile
Andrei Alexandrescu: And while you are at it, please also contribute the corresponding pull request. Time to inaugurate bearophile's additions! As my friend, please understand, I can't afford to get addicted to that :-) Hugs, bearophile

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread Andrej Mitrovic
On 6/3/13, bearophile bearophileh...@lycos.com wrote: Why isn't that linked in this page? http://dlang.org/phobos/std_stdint.html Because it's on this page: http://dlang.org/interfaceToC.html It seems it lacks some of them, this gives an import error: import core.stdc.config: c_ulonglong,

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread Adam D. Ruppe
On Sunday, 2 June 2013 at 23:35:28 UTC, Andrej Mitrovic wrote: http://dlang.org/interfaceToC.html ah then what is this page doing there? http://dlang.org/htomodule.html The documentation could def use a lil cleanup.

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread bearophile
Andrej Mitrovic: Because it's on this page: http://dlang.org/interfaceToC.html It seems it lacks some of them, this gives an import error: import core.stdc.config: c_ulonglong, c_longlong; Again see http://dlang.org/interfaceToC.html Good, thank you. I missed that. Bye, bearophile

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread Andrej Mitrovic
On 6/3/13, Adam D. Ruppe destructiona...@gmail.com wrote: On Sunday, 2 June 2013 at 23:35:28 UTC, Andrej Mitrovic wrote: http://dlang.org/interfaceToC.html ah then what is this page doing there? http://dlang.org/htomodule.html The documentation could def use a lil cleanup. There's a

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread Marco Leise
Am Mon, 03 Jun 2013 01:02:12 +0200 schrieb Adam D. Ruppe destructiona...@gmail.com: On Sunday, 2 June 2013 at 21:53:56 UTC, Marco Leise wrote: Also eventually we should generate X bindings for all platforms (including Windows) from the XML definitions like XCB does. hmm I don't see an

Re: simpledisplay.d now works on as 64 bit on X

2013-06-02 Thread Adam D. Ruppe
On Monday, 3 June 2013 at 00:15:20 UTC, Marco Leise wrote: all the remote procedure calls to the X Server. Internally those calls rely on a small generic set of functions that serializes the requests for transmission. I see. I just skimmed an xcb tutorial and it isn't all that different than