[Prev][Next][Index][Thread]

Thanks for your reply Bruce




> For the same reason that there exist compilers for C++, FORTRAN, Ada,
> Scheme, Eiffel (and many other languages) that produce output in C rather
> than in machine code or assembly language:
>
> - it's easier

Benefit then to using Dylan ? Because its simpler to learn and utilize ?

>
> - every machine in the world has a C compiler

Then why not just use one of them ?

>
> - you don't need to worry about instruction set styles and encodings and
> register architectures on jillions of different machines (or even on one)
>
> - you don't need to worry about instruction selection and scheduling and
> so forth either.
>
> - you don't need to worry about runtime conventions such as how to call
> functions and which registers to save and so forth
>
> - you don't have to worry about how to call OS functions and standard
libraries
>
>
> The C compiler already knows all that stuff.  Someone worked hard on it.
>
>

Then there is an advantage to using the C code relating to portability,
functionality, and speed optimizations ? It would be to much work to make an
optimized Dylan compiler for every situation ?

> > I would think C/C++ to Dylan would be more useful ? Can this take C
> > and go the other way ?

This is an important topic I think, Eiffel has a C/C++ legacy interface as
well as Dolphin, why not Dylan ?  I can see the benefits above in being able
to use existing C tools to aid in efficient programming from Dylan, but what
about all the code written in C++ that could be used in the Dylan. I have
about five different rendering libraries all optimized for speed that can
not be used in Dylan because they are coded in C++. This is a waste to have
to rewrite them in Dylan.

>
> The C output isn't intended to be human-readable (although d2c takes some
> care to preserve function and variable names etc in the generated code --
> much better than, say, CFront -- the original C++ compiler -- did).
>
> You don't use d2c to convert your Dylan program to C and then work on it
> some more in C.  You program in Dylan.  d2c compiles Dylan into C, and
> then automatically calls the C compiler to produce a runnable program.
> You usually never even look at the C code.

Please excuse my ignorance on programming details, I am not a professional
programmer with years of experience. I REALLY like Dylan and I am very happy
using it, but I see so many other languages trying to bridge the barrier
between C++ and themselves. Dylan is extremely weak (unless I have missed
something) when it comes to integrating with the most popular one of all
C++.


>
>
> The problem of taking a program in one language and turning it into a
> human readable, idiomatic, maintainable program in another programming
> language is a *much* harder one.  Well beyond the current state of the
> art, I'd say.

I am not asking for a direct translation of C++ to Dylan in human readable
form, just the same thing as the D2C, a compilation of a C++ project with
headers etc. to a useable module that can be easily called and used in Dylan
without having to manually code 100+ header files into Dylan equivalents.

Please I am not trying to be rude its just ignorance on my part,  why can we
not use SWIG to generate interfaces or something similar automatically ? I
looked at SWIG but you need to be well versed in both C++ and Dylan to make
it work, I am trying to stay away from C++ and just concentrate on Dylan.

Sincerely,

Shawn








Follow-Ups: References: