Ruby in haXe

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

Ruby in haXe

Marcelo de Moraes Serpa
Guys,

Sorry if it seems I'm flooding this mailing list. It's just that I'm so excited with haXe that I'm in constant brainstorm-like state, given that the potential of it is so great.

I like the haXe language. It's great for big structured projects such as complex games and applications. It might even suit some web apps, but IMHO, nothing can beat Ruby when it comes to web. Also, Ruby is such a sweet and simple language that it's impossible not to like it, really. Unless you don't keep your mind open for new things.

I've been thinking about something. We all talk about new targets, and that's nice. But why not detach the haXe compiler from the haXe language itself? I know it might be hard to do right now, but it'd be nice if we could "plug" new language dialects for the compiler in the same way targets are written and "plugged".

Take JRuby, a Ruby implementation that is 100% compatible language-wise with Ruby and runs almost all the gems as well. Of course, I'm not asking we do such thing, only supporting a Ruby dialect, akin to what MacRuby does, would suffice. We wouldn't need to support gems in the haXe side (or if really needed we could as well) but the point is to support a Ruby-compatible language that can be used to program and compile to any of the targets (which could be Ruby as well :)).

The language could suffer some adjustments to make it compatible and easier to support the current targets. It'd be nice (but not encouraged) if we could mix and match "hxRuby" and haXe in the same project, for example.

This would also have the potential to bring lot more people to the community, since Ruby has a huge community and is a widespread language.

I'd be willing to start playing with it, but let me know what you think first.

Cheers,

Marcelo.



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

Re: Ruby in haXe

Raoul Duke
On Tue, Jul 26, 2011 at 11:16 AM, Marcelo de Moraes Serpa
<[hidden email]> > I like the haXe language. It's great for big
structured projects such as
> complex games and applications. It might even suit some web apps, but IMHO,
> nothing can beat Ruby when it comes to web. Also, Ruby is such a sweet and
> simple language that it's impossible not to like it, really. Unless you
> don't keep your mind open for new things.

uh huh, yeah, when somebody says you have to have an open mind because
i like it, that sounds like a closed mind. well, you can go implement
it, since that is your opinion :-). personally i don't have a love of
Ruby like that, and keeping my mind open to new things includes maybe
not forcing everything to look like ruby all the time...

$0.02 from a curmudgeon. :-)

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

RE: Ruby in haXe

Lee Sylvester
In reply to this post by Marcelo de Moraes Serpa

There’s nothing to stop you doing this :-)  Just pick up the source, learn some OCaml and get coding ;-)  I’ve considered the idea myself once or twice, but I love the haXe language too much to be unfaithful.

 

Lee

 

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Marcelo de Moraes Serpa
Sent: 26 July 2011 19:17
To: The haXe compiler list
Subject: [haXe] Ruby in haXe

 

Guys,

 

Sorry if it seems I'm flooding this mailing list. It's just that I'm so excited with haXe that I'm in constant brainstorm-like state, given that the potential of it is so great.

 

I like the haXe language. It's great for big structured projects such as complex games and applications. It might even suit some web apps, but IMHO, nothing can beat Ruby when it comes to web. Also, Ruby is such a sweet and simple language that it's impossible not to like it, really. Unless you don't keep your mind open for new things.

 

I've been thinking about something. We all talk about new targets, and that's nice. But why not detach the haXe compiler from the haXe language itself? I know it might be hard to do right now, but it'd be nice if we could "plug" new language dialects for the compiler in the same way targets are written and "plugged".

 

Take JRuby, a Ruby implementation that is 100% compatible language-wise with Ruby and runs almost all the gems as well. Of course, I'm not asking we do such thing, only supporting a Ruby dialect, akin to what MacRuby does, would suffice. We wouldn't need to support gems in the haXe side (or if really needed we could as well) but the point is to support a Ruby-compatible language that can be used to program and compile to any of the targets (which could be Ruby as well :)).

 

The language could suffer some adjustments to make it compatible and easier to support the current targets. It'd be nice (but not encouraged) if we could mix and match "hxRuby" and haXe in the same project, for example.

 

This would also have the potential to bring lot more people to the community, since Ruby has a huge community and is a widespread language.

 

I'd be willing to start playing with it, but let me know what you think first.

 

Cheers,

 

Marcelo.

 

 


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

Re: Ruby in haXe

