Sign up

idea for gtk to D help

One of the problems I have with using gtkD is finding proper conversion from gtk code written in C/C++ and that of D. Since gtkD uses a more object oriented approach and has some name chances, it makes it hard to find what converts to what.

I wonder if something could be done about this?

Suppose there was a help page where one could enter in the gtk name(or code) and get the gtkD equivalent.

It wouldn't have to be perfect, just work most of the time(which is better than none of the time).

I wonder if generating such a mapping could be somewhat automated by simply doing a search in the code for the c name and then getting the D function that wraps it(since most are wrapped). This is basically what I do by hand. I search the gtkD source and then go through all the matches. It works but is slow and error prone.

Re: idea for gtk to D help

On 01-06-2019 03:33, Alex X wrote:

One of the problems I have with using gtkD is finding proper conversion from gtk code written in C/C++ and that of D. Since gtkD uses a more object oriented approach and has some name chances, it makes it hard to find what converts to what.

I wonder if something could be done about this?

Suppose there was a help page where one could enter in the gtk name(or code) and get the gtkD equivalent.

It wouldn't have to be perfect, just work most of the time(which is better than none of the time).

I wonder if generating such a mapping could be somewhat automated by simply doing a search in the code for the c name and then getting the D function that wraps it(since most are wrapped). This is basically what I do by hand. I search the gtkD source and then go through all the matches. It works but is slow and error prone.

Maybe we should put the original GTK function name in the documentation
so a search would turn up the correct d function.

Re: idea for gtk to D help

On Sat, 01 Jun 2019 01:33:29 GMT, Alex X wrote:

One of the problems I have with using gtkD is finding proper conversion from gtk code written in C/C++ and that of D. Since gtkD uses a more object oriented approach and has some name chances, it makes it hard to find what converts to what.

I wonder if something could be done about this?

Suppose there was a help page where one could enter in the gtk name(or code) and get the gtkD equivalent.

So, you're looking for a Rosetta Stone. It's an idea I've been toying with, but the task is monumental, so for now what I can offer is the gtkDcoding blog.

ATM, there are 42 posts covering 86 discrete examples of how to do various things in GtkD. And most of them have been ported from other languages, either from examples I've found around the Internet this year or from examples I wrote for the PHP-GTK2 blog I wrote in 2006. So in a way, it's kind-of a Rosetta Stone, but not as interactive as you're describing.

Re: idea for gtk to D help

On Sat, 1 Jun 2019 13:01:41 +0200, Mike Wey wrote:

On 01-06-2019 03:33, Alex X wrote:

One of the problems I have with using gtkD is finding proper conversion from gtk code written in C/C++ and that of D. Since gtkD uses a more object oriented approach and has some name chances, it makes it hard to find what converts to what.

I wonder if something could be done about this?

Suppose there was a help page where one could enter in the gtk name(or code) and get the gtkD equivalent.

It wouldn't have to be perfect, just work most of the time(which is better than none of the time).

I wonder if generating such a mapping could be somewhat automated by simply doing a search in the code for the c name and then getting the D function that wraps it(since most are wrapped). This is basically what I do by hand. I search the gtkD source and then go through all the matches. It works but is slow and error prone.

Maybe we should put the original GTK function name in the documentation
so a search would turn up the correct d function.

That might help... at least provide some help.

Re: idea for gtk to D help

On Sat, 01 Jun 2019 11:09:30 GMT, Ron Tarrant wrote:

On Sat, 01 Jun 2019 01:33:29 GMT, Alex X wrote:

One of the problems I have with using gtkD is finding proper conversion from gtk code written in C/C++ and that of D. Since gtkD uses a more object oriented approach and has some name chances, it makes it hard to find what converts to what.

I wonder if something could be done about this?

Suppose there was a help page where one could enter in the gtk name(or code) and get the gtkD equivalent.
So, you're looking for a Rosetta Stone. It's an idea I've been toying with, but the task is monumental, so for now what I can offer is the gtkDcoding blog.

ATM, there are 42 posts covering 86 discrete examples of how to do various things in GtkD. And most of them have been ported from other languages, either from examples I've found around the Internet this year or from examples I wrote for the PHP-GTK2 blog I wrote in 2006. So in a way, it's kind-of a Rosetta Stone, but not as interactive as you're describing.

Re: idea for gtk to D help

On Sat, 01 Jun 2019 11:09:30 GMT, Ron Tarrant wrote:

On Sat, 01 Jun 2019 01:33:29 GMT, Alex X wrote:

One of the problems I have with using gtkD is finding proper conversion from gtk code written in C/C++ and that of D. Since gtkD uses a more object oriented approach and has some name chances, it makes it hard to find what converts to what.

I wonder if something could be done about this?

Suppose there was a help page where one could enter in the gtk name(or code) and get the gtkD equivalent.
So, you're looking for a Rosetta Stone. It's an idea I've been toying with, but the task is monumental, so for now what I can offer is the gtkDcoding blog.

ATM, there are 42 posts covering 86 discrete examples of how to do various things in GtkD. And most of them have been ported from other languages, either from examples I've found around the Internet this year or from examples I wrote for the PHP-GTK2 blog I wrote in 2006. So in a way, it's kind-of a Rosetta Stone, but not as interactive as you're describing.

The problem is just finding the D equivalent function quickly. Using your blog just to look up functions would be very slow as compared to searching text(usually I can do searches in a few seconds if there is not too many hits).