hxRhino preview (Haxe on JVM)

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

hxRhino preview (Haxe on JVM)

ben kuin
hi

why?
------
Because I wanted to learn more about Haxes backends
Haxe for JVM

what?
--------
It's a simple patch to the existing haxe tree
It is a complete separate project though
So it won't mess with your haxe installation

how?
-------
in order to install hxrhino, on the command line:
   wget http://lekin.org/files/dump/2010/hxrhino/hxrhinoinst.sh
   chmod 0755 hxrhinoinst.sh
   ./hxrhinoinst.sh

this will install:
   /usr/local/hxrhino/
   the command 'hxrhino'

example?
--------------
get examples:
   wget http://lekin.org/files/dump/2010/hxrhino/examples.tar.gz
   tar xfvz examples.tar.gz
   cd examples

compile with hxrhino:
   hxrhino compile.hxml

compile to java class
   export RHINO_HOME=~/usr/local/rhino
   java -cp $RHINO_HOME org.mozilla.javascript.tools.jsc.Main test.js

run it:
   java -cp $RHINO_HOME test

Test.hx:3: Hello World !


regards
ben

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

Re: hxRhino preview (Haxe on JVM)

Du Song
Awesome! 
Will definitely try it!
Can't wait to see haXe goes to Java and Android!

Regards,
Du Song


On Fri, May 21, 2010 at 08:24, ben kuin <[hidden email]> wrote:
Because I wanted to learn more about Haxes backends


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

Re: hxRhino preview (Haxe on JVM)

clemos
In reply to this post by ben kuin
Didn't give it a try yet, but looks great :)

Last year I started such experiments with JS/Rhino/Java.
My goal was to allow writing Red5 apps in haXe.
I managed to get a few simple examples to work, but globally it was a
bit of a mess and I left this project.
As soon as I have some time I should at least put these experiments somewhere:
there was basically a little script that converts Java/javadoc xml
class definitions to haXe externs, and a custom Red5 Adapter class.

++++++
Clément

On Fri, May 21, 2010 at 2:24 AM, ben kuin <[hidden email]> wrote:

> hi
>
> why?
> ------
> Because I wanted to learn more about Haxes backends
> Haxe for JVM
>
> what?
> --------
> It's a simple patch to the existing haxe tree
> It is a complete separate project though
> So it won't mess with your haxe installation
>
> how?
> -------
> in order to install hxrhino, on the command line:
>   wget http://lekin.org/files/dump/2010/hxrhino/hxrhinoinst.sh
>   chmod 0755 hxrhinoinst.sh
>   ./hxrhinoinst.sh
>
> this will install:
>   /usr/local/hxrhino/
>   the command 'hxrhino'
>
> example?
> --------------
> get examples:
>   wget http://lekin.org/files/dump/2010/hxrhino/examples.tar.gz
>   tar xfvz examples.tar.gz
>   cd examples
>
> compile with hxrhino:
>   hxrhino compile.hxml
>
> compile to java class
>   export RHINO_HOME=~/usr/local/rhino
>   java -cp $RHINO_HOME org.mozilla.javascript.tools.jsc.Main test.js
>
> run it:
>   java -cp $RHINO_HOME test
>
> Test.hx:3: Hello World !
>
>
> regards
> ben
>
> --
> 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: hxRhino preview (Haxe on JVM)

ben kuin
In reply to this post by ben kuin
just for fun, Swing with Haxe :-)


import packages.javax.swing.JFrame;
class Swingtest {
   static function main() {
   var frame = new JFrame("Hello Haxe")  ;
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   frame.setSize(200,200) ;
   frame.show();
   }
}


et voila: http://lekin.org/files/dump/2010/hxrhino/haxeswing.jpg

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

Re: hxRhino preview (Haxe on JVM)

Randy Stauner
now _that_ is cool... makes me dream of many interesting possibilities

On Sat, May 22, 2010 at 5:43 PM, ben kuin <[hidden email]> wrote:
just for fun, Swing with Haxe :-)


import packages.javax.swing.JFrame;
class Swingtest {
  static function main() {
  var frame = new JFrame("Hello Haxe")  ;
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setSize(200,200) ;
  frame.show();
  }
}


et voila: http://lekin.org/files/dump/2010/hxrhino/haxeswing.jpg

--
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: Re: [haXe] hxRhino preview (Haxe on JVM)

clemos
In reply to this post by clemos
Hi

It looks like there is an error in your hxrhinoinst.sh script at line 28 :
/usr/local/hxrhino/haxe/std
should be
/usr/local/hxrhino/std
At least I had to change it to make it work (Ubuntu 64 10.04)...

++++++
Clément

