www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: What's the problem in opensourcing htod?

reply Sean Kelly <sean invisibleduck.org> writes:
Mariusz Gliwiński Wrote:

 Hello,
 Why don't You make htod opensource? I don't think it has commercial potential, 
 or I'm wrong? I'm asking, because it's a shame that people who wants publish D 
 bindings have to make their own scripts for that (so bindings can be generated 
 on !windows too).

I hate to say it, but I've found that creating the D headers by hand is faster than running htod and hand-editing to fix screw-ups. Particularly if there are any #if statements to contend with.
Dec 22 2010
next sibling parent Iain Buclaw <ibuclaw ubuntu.com> writes:
== Quote from Sean Kelly (sean invisibleduck.org)'s article
 Mariusz Gliwiński Wrote:
 Hello,
 Why don't You make htod opensource? I don't think it has commercial


 or I'm wrong? I'm asking, because it's a shame that people who wants publish


 bindings have to make their own scripts for that (so bindings can be


 on !windows too).


any #if statements to contend with. Hear hear. Although that does not mean that you are less likely to make the occasional cock-up. *cough* RAND_MAX is == INT_MAX in GLIBC *cough* ;) Thought I might give mention that part of GDC Phobos build process is using a tailored (not very friendly) application to generate D source files from system C headers that goes by the obscurely named x3. An example job you can give it is: x3_gi_push_header("<stdlib.h>"); x3_out_int_value("RAND_MAX"); x3_gi_pop_header(); Which outputs (on my system) const int RAND_MAX = 2147483647; I suppose there's nothing stopping someone to have a look at how it works and bastardise it for normal usage. And though it's geared towards D1, does not emit anything D2 can't handle. Regards
Dec 22 2010
prev sibling parent reply BLS <windevguy hotmail.de> writes:
On 22/12/2010 16:19, Sean Kelly wrote:
 I hate to say it, but I've found that creating the D headers by hand is faster
than running htod and hand-editing to fix screw-ups.  Particularly if there are
any #if statements to contend with.

Did you consider to use SWIG instead of htod ?
Dec 22 2010
parent reply Sean Kelly <sean invisibleduck.org> writes:
BLS Wrote:

 On 22/12/2010 16:19, Sean Kelly wrote:
 I hate to say it, but I've found that creating the D headers by hand is faster
than running htod and hand-editing to fix screw-ups.  Particularly if there are
any #if statements to contend with.

Did you consider to use SWIG instead of htod ?

Haven't tried it. But then I don't need to convert headers very often.
Dec 22 2010
next sibling parent reply BLS <windevguy hotmail.de> writes:
On 22/12/2010 19:11, Sean Kelly wrote:
 BLS Wrote:

 On 22/12/2010 16:19, Sean Kelly wrote:
 I hate to say it, but I've found that creating the D headers by hand is faster
than running htod and hand-editing to fix screw-ups.  Particularly if there are
any #if statements to contend with.

Did you consider to use SWIG instead of htod ?

Haven't tried it. But then I don't need to convert headers very often.

Probably the community hasn't recognized SWIG 4 D yet. So I try to spread the word :) I tried SWIG for C++ to D. But frankly said I am not able to offer substantial feedback 'cause every binding I have created was more or less in a toy area.. However, using SWIG on C header files (likewise on postgresql)... I just can say cool stuff. Bjoern
Dec 22 2010
parent BLS <windevguy hotmail.de> writes:
On 23/12/2010 05:34, Mariusz Gliwiński wrote:
 wig looks interesting. Again, it strips const so probably D1 (i just skipped
 D1, it wasn't interesting enough for me to switch from widely used languages
 so don't know it's feature-set) and it's using tango, but looks promising.

SWIG 4 D uses D1/Tango by default. If you want D2/Phobos make sure that you configure for D2. This done, consts are not stripped anymore. AFAIK, Klickvberbot is working on static library support.
Dec 23 2010
prev sibling next sibling parent Mariusz =?utf-8?q?Gliwi=C5=84ski?= <alienballance gmail.com> writes:
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Wednesday 22 December 2010   23:02:44 BLS:
  tried SWIG for C++ to D. But frankly said I am not able to offer=20
 substantial feedback 'cause every binding I have created was more or=20
 less in a toy area..

