From: Noixe on
Hello,

I'm Italian, sorry for my english.

Is possible create a tool that convert a source written in a dynamic typing
language (as Python) to a source in C/C++ compilable with GCC compiler, for
example?

Where disadvantage would be using this tool?
I guess, that sources generated would not be optimized.

From: Ian Collins on
On 03/31/10 07:40 AM, Noixe wrote:
> Hello,
>
> I'm Italian, sorry for my english.
>
> Is possible create a tool that convert a source written in a dynamic
> typing language (as Python) to a source in C/C++ compilable with GCC
> compiler, for example?

I doubt it. There are constructs in dynamic languages (any form of eval
or reflection) that can't work in C or C++. Dynamic typing is also an
issues with any static typed language (c, C++ or Java).

--
Ian Collins
From: BGB / cr88192 on

"Ian Collins" <ian-news(a)hotmail.com> wrote in message
news:81fbmeFua5U5(a)mid.individual.net...
> On 03/31/10 07:40 AM, Noixe wrote:
>> Hello,
>>
>> I'm Italian, sorry for my english.
>>
>> Is possible create a tool that convert a source written in a dynamic
>> typing language (as Python) to a source in C/C++ compilable with GCC
>> compiler, for example?
>
> I doubt it. There are constructs in dynamic languages (any form of eval
> or reflection) that can't work in C or C++. Dynamic typing is also an
> issues with any static typed language (c, C++ or Java).
>

well, it depends a lot on how much other code can be dragged along with it.
if one can drag along a big support library, or maybe a whole framework,
than one can do a lot more than, say, if they wanted the code to be
standalone (or have a minimal support API).


standalone code would be a problem.
but, with a library to support it, is is fairly easy.


for example, in my case, I added eval and reflection, to C...

dynamic typing and garbage collection are features I have had for a fairly
long time.
....

> --
> Ian Collins