On May 21, 2010 9:10am, clemos <[hidden email]> wrote:

> Didn't give it a try yet, but looks great :)
>
>
>
> Last year I started such experiments with JS/Rhino/Java.
>
> My goal was to allow writing Red5 apps in haXe.
>
> I managed to get a few simple examples to work, but globally it was a
>
> bit of a mess and I left this project.
>
> As soon as I have some time I should at least put these experiments somewhere:
>
> there was basically a little script that converts Java/javadoc xml
>
> class definitions to haXe externs, and a custom Red5 Adapter class.
>
>
>
> ++++++
>
> Clément
>
>
>
> On Fri, May 21, 2010 at 2:24 AM, ben kuin [hidden email]> wrote:
>
> > hi
>
> >
>
> > why?
>
> > ------
>
> > Because I wanted to learn more about Haxes backends
>
> > Haxe for JVM
>
> >
>
> > what?
>
> > --------
>
> > It's a simple patch to the existing haxe tree
>
> > It is a complete separate project though
>
> > So it won't mess with your haxe installation
>
> >
>
> > how?
>
> > -------
>
> > in order to install hxrhino, on the command line:
>
> >   wget http://lekin.org/files/dump/2010/hxrhino/hxrhinoinst.sh
>
> >   chmod 0755 hxrhinoinst.sh
>
> >   ./hxrhinoinst.sh
>
> >
>
> > this will install:
>
> >   /usr/local/hxrhino/
>
> >   the command 'hxrhino'
>
> >
>
> > example?
>
> > --------------
>
> > get examples:
>
> >   wget http://lekin.org/files/dump/2010/hxrhino/examples.tar.gz
>
> >   tar xfvz examples.tar.gz
>
> >   cd examples
>
> >
>
> > compile with hxrhino:
>
> >   hxrhino compile.hxml
>
> >
>
> > compile to java class
>
> >   export RHINO_HOME=~/usr/local/rhino
>
> >   java -cp $RHINO_HOME org.mozilla.javascript.tools.jsc.Main test.js
>
> >
>
> > run it:
>
> >   java -cp $RHINO_HOME test
>
> >
>
> > Test.hx:3: Hello World !
>
> >
>
> >
>
> > regards
>
> > ben
>
> >
>
> > --
>
> > 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: hxRhino preview (Haxe on JVM)

clemos
In reply to this post by ben kuin
Hi ben

I can't compile this example :
./Swingtest.hx:1: characters 0-35 : Class not found : packages.javax.swing.JFrame
I guess it needs haXe extern classes for swing.
Are these available for download somewhere ?

++++++++
Clément

On May 23, 2010 2:43am, ben kuin <[hidden email]> wrote:

> just for fun, Swing with Haxe :-)
>
>
>
>
>
> import packages.javax.swing.JFrame;
>
> class Swingtest {
>
>   static function main() {
>
>   var frame = new JFrame("Hello Haxe")  ;
>
>   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>
>   frame.setSize(200,200) ;
>
>   frame.show();
>
>   }
>
> }
>
>
>
>
>
> et voila: http://lekin.org/files/dump/2010/hxrhino/haxeswing.jpg
>
>
>
> --
>
> 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: hxRhino preview (Haxe on JVM)

basvanmeurs
In reply to this post by ben kuin
Hi Ben,

That looks very interesting. I've had a look at Rhino myself but one thing that struck me is that it internally adds a feature to javascript that's not native to it: overloading.

How will we be able to use the full Java library as Haxe does not support overloading? We can't just create 'extern' classes.

I guess the same problem must be one of the things that's holding back the Haxe Java target.

Regards,
Bas
Reply | Threaded
Open this post in threaded view
|

Re: hxRhino preview (Haxe on JVM)

ben kuin
thanks for the feedback and sorry, if something doesn't run. Right now
I'm not working on hxrhino. I'm investigating to target scala or even
java. There are already a couple attemps from other people and I
think/hope I'm able to come up with something usable in the next
weeks.



On Fri, May 28, 2010 at 9:44 AM, basvanmeurs <[hidden email]> wrote:

>
> Hi Ben,
>
> That looks very interesting. I've had a look at Rhino myself but one thing
> that struck me is that it internally adds a feature to javascript that's not
> native to it: overloading.
>
> How will we be able to use the full Java library as Haxe does not support
> overloading? We can't just create 'extern' classes.
>
> I guess the same problem must be one of the things that's holding back the
> Haxe Java target.
>
> Regards,
> Bas
> --
> View this message in context: http://haxe.1354130.n2.nabble.com/hxRhino-preview-Haxe-on-JVM-tp5082137p5111994.html
> Sent from the Haxe mailing list archive at Nabble.com.
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

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