FLTK native in 'D'. Would that be useful?

Marcin Kuszczak aarti at interia.pl
Fri Aug 25 01:48:33 PDT 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)



More information about the Digitalmars-d-dwt mailing list