Announcing c++ backend - alpha version

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

Announcing c++ backend - alpha version

Gamehaxe
Hi,
I have put together an initial version of a c++ backend for haxe.
This generates c++ code, that can be compiled to an executable.
(Windows only at this stage)  More details at:

http://gamehaxe.com/2008/10/28/c-backend-for-haxe/

The performance, for certain applications, is about 5 times
faster than neko, and about the same as flash.  I think this
could be improved with garbage collection, rather than
reference counting.

The code is not complete, but I think it is at a point where
some outside comments would be useful.

Hugh

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Benjamin Dasnois
Hello Hugh,

This looks very promising !

Regards,

On Tue, Oct 28, 2008 at 3:03 PM, Hugh Sanderson <[hidden email]> wrote:

> Hi,
> I have put together an initial version of a c++ backend for haxe.
> This generates c++ code, that can be compiled to an executable.
> (Windows only at this stage)  More details at:
>
> http://gamehaxe.com/2008/10/28/c-backend-for-haxe/
>
> The performance, for certain applications, is about 5 times
> faster than neko, and about the same as flash.  I think this
> could be improved with garbage collection, rather than
> reference counting.
>
> The code is not complete, but I think it is at a point where
> some outside comments would be useful.
>
> Hugh
>
> --
> haXe - an open source web programming language
> http://haxe.org
>



--
DASNOIS Benjamin
http://www.benjamindasnois.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Franco Ponticelli
In reply to this post by Gamehaxe
Congratulations! I know how much time this kind of effort requires and you have chosen a very appreciated target.
I hope I can test it soon.

Franco.

On Tue, Oct 28, 2008 at 2:03 PM, Hugh Sanderson <[hidden email]> wrote:
Hi,
I have put together an initial version of a c++ backend for haxe.
This generates c++ code, that can be compiled to an executable.
(Windows only at this stage)  More details at:

http://gamehaxe.com/2008/10/28/c-backend-for-haxe/

The performance, for certain applications, is about 5 times
faster than neko, and about the same as flash.  I think this
could be improved with garbage collection, rather than
reference counting.

The code is not complete, but I think it is at a point where
some outside comments would be useful.

Hugh

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Nicolas Cannasse
In reply to this post by Gamehaxe
Hugh Sanderson a écrit :

> Hi,
> I have put together an initial version of a c++ backend for haxe.
> This generates c++ code, that can be compiled to an executable.
> (Windows only at this stage)  More details at:
>
> http://gamehaxe.com/2008/10/28/c-backend-for-haxe/
>
> The performance, for certain applications, is about 5 times
> faster than neko, and about the same as flash.  I think this
> could be improved with garbage collection, rather than
> reference counting.
>
> The code is not complete, but I think it is at a point where
> some outside comments would be useful.

Great :)

Hope to see it evolving further so it can reach 1.0 in the future ;)

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Adrian Veith
In reply to this post by Gamehaxe
Great news,

if you think about garbage collected c++, you should also look at the D
language. It's close to c++ (the brain behind D is Walter Bright, who
has written the Zortech c++ = first c++ for DOS in the 1980ies - aka
Symantec c++ compiler), but brings in many new ideas (and throws out
many useless stuff). In the end, it's much closer to haxe than c++ and
generates compiled code comparable to c++. Look at
http://www.digitalmars.com/d/index.html

Cheers,

Adrian.

Hugh Sanderson schrieb:

> Hi,
> I have put together an initial version of a c++ backend for haxe.
> This generates c++ code, that can be compiled to an executable.
> (Windows only at this stage)  More details at:
>
> http://gamehaxe.com/2008/10/28/c-backend-for-haxe/
>
> The performance, for certain applications, is about 5 times
> faster than neko, and about the same as flash.  I think this
> could be improved with garbage collection, rather than
> reference counting.
>
> The code is not complete, but I think it is at a point where
> some outside comments would be useful.
>
> Hugh
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

