August 25, 2006
Status quo:

I was busy doing other stuff in the last weeks, so no advance yet. I will continue my port during the next weeks.

Some thoughts though:

It was mentioned in another mail. After a while, there is a big temptation to give up. The reasons are simple. The port is working so far and I have prooven to myself that it is possible. But since I am not experienced D, I find many places that I should have done different, and I also know by now that things take a *lot* longer than anticipated. The fun is over - it is hard learning now. I am sure many developers reached exactly this point on various D porting projects.

So what to do:

I am wrapping up FLTK 1.1.8 for a final 1.1 release these days. After that, I'll get back to D-FLTK - with a few changes.

1: It is impossible to move that much text without some automation, so I will write a bunch of macros that make life a lot easier. Automated translation is not possible though. A human has to see every line of code IMHO. (->macros, editor)

2: For a "D" starter, it is important that someone is looking over my code and stops me right away when I am on a wrong path, preferably after every "svn commit", probably twice a day. This saves me from building dead ends and doing double work. (->dedicated mailing list, wiki)

3: The first iteration *must* stick with the original as close as possible, or I will end up with a huge port that doesn't run as expected and I spend months in debugging. Example: the "Fl_Widget::handle(int)" function is virtual, and the parameter is an event. For D, I changed it to "Fl_Widget::handle(Fl_Event)" with "typedef int Fl_Event". Man, did I regret doing that! I forgot  to change "int" into "Fl_Event" in one single instance, but it took me over three hours to find out, why "handle(int)" was never called. (->don't diverge)

4. follows from 3. Do architectural changes later! Change char* to char[], but do it *later*, After you know that /all/ code works fine. Then optimize step by step. ALways keep a running system, always have users around who will point out bugs right away. (->modify later)

5. and last point. The interest in a Mac port is relatively low. SInce FLTK is tri-paltform, I should do all three ports in parallel. That will keep me from visiting the same code three times, and it will also give more dearly needed feedback (see 2.). (->port everything)

Nachtisch (Dessert):

Alrighty, if you made it here, then this is the treat: D is an awesome language and it has a great community around it. Following "d.D.annonce", find myself proud in the middle of a bunch of very smart people. Woderful and addictive.


Thanks,

 Matthias
August 25, 2006
MatthiasM wrote:

> 1: It is impossible to move that much text without some automation, so I will write a bunch of macros that make life a lot easier. Automated translation is not possible though. A human has to see every line of code IMHO. (->macros, editor)
> 

This point is very interesting :-) I am trying to convert some other C++ programs and found myself doing simple translations (e.g. std::string --> char[], #include -> import, vector<object> -> object[]) very often when in fact it is automatic, simple work. Also merging .cpp and .h to .d file is rather boring work, which could be automated.

AFAIK there are few tools (e.g. Language Machine) which are created with automatic translation of one language to another one, but I found them too complicated to be effectively used (maybe am I wrong?).

I would propose here to start writing simple macros in D itself (D has very good regular expression support) which will do simple translations. Probably the best way would be to create one program to do one simple translation, and then start these programs one by one to get final translation. Additionally you can use #!dmd -run in first line of programs and you get similar experience as in case of bash scripts - you can just write on command line ./translate.d and it will start "script". See docs about scripting on D site.

Of course additional programmer intervention will be necessary anyway after such a simple conversion ....

-- 
Regards
Marcin Kuszczak
(Aarti_pl)
September 01, 2006
New commit to the svn.

As somewhat implied in my previous mail, I restarted the port from scratch, this time using some scripts to make life easier. It was also a great opportunity to put some recommendations from you guys in.

So, within two days I was able to port as much as I did in a week the first time around. Good. Windows are displayed, fonts can be loaded, rectangles can be drawn, and some mouse clicks are handled. Good enough to get a minimal UI up.

There is one other major change now which helps me tremendously: I am porting more literally, meaning, I am currently using C style strings. No support for D style strings yet. First the port, then the refinements.

Thanks for listening.

 Matthias

PS: I got some nice reactions from the FLTK community as well over the weeks. I also managed to clean the entire FLTK1.1.8 bug list. With that solid base, there may be some help coming up... .
September 02, 2006
MatthiasM wrote:
> 
> New commit to the svn.
> 
> As somewhat implied in my previous mail, I restarted the port from scratch, this time using some scripts to make life easier. It was also a great opportunity to put some recommendations from you guys in.
> 
> So, within two days I was able to port as much as I did in a week the first time around. Good. Windows are displayed, fonts can be loaded, rectangles can be drawn, and some mouse clicks are handled. Good enough to get a minimal UI up.
> 
> There is one other major change now which helps me tremendously: I am porting more literally, meaning, I am currently using C style strings. No support for D style strings yet. First the port, then the refinements.
> 
> Thanks for listening.
> 
>  Matthias
> 
> PS: I got some nice reactions from the FLTK community as well over the weeks. I also managed to clean the entire FLTK1.1.8 bug list. With that solid base, there may be some help coming up... .

That's cool! It's good to see developers not enamored with D (yet <g>) provide some positive feedback. I think D and FLTK were in many ways made for each other.
October 02, 2006
Hello Guys,

Any update on FLTK D port ?

Thanks
ns
1 2 3 4 5 6 7 8 9 10 11
Next ›   Last »