Marcelo de Moraes Serpa
In reply to this post by Raoul Duke
uh huh, yeah, when somebody says you have to have an open mind because
i like it, that sounds like a closed mind. well, you can go implement
it, since that is your opinion :-). personally i don't have a love of
Ruby like that, and keeping my mind open to new things includes maybe
not forcing everything to look like ruby all the time...

Right, and that's your opinion. I can stay the whole day explaining why Ruby is nice and all, but I bet you haven't tried it. I haven't said the haXe language is not nice, I really like it. Anyway, Regardless of Ruby, it'd be nice to have haXe support other input languages. I don't want to start a flame war though.

M>

On Tue, Jul 26, 2011 at 1:32 PM, Raoul Duke <[hidden email]> wrote:
On Tue, Jul 26, 2011 at 11:16 AM, Marcelo de Moraes Serpa
<[hidden email]> > I like the haXe language. It's great for big
structured projects such as
> complex games and applications. It might even suit some web apps, but IMHO,
> nothing can beat Ruby when it comes to web. Also, Ruby is such a sweet and
> simple language that it's impossible not to like it, really. Unless you
> don't keep your mind open for new things.

uh huh, yeah, when somebody says you have to have an open mind because
i like it, that sounds like a closed mind. well, you can go implement
it, since that is your opinion :-). personally i don't have a love of
Ruby like that, and keeping my mind open to new things includes maybe
not forcing everything to look like ruby all the time...

$0.02 from a curmudgeon. :-)

--
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: Ruby in haXe

Franco Ponticelli
In reply to this post by Lee Sylvester
On the same line I'd prefer improvements on the current syntax that having the option to choose a different one. 

Franco

On Tue, Jul 26, 2011 at 12:36 PM, Lee Sylvester <[hidden email]> wrote:

There’s nothing to stop you doing this :-)  Just pick up the source, learn some OCaml and get coding ;-)  I’ve considered the idea myself once or twice, but I love the haXe language too much to be unfaithful.

 

Lee

 

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Marcelo de Moraes Serpa
Sent: 26 July 2011 19:17
To: The haXe compiler list
Subject: [haXe] Ruby in haXe

 

Guys,

 

Sorry if it seems I'm flooding this mailing list. It's just that I'm so excited with haXe that I'm in constant brainstorm-like state, given that the potential of it is so great.

 

I like the haXe language. It's great for big structured projects such as complex games and applications. It might even suit some web apps, but IMHO, nothing can beat Ruby when it comes to web. Also, Ruby is such a sweet and simple language that it's impossible not to like it, really. Unless you don't keep your mind open for new things.

 

I've been thinking about something. We all talk about new targets, and that's nice. But why not detach the haXe compiler from the haXe language itself? I know it might be hard to do right now, but it'd be nice if we could "plug" new language dialects for the compiler in the same way targets are written and "plugged".

 

Take JRuby, a Ruby implementation that is 100% compatible language-wise with Ruby and runs almost all the gems as well. Of course, I'm not asking we do such thing, only supporting a Ruby dialect, akin to what MacRuby does, would suffice. We wouldn't need to support gems in the haXe side (or if really needed we could as well) but the point is to support a Ruby-compatible language that can be used to program and compile to any of the targets (which could be Ruby as well :)).

 

The language could suffer some adjustments to make it compatible and easier to support the current targets. It'd be nice (but not encouraged) if we could mix and match "hxRuby" and haXe in the same project, for example.

 

This would also have the potential to bring lot more people to the community, since Ruby has a huge community and is a widespread language.

 

I'd be willing to start playing with it, but let me know what you think first.

 

Cheers,

 

Marcelo.

 

 


--
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: Ruby in haXe

MarcWeber
In reply to this post by Marcelo de Moraes Serpa
Excerpts from Marcelo de Moraes Serpa's message of Tue Jul 26 20:16:57 +0200 2011:
> I like the haXe language. It's great for big structured projects such as
> complex games and applications. It might even suit some web apps, but IMHO,
> nothing can beat Ruby when it comes to web. Also, Ruby is such a sweet and
> simple language that it's impossible not to like it, really. Unless you
> don't keep your mind open for new things.

goto http://www.informatik.uni-freiburg.de/~thiemann/WASH/
and http://impredicative.com/ur

Or have a look at Haskell's QuickCheck. Then you'll open your eyes and
say "Hey, my lovely language will never be able to do this"..
(it'll take you a couple of hours to understand what they are about -
cause you're used to ruby only.. Don't worry. Give it a try. You'll like
those ideas as well ..)