jlm@justinfront.net
In reply to this post by Nicolas Cannasse
Well done exciting stuff.

Does this support XAML?

I was watching something about "DLR console" where dynamic languages  
can be typed dynamically in safari and mixed, they used python, ruby  
and also jscript which apparently is like javascript so wondered if  
someone had considered dynamic haxe, or maybe jscript is close enough  
to jscript already, there is instructions on making a DLR language here!

http://www.bitwisemag.com/2/DLR-Build-Your-Own-Language

I downloaded DLR console zip I found but the only ver I found did not  
have jscript :(


On 28 Oct 2008, at 14:51, Nicolas Cannasse wrote:

> Hugh Sanderson a écrit :
>> Hi,
>> I have put together an initial version of a c++ backend for haxe.
>> This generates c++ code, that can be compiled to an executable.
>> (Windows only at this stage)  More details at:
>> http://gamehaxe.com/2008/10/28/c-backend-for-haxe/
>> The performance, for certain applications, is about 5 times
>> faster than neko, and about the same as flash.  I think this
>> could be improved with garbage collection, rather than
>> reference counting.
>> The code is not complete, but I think it is at a point where
>> some outside comments would be useful.
>
> Great :)
>
> Hope to see it evolving further so it can reach 1.0 in the future ;)
>
> Best,
> Nicolas
>
> --
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

James W. Hofmann
In reply to this post by Gamehaxe
Quoting "Hugh Sanderson" <[hidden email]>:

> Hi,
> I have put together an initial version of a c++ backend for haxe.
> This generates c++ code, that can be compiled to an executable.
> (Windows only at this stage)  More details at:
>
> http://gamehaxe.com/2008/10/28/c-backend-for-haxe/
>
> The performance, for certain applications, is about 5 times
> faster than neko, and about the same as flash.  I think this
> could be improved with garbage collection, rather than
> reference counting.
>
> The code is not complete, but I think it is at a point where
> some outside comments would be useful.
>
> Hugh
>

This is one I've been waiting for - not for any particular project,  
but because it's another great advertisement for my favorite language.  
As the C++ performance gets better, haXe will look more and more  
appealing for general-purpose computation, and programmers doing those  
sorts of applications will start contributing. We'll get cool and  
useful "low-level" type code, something which other dynamic languages  
don't have because they were too slow for those programmers to bother  
with previously.

A thought: would this backend work well as scripting for a  
limited-memory environment like a game console? Typically on those  
platforms everything is pre-allocated in memory pools to minimize  
fragmentation and eliminate runtime alloc/free bottlenecks. I imagine  
that with a certain programming style it could be made to work, and  
would allow game scripts to control more core functionality than they  
have in the past.


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Ian Thomas
Coming late to this - this is great news. :-)

Ian

On Wed, Oct 29, 2008 at 12:34 AM, James Hofmann <[hidden email]> wrote:
> Quoting "Hugh Sanderson" <[hidden email]>:
>
>> Hi,
>> I have put together an initial version of a c++ backend for haxe.
>> This generates c++ code, that can be compiled to an executable.
>> (Windows only at this stage)  More details at:
>>
>> http://gamehaxe.com/2008/10/28/c-backend-for-haxe/
>>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Gamehaxe
In reply to this post by James W. Hofmann
Hi,
I'm not too sure how this would work in a limited-memory
environment.  I'm about to look at GC so it will use a custom
memory allocator, so presumably this this could be adapted
to a limited memory allocation.
Another idea I had was to automatically create object pools
for each class type. So possibly you could completely re-work
the allocation to work from fixed lists of objects.  I
don't really know too much about this - not my speciality.

I can see the advantages of using somehting like LLVM.
The cpp->obj compile time is orders of magnitude greater
than the hx->cpp phase, so this would be reduced.
But I think this is a related project, and not really covered
by this code.  I may look at restructuring the header files
to make the compile faster.