Thanks for answers everyone, swig looks interesting. Again, it strips const so probably D1 (i just skipp= ed=20 D1, it wasn't interesting enough for me to switch from widely used language= s=20 so don't know it's feature-set) and it's using tango, but looks promising. It supports shared loading, so I won't need to wait until patch will be fin= ally=20 commited to derelict. So, even if I won't use it right now, and will be=20 needing to develop `const` supporting script I would advice anyone else to= =20 check SWIG for D, because it's worth it. Cheers, Mariusz Gliwi=C5=84ski
Dec 22 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
I think you just need to pass a flag to SWIG when building it to get
D2 support. I've done it a few days ago..

On 12/23/10, BLS <windevguy hotmail.de> wrote:
 On 23/12/2010 05:34, Mariusz Gliwi=C5=84ski wrote:
 wig looks interesting. Again, it strips const so probably D1 (i just
 skipped
 D1, it wasn't interesting enough for me to switch from widely used
 languages
 so don't know it's feature-set) and it's using tango, but looks promisin=


 SWIG 4 D uses D1/Tango by default. If you want D2/Phobos make sure that
 you configure for D2. This done, consts are not stripped anymore.
 AFAIK, Klickvberbot is working on static library  support.

Dec 23 2010
prev sibling parent Jimmy Cao <jcao219 gmail.com> writes:
--0023547c95cb017526049822be3a
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, Dec 23, 2010 at 10:29 AM, Andrej Mitrovic <
andrej.mitrovich gmail.com> wrote:

 I think you just need to pass a flag to SWIG when building it to get
 D2 support. I've done it a few days ago..

 On 12/23/10, BLS <windevguy hotmail.de> wrote:
 On 23/12/2010 05:34, Mariusz Gliwi=C5=84ski wrote:
 wig looks interesting. Again, it strips const so probably D1 (i just
 skipped
 D1, it wasn't interesting enough for me to switch from widely used
 languages
 so don't know it's feature-set) and it's using tango, but looks


 SWIG 4 D uses D1/Tango by default. If you want D2/Phobos make sure that
 you configure for D2. This done, consts are not stripped anymore.
 AFAIK, Klickvberbot is working on static library  support.


Yes it's the -d2 flag. BLS, I'm also trying to spread the word on SWIG 4 D. It's an extremely nic= e tool. I'm trying to wrap Irrlicht with it. --0023547c95cb017526049822be3a Content-Type: text/html; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable <div><div class=3D"gmail_quote">On Thu, Dec 23, 2010 at 10:29 AM, Andrej Mi= trovic <span dir=3D"ltr">&lt;<a href=3D"mailto:andrej.mitrovich gmail.com">= andrej.mitrovich gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gm= ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le= ft:1ex;"> I think you just need to pass a flag to SWIG when building it to get<br> D2 support. I&#39;ve done it a few days ago..<br> <div><div></div><div class=3D"h5"><br> On 12/23/10, BLS &lt;<a href=3D"mailto:windevguy hotmail.de">windevguy hotm= ail.de</a>&gt; wrote:<br> &gt; On 23/12/2010 05:34, Mariusz Gliwi=F1ski wrote:<br> &gt;&gt; wig looks interesting. Again, it strips const so probably D1 (i ju= st<br> &gt;&gt; skipped<br> &gt;&gt; D1, it wasn&#39;t interesting enough for me to switch from widely = used<br> &gt;&gt; languages<br> &gt;&gt; so don&#39;t know it&#39;s feature-set) and it&#39;s using tango, = but looks promising.<br> &gt;<br> &gt; SWIG 4 D uses D1/Tango by default. If you want D2/Phobos make sure tha= t<br> &gt; you configure for D2. This done, consts are not stripped anymore.<br> &gt; AFAIK, Klickvberbot is working on static library =A0support.<br> &gt;<br> &gt;<br> </div></div></blockquote></div><br></div><div>Yes it&#39;s the -d2 flag.</d= iv><div><br></div><div>BLS, I&#39;m also trying to spread the word on SWIG = 4 D. =A0It&#39;s an extremely nice tool. =A0I&#39;m trying to wrap Irrlicht= with it.</div> <div><br></div><div><br></div> --0023547c95cb017526049822be3a--
Dec 23 2010