I agree that you still can get almost all jobs done in Ruby.

Marc Weber

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

Re: Ruby in haXe

Justin Donaldson-3
In reply to this post by Marcelo de Moraes Serpa
If you like scripting-like languages, try hscript:
http://code.google.com/p/hscript/

Otherwise, glad you're excited.  I wouldn't want to adjust the language to make it ruby-like, but I know that this is about as likely as making the ruby language more haxe-like. 

Haxe is geared for optimization and interoperability.  Ruby is about expressivity and the ability to quickly mock up simple functionality.  To that end, I think translating haxe to ruby would be inefficient , and translating ruby to haxe would get in the way of mocking things up quickly. :)

As far as library interoperability goes, which gems are your favorite?

-Justin


On Tue, Jul 26, 2011 at 11:16 AM, Marcelo de Moraes Serpa <[hidden email]> wrote:
Guys,

Sorry if it seems I'm flooding this mailing list. It's just that I'm so excited with haXe that I'm in constant brainstorm-like state, given that the potential of it is so great.

I like the haXe language. It's great for big structured projects such as complex games and applications. It might even suit some web apps, but IMHO, nothing can beat Ruby when it comes to web. Also, Ruby is such a sweet and simple language that it's impossible not to like it, really. Unless you don't keep your mind open for new things.

I've been thinking about something. We all talk about new targets, and that's nice. But why not detach the haXe compiler from the haXe language itself? I know it might be hard to do right now, but it'd be nice if we could "plug" new language dialects for the compiler in the same way targets are written and "plugged".

Take JRuby, a Ruby implementation that is 100% compatible language-wise with Ruby and runs almost all the gems as well. Of course, I'm not asking we do such thing, only supporting a Ruby dialect, akin to what MacRuby does, would suffice. We wouldn't need to support gems in the haXe side (or if really needed we could as well) but the point is to support a Ruby-compatible language that can be used to program and compile to any of the targets (which could be Ruby as well :)).

The language could suffer some adjustments to make it compatible and easier to support the current targets. It'd be nice (but not encouraged) if we could mix and match "hxRuby" and haXe in the same project, for example.

This would also have the potential to bring lot more people to the community, since Ruby has a huge community and is a widespread language.

I'd be willing to start playing with it, but let me know what you think first.

Cheers,

Marcelo.



--
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: Ruby in haXe

Marcelo de Moraes Serpa
In reply to this post by MarcWeber
Well, maybe I'm comparing apples with oranges. I used to program in C# and Java, as AS2 in the past, so Ruby is not my only background.

Anyway, it was just an idea. I'm not saying haXe has a bad language. I'm just saying it *could* be nice to have a way to program in another language, it's just an idea.

On Tue, Jul 26, 2011 at 1:42 PM, Marc Weber <[hidden email]> wrote:
Excerpts from Marcelo de Moraes Serpa's message of Tue Jul 26 20:16:57 +0200 2011:
> I like the haXe language. It's great for big structured projects such as
> complex games and applications. It might even suit some web apps, but IMHO,
> nothing can beat Ruby when it comes to web. Also, Ruby is such a sweet and
> simple language that it's impossible not to like it, really. Unless you
> don't keep your mind open for new things.

goto http://www.informatik.uni-freiburg.de/~thiemann/WASH/
and http://impredicative.com/ur

Or have a look at Haskell's QuickCheck. Then you'll open your eyes and
say "Hey, my lovely language will never be able to do this"..
(it'll take you a couple of hours to understand what they are about -
cause you're used to ruby only.. Don't worry. Give it a try. You'll like
those ideas as well ..)

I agree that you still can get almost all jobs done in Ruby.

Marc Weber

--
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: Ruby in haXe

Franco Ponticelli
Don't get frustrated by our "possessive" answers ... if you feel it is the right thing to do just try it, I am pretty sure many ruby developers may thank you.
When I started haxe/php I did it because it was in my reach and a good way to learn new stuff; I never thought it could be fully functional or even adopted, but I was wrong ;)

Franco

On Tue, Jul 26, 2011 at 12:46 PM, Marcelo de Moraes Serpa <[hidden email]> wrote:
Well, maybe I'm comparing apples with oranges. I used to program in C# and Java, as AS2 in the past, so Ruby is not my only background.

Anyway, it was just an idea. I'm not saying haXe has a bad language. I'm just saying it *could* be nice to have a way to program in another language, it's just an idea.