XAML looks iteresting - related to some other stuff I have
though about before.  My gut feeling is that if I switch
to GC, the code will be quite similar to c#.  This opens
up the whole suite of microsoft CRL (and silverlight).
Again, byte code may be a better option, but then that may
be beyond me. Learning c# is something that's been on my todo
list for a while now, so this may be an interesting project.

The "D" language also looks interesting. But I think one of
my goals was to produce code that can be integrated into
existing code bases in a broad a way as possible.  And that
pretty much requires c or c++.  However, like c#, there may
be a relatively simple way to abstract out some differences
and get a couple of ports for free.  Once C++ is fully
working (!) this could be woth a look.

One big advantage of the c++ code, is that you can step
through you haxe code with one of the best debuggers out there -
visual studio - very useful indeed.

Hugh



>
> This is one I've been waiting for - not for any particular project, but  
> because it's another great advertisement for my favorite language. As  
> the C++ performance gets better, haXe will look more and more appealing  
> for general-purpose computation, and programmers doing those sorts of  
> applications will start contributing. We'll get cool and useful  
> "low-level" type code, something which other dynamic languages don't  
> have because they were too slow for those programmers to bother with  
> previously.
>
> A thought: would this backend work well as scripting for a  
> limited-memory environment like a game console? Typically on those  
> platforms everything is pre-allocated in memory pools to minimize  
> fragmentation and eliminate runtime alloc/free bottlenecks. I imagine  
> that with a certain programming style it could be made to work, and  
> would allow game scripts to control more core functionality than they  
> have in the past.
>
>
> --
> haXe - an open source web programming language
> http://haxe.org



--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Viktor Hesselbom
In reply to this post by Gamehaxe
Hello Hugh,

This sounds like a huge achievement so good work on that.

One thing I don't get though, and I'm probably missing something, is that this generates c++ code that then can get compiled. Then you say that performance is equal to flash output? Surely C++ must be faster than flash? Or are we talking how fast it generates the code?

Viktor

2008/10/28 Hugh Sanderson <[hidden email]>
Hi,
I have put together an initial version of a c++ backend for haxe.
This generates c++ code, that can be compiled to an executable.
(Windows only at this stage)  More details at:

http://gamehaxe.com/2008/10/28/c-backend-for-haxe/

The performance, for certain applications, is about 5 times
faster than neko, and about the same as flash.  I think this
could be improved with garbage collection, rather than
reference counting.

The code is not complete, but I think it is at a point where
some outside comments would be useful.

Hugh

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Gamehaxe
Hi,
No, the flash player of the physaxe example is actually faster.
And string processing is much faster in flash too.
Code like this:

var x:Float = 1.0;
for(i in 0...10000)
    x+=2.0;

Is going to be much faster in c++.  Same with this:

var point = new Point(1,1);
for(i in 0...10000)
    point->x+=2.0;

These example run at full compiled speed, as if they
were written in c++.

However, this code runs much slower:
var point1 = new Point(1,1);
var point2 = new Point(1,1);
for(i in 0...10000)
{
    var point_tmp = point1;
    point1 = point2;
    point2 = point_tmp;
}

This is because each of the object assignments uses reference
counting, which hurts performance.  This is the "fast list"
pattern (traversing a linked list) that is used quite a bit
in physaxe.

I'm hoping a switch to garbage collection will allow this
code to run at full compiled speed.

Another problem with the physaxe code is that it talks to the
graphics system via the neko cffi, which requires variables
to be looked up by name.

Finally, the flash vm is actually quite a tastey bit of work.

This inital release did not concentrate on performance.
I'm hoping to improve things as I go along.

Hugh

