March 21, 2013 Re: Proposal for Deimos documentation | ||||
---|---|---|---|---|
| ||||
Posted in reply to 1100110 | 1100110 wrote:
> On 03/20/2013 05:04 PM, Jens Mueller wrote:
> >Hi,
> >
> >I wrote some guidelines for writing a Deimos interface. It's still very
> >rough but it's a start. I'd like to add it to dlang.org to give
> >contributors better guidance, ultimately hoping to see more
> >contributions to Deimos.
> >Besides comments to improve my poor phrasing I'd especially seek to get
> >a complete list of recommendations to follow. Please comment.
> >
> >http://jkm.github.com/phobos/deimos.html
> >
> >Jens
>
> Typo!
> "git clone git://github.com/D-Programming-Deimos/openssl.git dmd
> -Iopenssl/ -lopenssl ... "
>
> -Iopenssl/ -L-lssl
Thanks. Will fix.
Jens
|
March 21, 2013 Re: Proposal for Deimos documentation | ||||
---|---|---|---|---|
| ||||
Posted in reply to 1100110 | 1100110 wrote: > On 03/20/2013 05:04 PM, Jens Mueller wrote: > >Hi, > > > >I wrote some guidelines for writing a Deimos interface. It's still very > >rough but it's a start. I'd like to add it to dlang.org to give > >contributors better guidance, ultimately hoping to see more > >contributions to Deimos. > >Besides comments to improve my poor phrasing I'd especially seek to get > >a complete list of recommendations to follow. Please comment. > > > >http://jkm.github.com/phobos/deimos.html > > > >Jens > > """ > Each must follow the directory structure > """ > > nitpick, maybe add a colon after that fragment? Probably. > """ > So far, each C header file was renamed to a D module. Next the > contents of each module will be adjusted. In general following the > advices from interfacing to c is recommended. > > The D files should try to do as least modifications as possible to > simplify updates of the C headers. This includes leaving comments > intact. The copyright for the D files should match the one being > used by the C header as they are derived work. > "" > > Maybe just a little more detail? Where do you want more detail? > Again a nitpick. But I'd like to see a few "real world" examples of some of the trickier constructs mixed in. Even if you left all the details to "interfacing to c", an example or two would clarify things IMO. An example would help here. I was wondering whether anybody has encountered a tricky example. > """ > In particular, > > Replace C's include > > Each #include needs to have a corresponding import path.to.header; > """ > > That has certainly not been my experience. Often one D import will map to a couple of c includes. > > I would suggest amending that statement. It sounds too much like a hard rule(necessary to be considered for inclusion into Deimos) to me. YMMV. Do you have any examples where one import handles many C headers. I haven't seen such cases and I wonder why you should need them. Jens |
March 21, 2013 Re: Proposal for Deimos documentation | ||||
---|---|---|---|---|
| ||||
Jens Mueller wrote:
> 1100110 wrote:
> > On 03/20/2013 05:04 PM, Jens Mueller wrote:
> > >Hi,
> > >
> > >I wrote some guidelines for writing a Deimos interface. It's still very
> > >rough but it's a start. I'd like to add it to dlang.org to give
> > >contributors better guidance, ultimately hoping to see more
> > >contributions to Deimos.
> > >Besides comments to improve my poor phrasing I'd especially seek to get
> > >a complete list of recommendations to follow. Please comment.
> > >
> > >http://jkm.github.com/phobos/deimos.html
> > >
> > >Jens
> > """
> > In particular,
> >
> > Replace C's include
> >
> > Each #include needs to have a corresponding import path.to.header;
> > """
> >
> > That has certainly not been my experience. Often one D import will map to a couple of c includes.
> >
> > I would suggest amending that statement. It sounds too much like a hard rule(necessary to be considered for inclusion into Deimos) to me. YMMV.
>
> Do you have any examples where one import handles many C headers. I haven't seen such cases and I wonder why you should need them.
Please ignore this. I now see what you are saying.
In general it'll be nice to have a list of these replacements for
standard C headers.
Jens
|
March 21, 2013 Re: Proposal for Deimos documentation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | Jacob Carlborg wrote:
> On 2013-03-20 23:04, Jens Mueller wrote:
> >Hi,
> >
> >I wrote some guidelines for writing a Deimos interface. It's still very
> >rough but it's a start. I'd like to add it to dlang.org to give
> >contributors better guidance, ultimately hoping to see more
> >contributions to Deimos.
> >Besides comments to improve my poor phrasing I'd especially seek to get
> >a complete list of recommendations to follow. Please comment.
>
> "Versioning" - Version tags should _not_ match the ones used by the C headers. The should be translated, as close as possible, to:
>
> http://dlang.org/version.html#PredefinedVersions
>
> Some might be better translated to static-if blocks.
My bad. The sentence does not belong there. It belongs to "Tag the
library version". Though I'm not sure how to do this yet.
Will fix. Thanks.
Jens
|
March 21, 2013 Re: Proposal for Deimos documentation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Craig Dillabaugh | Craig Dillabaugh wrote: > On Wednesday, 20 March 2013 at 22:04:50 UTC, Jens Mueller wrote: > >Hi, > > > >I wrote some guidelines for writing a Deimos interface. It's still > >very > >rough but it's a start. I'd like to add it to dlang.org to give > >contributors better guidance, ultimately hoping to see more > >contributions to Deimos. > >Besides comments to improve my poor phrasing I'd especially seek > >to get > >a complete list of recommendations to follow. Please comment. > > > >http://jkm.github.com/phobos/deimos.html > > > >Jens > > From the first paragraph of the linked documentation: > > "Its aim is to integrate already available C libraries. Since D is binary compatible with C ABI code a plentiful of libraries is potentially available in D. ". > > I would recommend something along the lines of: > > "Its aim is to integrate existing C libraries. Since D is binary compatible with C ABI code, this makes a wealth of existing functionality available in D with limited effort." Much better. More of this please. > I tried to use the "Improve this page" link to make this suggestion, but GitHub gave me a "Page Not Found" error. Sorry. This does not work. Probably I should make it work. Jens |
March 21, 2013 Re: Proposal for Deimos documentation | ||||
---|---|---|---|---|
| ||||
Posted in reply to 1100110 | On 2013-03-21 14:53, 1100110 wrote: > That does sound vaguely familiar... > Yes, it's size is 16 on Windows and 32 on Linux and OSX. > > My bad, dchar then. (with wchar for Windows) Or just use wchar_t and it will work correctly, I assume. -- /Jacob Carlborg |
March 21, 2013 Re: Proposal for Deimos documentation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jens Mueller | On 2013-03-21 15:35, Jens Mueller wrote: > My bad. The sentence does not belong there. It belongs to "Tag the > library version". Though I'm not sure how to do this yet. > Will fix. Thanks. Perhaps we could create list that maps C defines to D versions. Example, for Mac OS X the __APPLE__ define is used, in D what would be version(OSX). -- /Jacob Carlborg |
March 21, 2013 Re: Proposal for Deimos documentation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | Jacob Carlborg wrote:
> On 2013-03-21 15:35, Jens Mueller wrote:
>
> >My bad. The sentence does not belong there. It belongs to "Tag the
> >library version". Though I'm not sure how to do this yet.
> >Will fix. Thanks.
>
> Perhaps we could create list that maps C defines to D versions. Example, for Mac OS X the __APPLE__ define is used, in D what would be version(OSX).
That would be very helpful. But these are not portable in C, right? Anyway I should add a link to D versioning and some example.
Jens
|
March 21, 2013 Re: Proposal for Deimos documentation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On 03/21/2013 10:25 AM, Jacob Carlborg wrote:
> On 2013-03-21 14:53, 1100110 wrote:
>
>> That does sound vaguely familiar...
>> Yes, it's size is 16 on Windows and 32 on Linux and OSX.
>>
>> My bad, dchar then. (with wchar for Windows)
>
> Or just use wchar_t and it will work correctly, I assume.
>
Ok, you win.
But I'm still up by one!
|
March 21, 2013 Re: Proposal for Deimos documentation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jens Mueller | On 2013-03-21 16:40, Jens Mueller wrote: > That would be very helpful. But these are not portable in C, right? > Anyway I should add a link to D versioning and some example. No, they are vendor and platform specific. But they are reliable. -- /Jacob Carlborg |
Copyright © 1999-2021 by the D Language Foundation