On Tue, Jul 26, 2011 at 1:42 PM, Marc Weber <[hidden email]> wrote:
Excerpts from Marcelo de Moraes Serpa's message of Tue Jul 26 20:16:57 +0200 2011:
> I like the haXe language. It's great for big structured projects such as
> complex games and applications. It might even suit some web apps, but IMHO,
> nothing can beat Ruby when it comes to web. Also, Ruby is such a sweet and
> simple language that it's impossible not to like it, really. Unless you
> don't keep your mind open for new things.

goto http://www.informatik.uni-freiburg.de/~thiemann/WASH/
and http://impredicative.com/ur

Or have a look at Haskell's QuickCheck. Then you'll open your eyes and
say "Hey, my lovely language will never be able to do this"..
(it'll take you a couple of hours to understand what they are about -
cause you're used to ruby only.. Don't worry. Give it a try. You'll like
those ideas as well ..)

I agree that you still can get almost all jobs done in Ruby.

Marc Weber

--
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: Ruby in haXe

MarcWeber
In reply to this post by Justin Donaldson-3
Its time to clarify what I meant by "ruby like".
I meant such lambdas such as {|x| ..}

I meant def instead of function (less typing and reading)

I also dislike static public function (little bit too long for my taste)
Of course rubys $foo (global) @ and @@ stuff is kind of cryptic (like
perl) - I agree.

And I'm talking about error handling:

def foo

except
..
finally
..
end

That's what I like.

I'm not Ruby programmer

Marc Weber

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

Re: Ruby in haXe

Chris Ochs
In reply to this post by Marcelo de Moraes Serpa
On Tue, Jul 26, 2011 at 11:16 AM, Marcelo de Moraes Serpa
<[hidden email]> wrote:

> Guys,
> Sorry if it seems I'm flooding this mailing list. It's just that I'm so
> excited with haXe that I'm in constant brainstorm-like state, given that the
> potential of it is so great.
> I like the haXe language. It's great for big structured projects such as
> complex games and applications. It might even suit some web apps, but IMHO,
> nothing can beat Ruby when it comes to web. Also, Ruby is such a sweet and
> simple language that it's impossible not to like it, really. Unless you
> don't keep your mind open for new things.
> I've been thinking about something. We all talk about new targets, and
> that's nice. But why not detach the haXe compiler from the haXe language
> itself? I know it might be hard to do right now, but it'd be nice if we
> could "plug" new language dialects for the compiler in the same way targets
> are written and "plugged".

The base language is Haxe, which is in turn compiled into other
targets.  I'd think having multiple base languages would be non
trivial.  One approach I've played around with is compiling other
languages to haxe.  I'm working on an actionscript to haxe compiler
that makes use of the adobe compiler to generate the AST.

Ruby as a haxe target, I'm not sure of the benefits.  Ruby and Jruby
both have a great foreign function interface for C/C++, and when the
java target comes out you can leverage that with Jruby if you want to.

As for Ruby as a source language, that's a huge task.  Ruby is non
trivial to compile to other languages.

At the same time, I dont' think haxe is a good choice for purely
server side projects either,  other languages are much better suited
to that task.

Chris

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

Re: Ruby in haXe

Baluta Cristian
In reply to this post by Marcelo de Moraes Serpa
I find this idea interesting but haxe is about the reverse.
I like xcode though, you can mix c#, c++, objective-c together. Not that you usually want to do that, but you can use libs made for other languages.


On Tue, Jul 26, 2011 at 9:46 PM, Marcelo de Moraes Serpa <[hidden email]> wrote:
Well, maybe I'm comparing apples with oranges. I used to program in C# and Java, as AS2 in the past, so Ruby is not my only background.

Anyway, it was just an idea. I'm not saying haXe has a bad language. I'm just saying it *could* be nice to have a way to program in another language, it's just an idea.


On Tue, Jul 26, 2011 at 1:42 PM, Marc Weber <[hidden email]> wrote:
Excerpts from Marcelo de Moraes Serpa's message of Tue Jul 26 20:16:57 +0200 2011:
> I like the haXe language. It's great for big structured projects such as
> complex games and applications. It might even suit some web apps, but IMHO,
> nothing can beat Ruby when it comes to web. Also, Ruby is such a sweet and
> simple language that it's impossible not to like it, really. Unless you
> don't keep your mind open for new things.

goto http://www.informatik.uni-freiburg.de/~thiemann/WASH/
and http://impredicative.com/ur