> Hello Hugh,
> This sounds like a huge achievement so good work on that.
>
> One thing I don't get though, and I'm probably missing something, is that
> this generates c++ code that then can get compiled. Then you say that
> performance is equal to flash output? Surely C++ must be faster than  
> flash?
> Or are we talking how fast it generates the code?
>
> Viktor
>
> 2008/10/28 Hugh Sanderson <[hidden email]>
>
>> Hi,
>> I have put together an initial version of a c++ backend for haxe.
>> This generates c++ code, that can be compiled to an executable.
>> (Windows only at this stage)  More details at:
>>
>> http://gamehaxe.com/2008/10/28/c-backend-for-haxe/
>>
>> The performance, for certain applications, is about 5 times
>> faster than neko, and about the same as flash.  I think this
>> could be improved with garbage collection, rather than
>> reference counting.
>>
>> The code is not complete, but I think it is at a point where
>> some outside comments would be useful.
>>
>> Hugh
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>



--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Ben Aurel
In reply to this post by Gamehaxe
hi hugh
would it be possible to use the cpp generator like a common haxe
library (haxelib)? Maybe you're familiar with caffeine-hx which is one
of the roots of the php generator. When I asked them how the generator
can be installed they answered the following:

   > Russell Weir  
   > For the most part, caffeine-hx is just a library path to specify on
   > the command line with haxe. So when compiling, add -cp
   >/path/to/caffeine-hx-read-only/ext to the .hxml file or your haxe
   > command line.

Maybe this could be done in hxcpp too?

ben

On Tue, Oct 28, 2008 at 7:03 AM, Hugh Sanderson <[hidden email]> wrote:

> Hi,
> I have put together an initial version of a c++ backend for haxe.
> This generates c++ code, that can be compiled to an executable.
> (Windows only at this stage)  More details at:
>
> http://gamehaxe.com/2008/10/28/c-backend-for-haxe/
>
> The performance, for certain applications, is about 5 times
> faster than neko, and about the same as flash.  I think this
> could be improved with garbage collection, rather than
> reference counting.
>
> The code is not complete, but I think it is at a point where
> some outside comments would be useful.
>
> Hugh
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Lee Sylvester
hxcpp isn't a library, but a part of the compile. Much like you'd use
-neko or -swf in your hxml files, so you'd use hxcpp in the same way.
It's not like including code from a framework.

Lee



Ben Aurel wrote:

> hi hugh
> would it be possible to use the cpp generator like a common haxe
> library (haxelib)? Maybe you're familiar with caffeine-hx which is one
> of the roots of the php generator. When I asked them how the generator
> can be installed they answered the following:
>
>    > Russell Weir  
>    > For the most part, caffeine-hx is just a library path to specify on
>    > the command line with haxe. So when compiling, add -cp
>    >/path/to/caffeine-hx-read-only/ext to the .hxml file or your haxe
>    > command line.
>
> Maybe this could be done in hxcpp too?
>
> ben
>
> On Tue, Oct 28, 2008 at 7:03 AM, Hugh Sanderson <[hidden email]> wrote:
>  
>> Hi,
>> I have put together an initial version of a c++ backend for haxe.
>> This generates c++ code, that can be compiled to an executable.
>> (Windows only at this stage)  More details at:
>>
>> http://gamehaxe.com/2008/10/28/c-backend-for-haxe/
>>
>> The performance, for certain applications, is about 5 times
>> faster than neko, and about the same as flash.  I think this
>> could be improved with garbage collection, rather than
>> reference counting.
>>
>> The code is not complete, but I think it is at a point where
>> some outside comments would be useful.
>>
>> Hugh
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>>    
>
>  


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Ben Aurel
but wouldn't it be nice to have some sort of 'plugable' compiler
backends? I don't know the haxe compiler works in detail but I think
you had to dynamically load such a compiler backend. From what I know
its possible to load native libraries with the latest OCaml release.
Otherwise you have to have different versions of the haxe compiler,
not a big problem, but not a really good solution either.

just some loud thinking ....

On Wed, Oct 29, 2008 at 9:23 AM, Lee McColl Sylvester
<[hidden email]> wrote:

