|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
D.gnu - hello world compiled
Since it's the new year and we all have a few days off I figure'd I'd try to
see just how bad it would be to modify the C++ front end to compile D.
After one day of search/replace cxx (and cp and tons of other stuff) with
dmd and one parser change to recognize "extern (C)" (in parse.y and the
wonderfully named file "spew.c") I got hello world to compile and run
(linked with libstc++):
extern (C) void printf(char*, ...);
extern (C) int main(int argc, char**argv)
{
printf("hello world.\n");
return 0;
}
[/home/bhinkle/d/gcc/build]845 %
../gcc-3.3.2/configure --enable-languages=c,dmd
[snip]
[/home/bhinkle/d/gcc/build]846 % make bootstrap
[snip]
[/home/bhinkle/d/gcc/build]847 % cd gcc
[/home/bhinkle/d/gcc/build/gcc]848 % gdmd
/home/bhinkle/hello.d -L. -L/home/bhinkle
[/home/bhinkle/d/gcc/build/gcc]849 % a.out
hello world.
Now my goal (something that would actually require work) is to get phobos
compiled. It doesn't look like there are any templates in there so templates
will wait. I figure I'll run into a brick wall at some point but what the
heck.
Anyway, I'm not sure how far I'll get but happy new year.
-Ben
Jan 02 2004
Ben Hinkle wrote:Since it's the new year and we all have a few days off I figure'd I'd try to see just how bad it would be to modify the C++ front end to compile D. After one day of search/replace cxx (and cp and tons of other stuff) with dmd and one parser change to recognize "extern (C)" (in parse.y and the wonderfully named file "spew.c") I got hello world to compile and run (linked with libstc++): Jan 02 2004
Ben Hinkle wrote: Jan 03 2004
You did not use the 3.4 branch?!? Jan 03 2004
"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:bt3thn$2i0a$1 digitaldaemon.com...Since it's the new year and we all have a few days off I figure'd I'd try Jan 03 2004
"Walter" <walter digitalmars.com> wrote in message news:bt7qeh$294u$2 digitaldaemon.com..."Ben Hinkle" <bhinkle4 juno.com> wrote in message news:bt3thn$2i0a$1 digitaldaemon.com...Since it's the new year and we all have a few days off I figure'd I'd Jan 03 2004
"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:bt84h2$2n84$1 digitaldaemon.com...Also I started ripping out the preprocessor but that caused havoc in the parse and lex code (and that lovely spew.c). Jan 03 2004
|