Or have a look at Haskell's QuickCheck. Then you'll open your eyes and
say "Hey, my lovely language will never be able to do this"..
(it'll take you a couple of hours to understand what they are about -
cause you're used to ruby only.. Don't worry. Give it a try. You'll like
those ideas as well ..)

I agree that you still can get almost all jobs done in Ruby.

Marc Weber

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


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



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

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

Re: Ruby in haXe

MarcWeber
In reply to this post by Marcelo de Moraes Serpa
Excerpts from Marcelo de Moraes Serpa's message of Tue Jul 26 20:46:08 +0200 2011:
> Anyway, it was just an idea. I'm not saying haXe has a bad language. I'm
> just saying it *could* be nice to have a way to program in another language,
> it's just an idea.
I didn't say you were saying that .. (let's stop that).
I had the impression that you're very new to HaXe and that you try to
apply what you've learned while using C#,as2,.. to HaXe (eg that
compilers are slow and that interpreters are the solution ..).
Because I had that impression I tried telling you: Stop dreaming. Have
fun exploring the language by writing some real code. Eventually the
compiler speed will turn out to be no bottle neck in your workflow.

If you're a Vim user I'll be happy to show you how to set up the dev
environment :) ... contact me on freenode or by mail in that case.

You're welcome.

Marc Weber

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

Re: Ruby in haXe

Johann Borck
In reply to this post by Marcelo de Moraes Serpa
On 07/26/2011 08:16 PM, Marcelo de Moraes Serpa wrote:
> [...] but the point is to support a Ruby-compatible language that can be used to program and
> compile to any of the targets (which could be Ruby as well :)).
>
> [...]
Hi Marcelo,
this is just my opinion, but it makes absolutely no sense to remove the most important part of haXe
(its type system) in favor of "nicer syntax" for those who actually think that Ruby has nicer
syntax. The power that the type-checker gives you to write correct code would be lost. You can look
at similar efforts (like translating python to C++, starkiller is the name of that project IIRC, or
RPython in pypy ) and see how it works out. The result is always the same, either you end up having
"Dynamic" all over the place (so no point in the whole effort), or you can support only a subset of
the dynamic language.

IMO Haxe is about the opposite of that - writing correct code and translating to correct code, even
if the target platform is something like PHP (modulo bug-corroded runtimes, of course). What you
want is extremely complicated and (IMO, again) doesn't add any value to haXe whatsoever.

regards,
Johann

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

Re: Ruby in haXe

Marcelo de Moraes Serpa
OK, I think you're right. Anyway, could maybe be a nice project to start for learning purposes to see where it could go.

Now, I see I need to spend more time on haXe, and that's a fact. I'll start some experiments.

Yeah, I use Vim, I've found some plugins through haxe.org, I'll use them :)

Cheers.

On Tue, Jul 26, 2011 at 2:03 PM, Johann Borck <[hidden email]> wrote:
On 07/26/2011 08:16 PM, Marcelo de Moraes Serpa wrote:
[...] but the point is to support a Ruby-compatible language that can be used to program and compile to any of the targets (which could be Ruby as well :)).

[...]
Hi Marcelo,
this is just my opinion, but it makes absolutely no sense to remove the most important part of haXe (its type system) in favor of "nicer syntax" for those who actually think that Ruby has nicer syntax. The power that the type-checker gives you to write correct code would be lost. You can look at similar efforts (like translating python to C++, starkiller is the name of that project IIRC, or RPython in pypy ) and see how it works out. The result is always the same, either you end up having "Dynamic" all over the place (so no point in the whole effort), or you can support only a subset of the dynamic language.

IMO Haxe is about the opposite of that - writing correct code and translating to correct code, even if the target platform is something like PHP (modulo bug-corroded runtimes, of course). What you want is extremely complicated and (IMO, again) doesn't add any value to haXe whatsoever.

regards,
Johann


--
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: Ruby in haXe

Nicolas Cannasse
In reply to this post by Chris Ochs
Le 26/07/2011 20:53, Chris Ochs a écrit :
> The base language is Haxe, which is in turn compiled into other
> targets.  I'd think having multiple base languages would be non
> trivial.  One approach I've played around with is compiling other
> languages to haxe.  I'm working on an actionscript to haxe compiler
> that makes use of the adobe compiler to generate the AST.

Hey Chris,