> hxcpp isn't a library, but a part of the compile. Much like you'd use -neko
> or -swf in your hxml files, so you'd use hxcpp in the same way. It's not
> like including code from a framework.
>
> Lee
>
>
>
> Ben Aurel wrote:
>>
>> hi hugh
>> would it be possible to use the cpp generator like a common haxe
>> library (haxelib)? Maybe you're familiar with caffeine-hx which is one
>> of the roots of the php generator. When I asked them how the generator
>> can be installed they answered the following:
>>
>>   > Russell Weir
>>   > For the most part, caffeine-hx is just a library path to specify on
>>   > the command line with haxe. So when compiling, add -cp
>>   >/path/to/caffeine-hx-read-only/ext to the .hxml file or your haxe
>>   > command line.
>>
>> Maybe this could be done in hxcpp too?
>>
>> ben
>>
>> On Tue, Oct 28, 2008 at 7:03 AM, Hugh Sanderson <[hidden email]>
>> wrote:
>>
>>>
>>> Hi,
>>> I have put together an initial version of a c++ backend for haxe.
>>> This generates c++ code, that can be compiled to an executable.
>>> (Windows only at this stage)  More details at:
>>>
>>> http://gamehaxe.com/2008/10/28/c-backend-for-haxe/
>>>
>>> The performance, for certain applications, is about 5 times
>>> faster than neko, and about the same as flash.  I think this
>>> could be improved with garbage collection, rather than
>>> reference counting.
>>>
>>> The code is not complete, but I think it is at a point where
>>> some outside comments would be useful.
>>>
>>> Hugh
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
>>>
>>
>>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Lee Sylvester
I hear you. Yes, that would be good. That way, people could opt to use
the compiler backends they wanted to include in their haXe install.
Essentially, it would always support Flash, Neko and JS, but you could
extend it at will... That's a nice thought. I'm sure Nicolas would have
something to say on the issue.

Lee



Ben Aurel wrote:

> but wouldn't it be nice to have some sort of 'plugable' compiler
> backends? I don't know the haxe compiler works in detail but I think
> you had to dynamically load such a compiler backend. From what I know
> its possible to load native libraries with the latest OCaml release.
> Otherwise you have to have different versions of the haxe compiler,
> not a big problem, but not a really good solution either.
>
> just some loud thinking ....
>
> On Wed, Oct 29, 2008 at 9:23 AM, Lee McColl Sylvester
> <[hidden email]> wrote:
>  
>> hxcpp isn't a library, but a part of the compile. Much like you'd use -neko
>> or -swf in your hxml files, so you'd use hxcpp in the same way. It's not
>> like including code from a framework.
>>
>> Lee
>>
>>
>>
>> Ben Aurel wrote:
>>    
>>> hi hugh
>>> would it be possible to use the cpp generator like a common haxe
>>> library (haxelib)? Maybe you're familiar with caffeine-hx which is one
>>> of the roots of the php generator. When I asked them how the generator
>>> can be installed they answered the following:
>>>
>>>   > Russell Weir
>>>   > For the most part, caffeine-hx is just a library path to specify on
>>>   > the command line with haxe. So when compiling, add -cp
>>>   >/path/to/caffeine-hx-read-only/ext to the .hxml file or your haxe
>>>   > command line.
>>>
>>> Maybe this could be done in hxcpp too?
>>>
>>> ben
>>>
>>> On Tue, Oct 28, 2008 at 7:03 AM, Hugh Sanderson <[hidden email]>
>>> wrote:
>>>
>>>      
>>>> Hi,
>>>> I have put together an initial version of a c++ backend for haxe.
>>>> This generates c++ code, that can be compiled to an executable.
>>>> (Windows only at this stage)  More details at:
>>>>
>>>> http://gamehaxe.com/2008/10/28/c-backend-for-haxe/
>>>>
>>>> The performance, for certain applications, is about 5 times
>>>> faster than neko, and about the same as flash.  I think this
>>>> could be improved with garbage collection, rather than
>>>> reference counting.
>>>>
>>>> The code is not complete, but I think it is at a point where
>>>> some outside comments would be useful.
>>>>
>>>> Hugh
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>>
>>>>
>>>>        
>>>      
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>>    
>
>  


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Nicolas Cannasse
Lee McColl Sylvester a écrit :
> I hear you. Yes, that would be good. That way, people could opt to use
> the compiler backends they wanted to include in their haXe install.
> Essentially, it would always support Flash, Neko and JS, but you could
> extend it at will... That's a nice thought. I'm sure Nicolas would have
> something to say on the issue.

