www.digitalmars.com         C & C++   DMDScript  

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

reply Mariusz =?utf-8?q?Gliwi=C5=84ski?= <alienballance gmail.com> writes:
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Hello,
Why don't You make htod opensource? I don't think it has commercial potenti=
al,=20
or I'm wrong? I'm asking, because it's a shame that people who wants publis=
h D=20
bindings have to make their own scripts for that (so bindings can be genera=
ted=20
on !windows too).
If there are no chances for getting htod, maybe someone know decent binding=
=20
generators (scripting languages preferred)? The ones, which I've been using=
=20
are too bad (i.e. stripping out const from various places).

Cheers,
Mariusz Gliwi=C5=84ski
Dec 21 2010
next sibling parent reply Michel Fortin <michel.fortin michelf.com> writes:
On 2010-12-21 16:58:02 -0500, Mariusz Gliwiński <alienballance gmail.com> said:

 Hello,
 Why don't You make htod opensource?
If I remember well, Walter said it includes parts of his C++ compiler (DMC), which he sells, is closed source, and has a long history. It's possible he does not have the right to license it as open source, or perhaps he just doesn't want to disclose the source for DMC. -- Michel Fortin michel.fortin michelf.com http://michelf.com/
Dec 21 2010
parent Walter Bright <newshound2 digitalmars.com> writes:
Michel Fortin wrote:
 If I remember well, Walter said it includes parts of his C++ compiler 
 (DMC), which he sells, is closed source, and has a long history. It's 
 possible he does not have the right to license it as open source, or 
 perhaps he just doesn't want to disclose the source for DMC.
You can buy the source to DMC!
Dec 21 2010
prev sibling next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
Mariusz Gliwiński wrote:
 Why don't You make htod opensource?
htod is built out of the C and C++ compiler front end, the source of which Digital Mars sells.
Dec 21 2010
parent reply Mariusz =?utf-8?q?Gliwi=C5=84ski?= <alienballance gmail.com> writes:
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable

22.12.2010   03:17:31 Walter:
 htod is built out of the C and C++ compiler front end, the source of which
 Digital Mars sells.
Thanks, I understand that. Why htod strips out const? 1) in: const int var =3D 2; out: null 2) in: DLL const char *func( int arg ); out: char * func(int arg); 3) in: DLL void func( int arg, const char *arg2 ); out: void func(int arg, const char *arg2); 4) there is const int * const and void func() const too, of course a) Are there any chances to fix it? b) If no, someone of You have seen tool that implements const's properly? (= as=20 I said, scripting language would be preferred, but anything appreciated) Cheers, Mariusz Gliwi=C5=84ski
Dec 21 2010
parent Walter Bright <newshound2 digitalmars.com> writes:
Mariusz Gliwiński wrote:
 Thanks, I understand that. Why htod strips out const?
 1)
 in: const int var = 2;
 out: null
 
 2)
 in: DLL const char *func( int arg );
 out: char * func(int arg);
 
 3)
 in: DLL void func( int arg, const char *arg2 );
 out: void  func(int arg, const char *arg2);
 
 4) there is
 const int * const
 and void func() const
 too, of course
 
 a) Are there any chances to fix it?
 b) If no, someone of You have seen tool that implements const's properly? (as 
 I said, scripting language would be preferred, but anything appreciated)
htod was built for D1, and hasn't been updated for D2. Hence, there are some issues. But it cannot work perfectly, there'll usually be a bit of hand editing of the result.
Dec 21 2010
prev sibling next sibling parent 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
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. 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
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 reply Mariusz =?utf-8?q?Gliwi=C5=84ski?= <alienballance gmail.com> writes:
  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
parent reply 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
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=
g.
 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:
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
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.
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.
Dec 23 2010
prev sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2010-12-21 22:58, 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).
 If there are no chances for getting htod, maybe someone know decent binding
 generators (scripting languages preferred)? The ones, which I've been using
 are too bad (i.e. stripping out const from various places).

 Cheers,
 Mariusz Gliwiński
I'm working on a tool that creates bindings for Objective-C which of course have to work for plain C as well. It's built using the Clang libraries (it really helps having a complete frontend) and would work on any platforms supported by Clang. Even if Clang's support for Windows my not be complete I think it's enough for this tool, I mean it doesn't generate any binaries. -- /Jacob Carlborg
Dec 22 2010
parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Well, Clang can build binaries on Windows. AFAIK the only problem is
exceptions on Windows.

On 12/22/10, Jacob Carlborg <doob me.com> wrote:
 On 2010-12-21 22:58, Mariusz Gliwi=C5=84ski 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).
 If there are no chances for getting htod, maybe someone know decent
 binding
 generators (scripting languages preferred)? The ones, which I've been
 using
 are too bad (i.e. stripping out const from various places).

 Cheers,
 Mariusz Gliwi=C5=84ski
I'm working on a tool that creates bindings for Objective-C which of course have to work for plain C as well. It's built using the Clang libraries (it really helps having a complete frontend) and would work on any platforms supported by Clang. Even if Clang's support for Windows my not be complete I think it's enough for this tool, I mean it doesn't generate any binaries. -- /Jacob Carlborg
Dec 22 2010