We have done some work for AS3-to-HX conversion already : I wrote an AS3
source parser (in haxe) and Franco worked on outputting the
corresponding haXe code. Not sure if/how it works well right now, but
you might want to contribute by writing haXe code instead of hacking a
Java (sic) compiler ;)

Get the sources here :
http://code.google.com/p/haxe/source/browse/#svn%2Fother%2Fas3hx

Nicolas

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

Re: Ruby in haXe

Raoul Duke
>  One approach I've played around with is compiling other
> languages to haxe.


for the *truly* adventurous, please check
http://www.lambdassociates.org/Shen/newappeal.htm

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

Re: Ruby in haXe

davidedc
In reply to this post by Nicolas Cannasse
Hi Marcelo,

Me too, I'm quite excited about haxe (and some related libraries e.g. Nekonme) as a "vector" language, I don't think there is anything wrong with that. You are not alone :-)

Just get coding and show somethig cool to the list, everything is possible!

Davide

On 26 Jul 2011, at 20:23, Nicolas Cannasse <[hidden email]> wrote:

> Le 26/07/2011 20:53, Chris Ochs a écrit :
>> The base language is Haxe, which is in turn compiled into other
>> targets.  I'd think having multiple base languages would be non
>> trivial.  One approach I've played around with is compiling other
>> languages to haxe.  I'm working on an actionscript to haxe compiler
>> that makes use of the adobe compiler to generate the AST.
>
> Hey Chris,
>
> We have done some work for AS3-to-HX conversion already : I wrote an AS3 source parser (in haxe) and Franco worked on outputting the corresponding haXe code. Not sure if/how it works well right now, but you might want to contribute by writing haXe code instead of hacking a Java (sic) compiler ;)
>
> Get the sources here :
> http://code.google.com/p/haxe/source/browse/#svn%2Fother%2Fas3hx
>
> 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: Ruby in haXe

Chris Ochs
In reply to this post by Nicolas Cannasse
On Tue, Jul 26, 2011 at 12:23 PM, Nicolas Cannasse
<[hidden email]> wrote:

>
> We have done some work for AS3-to-HX conversion already : I wrote an AS3
> source parser (in haxe) and Franco worked on outputting the corresponding
> haXe code. Not sure if/how it works well right now, but you might want to
> contribute by writing haXe code instead of hacking a Java (sic) compiler ;)

I'm going to go back and give this another shot I think.  Originally I
tried it and there were a few things it didn't support.  I wrote a
fairly complete parser using a PEG parser in ruby, mostly because I
wanted to play around with the parser itself.  A full parser is really
overkill though.  I'm running into that same situation with the Adobe
compiler.  You really don't need a complete AST to translate AS3 to
Haxe.

Chris

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

Re: Ruby in haXe

laurence taylor
I've been experimenting recently with OMeta, which is a PEG + arbitrary data types + left recursive pack-rat parsing. I have a feeling you can get away with fairly incomplete grammars, depending on what you are doing, for example, the C# port simply uses a C# recogniser when executing the parasitic portion of the bootstrap, i.e, where the rules are translated into native code.

I can't say for certain when this will get finished, but there is a node repository of the reference implementation, and at simplest, using externs:

var grammar
"ometa Fib {
fib 0  -> 1,
fib 1  -> 1,
fib :n = fib(n - 1):x fib(n - 2):y -> (x + y)
}
";
var tree = BSOMetaJSParser.matchAll(grammar, 'topLevel', [] , failHandler );
var parser = BSOMetaJSTranslator.match(tree, "trans", [], failHandler);
var implementation = untyped(eval(parser));

implementation.memoizeParameterizedRules();
trace( implementation.match(9, "fib") );

On Thu, Jul 28, 2011 at 10:06 PM, Chris Ochs <[hidden email]> wrote:
On Tue, Jul 26, 2011 at 12:23 PM, Nicolas Cannasse
<[hidden email]> wrote:

>
> We have done some work for AS3-to-HX conversion already : I wrote an AS3
> source parser (in haxe) and Franco worked on outputting the corresponding
> haXe code. Not sure if/how it works well right now, but you might want to
> contribute by writing haXe code instead of hacking a Java (sic) compiler ;)

I'm going to go back and give this another shot I think.  Originally I
tried it and there were a few things it didn't support.  I wrote a
fairly complete parser using a PEG parser in ruby, mostly because I
wanted to play around with the parser itself.  A full parser is really
overkill though.  I'm running into that same situation with the Adobe
compiler.  You really don't need a complete AST to translate AS3 to
Haxe.

Chris

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


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