Dynamic loading in OCaml is pretty restrictive, so that would be very
hard, and I don't have much time to invest into having the compiler
accept "plugins" anyway.

The good solution is what Hugh did : provide the sources, so everybody
can compile it the way he want. A patch would be nice as well,
especially for the changes in /std library.

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Gamehaxe
In reply to this post by Ben Aurel
Hi ben,

There are a couple of bit that need to be "found" when using hcxpp.
First, the include files. You need to specify these to the compile
using the "-I" flag.  If hxcpp were a standard part of haxe, this
would be somewhere under "$HAXEPATH", which is an environment variable
that already exists. So you would not need an additional one.
Neko also has one of these,  $NEKO_INSTPATH/, so you can find
it's include directories.  The library is very simlar - you need to
specify a library path to find the "hxcpp.lib".

The next problem is to find the "hxcpp.dll".  On windows, this follows
standard procedures - looking next to the exe, and in the exe path.
On Unicies, it looks through LD_LIBRARY_PATH.  So there are a few
options - modify the path (either in a startup-script, or more globally)
copy the dll next to the exe, or copy the dll to somewhere already in
your path (ie, install it).  It may also be possible to statically
link this library in, solving a few of these problems, but it may
make loading plugins a bit more difficult.  Untimately, this may
be a good solution.

Finally, it has to find the plugins (nme.dll in the example case, but
also standard things such as mysql & regex).  There is more scope here
to use the same mechanisms as haxelib - ie, consult the haxelib database,
because these additonal bit are optional, and may or may not be installed.

If cpp finds it way into the haxe disto, then the dll could live next
to haxe.exe, so it would be in your path.  The makefiles could use
$HAXEPATH/hxcpp and the plugins could be located via haxelib.

While it is not in the standard distro, an installer could make
some of this easier - perhaps even changing the name of the exe
and using its own rules for finding the std packages, allowing
for side-by-side installation with a minimum of fuss.

So I think the current setup requirements will be simplified soon.

Hugh


> hi hugh
> would it be possible to use the cpp generator like a common haxe
> library (haxelib)? Maybe you're familiar with caffeine-hx which is one
> of the roots of the php generator. When I asked them how the generator
> can be installed they answered the following:

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Announcing c++ backend - alpha version

Gamehaxe
In reply to this post by Ben Aurel
Hi,
There are a significant number of files that need to be updated
for a particular backend.  While most of the compiler code can be
be restricted to a single "ml" file, there are other hooks that
need to be added to the other ml files.  While these are not
huge in number, it would still required some kind of offical support.
But the biggest number of file changes occur in the the standard
library files.
To make a stand-alone plugin system, the best option may be a
complete dump of the AST - like the xml code.  Then maybe
have some standard mechanism to invove a particular command line
on this generated file, and also a way of specifying to
get standard packages files from elsewhere too.
Obviously Nicolas is the persone who ultimately knows what is best.

Hugh

> but wouldn't it be nice to have some sort of 'plugable' compiler
> backends? I don't know the haxe compiler works in detail but I think
> you had to dynamically load such a compiler backend. From what I know
> its possible to load native libraries with the latest OCaml release.
> Otherwise you have to have different versions of the haxe compiler,
> not a big problem, but not a really good solution either.
>
> just some loud thinking ....

--
haXe - an open source web programming language
http://haxe.org