Try Haxe online!

717 views
Skip to first unread message

clemos

unread,
Jun 3, 2012, 6:00:37 PM6/3/12
to haxe...@googlegroups.com
Hi list,

As promised, I've been working on a small web app to test Haxe online.
It's quite similar to what Dart or JSX already have.

You can try it here:
http://try-haxe.aaaliasing.net/
Please do not share it too widely for now, I'd like to be sure that
there are not too large security holes.
I'd be very glad to receive any help in case someone finds some...

The source is here:
https://github.com/clemos/try-haxe

Currently, it works only for JS, but it should be quite easy to add
SWF support (it's almost done actually).
As for security, I've realized right before putting it online that
@:macro could be very dangerous so I disabled it...

I'd like to add autocompletion soon, so I used CodeMirror because it
already has base things for that.
I'm very open to any contribution.
Here are my thoughts on what could be interesting right now:
- finish SWF support, eventually with AS3 source
- Adding examples
- Better highlighting (a CodeMirror haxe mode; currently uses Javascript)
- more JS compilation options (--js-modern, maybe libs)
- "safe" other targets (@:macro, neko, PHP, ...) that would not pwn my server

I also like the idea of making it work more or less like pastebin or
gist, with persistence.
Currently, it keeps copies of all source files and compiled js, with
"per-load" unique ids, so there shouldn't be too much work there
either (adding "History.js" or something like that).
The "examples" section could probably be implemented this way...

Anyway, I hope you'll enjoy it!
Clément

Simon Krajewski

unread,
Jun 3, 2012, 6:02:57 PM6/3/12
to haxe...@googlegroups.com
Just clicking Run gives "Uncaught preg_match() [<a
href='function.preg-match'>function.preg-match</a>]: Compilation failed:
missing terminating ] for character class at offset 10 (errno: 2) in
/home/clemos/public_html/try-haxe/app/lib/EReg.class.php at line #23"

Simon

clemos

unread,
Jun 3, 2012, 6:10:22 PM6/3/12
to haxe...@googlegroups.com
Sorry it's fixed :p
> --
> To post to this group haxe...@googlegroups.com
> http://groups.google.com/group/haxelang?hl=en

Simon Krajewski

unread,
Jun 3, 2012, 6:12:56 PM6/3/12
to haxe...@googlegroups.com
Am 04.06.2012 00:10, schrieb clemos:
> Sorry it's fixed :p

Confirmed. Looks good so far, but please compile with
--dead-code-elimination. :)

Simon

Cambiata

unread,
Jun 3, 2012, 6:13:27 PM6/3/12
to haxe...@googlegroups.com
Cool! :-)

clemos

unread,
Jun 3, 2012, 6:23:38 PM6/3/12
to haxe...@googlegroups.com
Ok I've added --dead-code-elimination and --js-modern

Regards
Clément

Simon Krajewski

unread,
Jun 3, 2012, 6:31:05 PM6/3/12
to haxe...@googlegroups.com
Much better. Which haxe version are you using? Current SVN should not
generate __instanceof for a hello world program, and we're working on
further improvements to minimize generated code size (see
http://code.google.com/p/haxe/issues/detail?id=881).

Simon

Nicolas Cannasse

unread,
Jun 3, 2012, 6:31:07 PM6/3/12
to haxe...@googlegroups.com
Le 04/06/2012 00:00, clemos a �crit :
Great start :)

It would be nice to highlight the lines when you have some errors, and
be able to click on the error message to move to the line which has the
corresponding error :)

Also, if you could use Haxe/SVN, you'll get more optimized JS output
(and we are planning to improve it further). I think it will be nice to
make it public/official when we have "Hello World" compiling in only a
few lines of JS.

Best,
Nicolas


Nicolas Cannasse

unread,
Jun 3, 2012, 6:33:29 PM6/3/12
to haxe...@googlegroups.com
Le 04/06/2012 00:31, Nicolas Cannasse a �crit :
Oh, and code completion would be also very great.

After that, I think having a menu to select between a dozen of smart
Haxe examples should be a nice showcase.

Best,
Nicolas

Nicolas Cannasse

unread,
Jun 3, 2012, 6:35:11 PM6/3/12
to haxe...@googlegroups.com
Le 04/06/2012 00:31, Nicolas Cannasse a �crit :
One last idea : add a short for compilation and display it (for instance
"Run (F8)"). Makes much easy to tinkle :)

++
Nicolas




clemos

unread,
Jun 3, 2012, 6:48:45 PM6/3/12
to haxe...@googlegroups.com
Hi,

I just upgraded from latest stable to SVN.

I agree all those features would be great.
Thus I'll (again) welcome any contribution :)

Regards,
Clément

On Mon, Jun 4, 2012 at 12:35 AM, Nicolas Cannasse
<ncan...@motion-twin.com> wrote:
> Le 04/06/2012 00:31, Nicolas Cannasse a écrit :

Cambiata

unread,
Jun 3, 2012, 6:50:10 PM6/3/12
to haxe...@googlegroups.com
What about routing the trace command to display, maybe in a separate "trace output panel"?
This would make it more conform with hello world examples on haxe.org.
Now, trace gives a Firebug console output...

Cauê Waneck

unread,
Jun 3, 2012, 6:52:22 PM6/3/12
to haxe...@googlegroups.com
 
I agree all those features would be great.
Thus I'll (again) welcome any contribution :)

Count me in!  Do you have a roadmap of the planned features? 
Let's split some tasks, and even though my time is very restrained, I'd really love to help with what I can. 

Cheers!
Cauê

clemos

unread,
Jun 3, 2012, 7:18:27 PM6/3/12
to haxe...@googlegroups.com
There is no roadmap at all for now, it's only a week end project really :)
There are already quite a lot of ideas in this thread, many of them
shouldn't require too much time to implement...

Regards,
Clément

Cauê Waneck

unread,
Jun 3, 2012, 8:29:37 PM6/3/12
to haxe...@googlegroups.com
Ok then, I'll work on a sandboxed version of Haxe so macros are safe to execute (+ a process loader with timeouts), and later on a sandboxed neko vm, so we can safely execute scripts there (no file API, etc).

2012/6/3 clemos <cl3...@gmail.com>

Marcelo de Moraes Serpa

unread,
Jun 3, 2012, 8:32:11 PM6/3/12
to haxe...@googlegroups.com
Good work guys, this is looking great! 

- Marcelo

Cauê Waneck

unread,
Jun 3, 2012, 8:34:14 PM6/3/12
to haxe...@googlegroups.com
some ideas:
  • save a snippet to a short URL (maybe even be a pastebin-like for Haxe)
  • accept different files (for e.g. when we support different targets)
  • add flash target
  • deal with js + flash embedding

2012/6/3 Cauê Waneck <wan...@gmail.com>

JLM

unread,
Jun 3, 2012, 10:24:12 PM6/3/12
to Haxe
Looks great can it accept urls to external images? I tried an example
but it does not seem to have a default trace defined? But seems to be
compiling I orginally typed it all but eventually realised it was
possible to paste in ff. I need to update my js haxelib stuff but it
would be useful to have these installed by default, also useful to
have webm video and some stock images if external url calls are
blocked.


Run

Source

//package browserhx;

import js.Dom;

import js.Lib;

//Browserhx example JLM at justinfront dot net class is haxelib
browserhx BSD licence.

enum BrowserType

{

Chrome;

Safari;

WebKitOther;

Firefox;

Opera;

IE;

}

class Browser

{

private static var _browserType: BrowserType;

private static var _userAgent: String;

public static var browserType( get_BrowserType, null ): BrowserType;

private static function get_BrowserType():BrowserType

{

if( _browserType == null )

{

setBrowserType( Lib.window.navigator.userAgent );

}

return _browserType;

}

public static function traceAgent()

{

get_BrowserType();

trace( _userAgent );

}

public static function setBrowserType( agent: String ): BrowserType

{

_userAgent = agent;

if( (~/WebKit/).match( agent ) )

{

if((~/Chrome/).match( agent ) )

{

_browserType = Chrome;

}

else if( (~/Safari/).match( agent ) )

{

_browserType = Safari;

}

else

{

_browserType = WebKitOther;

}

}

else if( (~/Opera/).match( agent ) )

{

_browserType = Opera;

}

else if( (~/Mozilla/).match( agent ) )

{

var isIE = untyped( __js__("typeof document!='undefined'") &&
document.all != null && __js__("typeof window!='undefined'") &&
window.opera == null );

if( isIE )

{

_browserType = IE;

}

else

{

_browserType = Firefox;

}

}

else

{

_browserType = IE;

}

return _browserType;

}

}

class Test {

public static function main(){ new Test(); }

public function new()

{

var img = Lib.document.createElement("div");

var style = img.style;

style.position = "absolute";

style.left = 15 + "px";

style.top = 15 + "px";

var imageLocation = "https://browserhx.googlecode.com/hg/sample/
deploy/browserIcons/" + Std.string( Browser.browserType ) + "BW.png" ;

style.backgroundImage = 'url('+ imageLocation + ')';

trace( Browser.browserType );

Browser.traceAgent();

style.width = 32 + 'px';

style.height = 32 + 'px';

Lib.document.body.appendChild( img );

}

}



Output
JS Source

Build success!

Total time : 0.000s
------------------------------------
filters : 0.000s, -nan%
generate js : 0.000s, -nan%
other : 0.000s, -nan%
parsing : 0.000s, -nan%
typing : 0.000s, -nan%

Nicolas Cannasse

unread,
Jun 4, 2012, 3:53:26 AM6/4/12
to haxe...@googlegroups.com
Le 04/06/2012 02:29, Cau� Waneck a �crit :
> Ok then, I'll work on a sandboxed version of Haxe so macros are safe to
> execute (+ a process loader with timeouts), and later on a sandboxed
> neko vm, so we can safely execute scripts there (no file API, etc).

Well I think that's just a matter of running the compiler with a
specific Linux users which have limited rights :)

Best,
Nicolas

Dima Granetchi

unread,
Jun 4, 2012, 3:57:46 AM6/4/12
to haxe...@googlegroups.com
GREAT WORK! THANKS!

clemos

unread,
Jun 4, 2012, 4:35:27 AM6/4/12
to haxe...@googlegroups.com
Hi Justin,

I think it should accept urls to external images, at least the way you
linked them (with Canvas and stuff it's probably another story).
The trace calls are routed to console, which I think is the default
behaviour now.
As for libs, I can probably install some on the server, just let me know.

Regards,
Clément

clemos

unread,
Jun 4, 2012, 4:59:03 AM6/4/12
to haxe...@googlegroups.com
On Mon, Jun 4, 2012 at 9:53 AM, Nicolas Cannasse
<ncan...@motion-twin.com> wrote:
> Le 04/06/2012 02:29, Cauê Waneck a écrit :
>
>> Ok then, I'll work on a sandboxed version of Haxe so macros are safe to
>> execute (+ a process loader with timeouts), and later on a sandboxed
>> neko vm, so we can safely execute scripts there (no file API, etc).
>
>
> Well I think that's just a matter of running the compiler with a specific
> Linux users which have limited rights :)

Well this would require the rest of the server to be very secured as
well in terms of permissions, and I can't garantee that, given chmod
777 is my friend.
And there is resource management as well (timeouts, maybe quotas...).
Proper sandboxed Haxe and neko vm would be awesome, and I guess it may
have other use cases.

Regards,
Clément

Nicolas Cannasse

unread,
Jun 4, 2012, 5:15:04 AM6/4/12
to haxe...@googlegroups.com
Le 04/06/2012 10:59, clemos a �crit :
> On Mon, Jun 4, 2012 at 9:53 AM, Nicolas Cannasse
> <ncan...@motion-twin.com> wrote:
>> Le 04/06/2012 02:29, Cau� Waneck a �crit :
>>
>>> Ok then, I'll work on a sandboxed version of Haxe so macros are safe to
>>> execute (+ a process loader with timeouts), and later on a sandboxed
>>> neko vm, so we can safely execute scripts there (no file API, etc).
>>
>>
>> Well I think that's just a matter of running the compiler with a specific
>> Linux users which have limited rights :)
>
> Well this would require the rest of the server to be very secured as
> well in terms of permissions, and I can't garantee that, given chmod
> 777 is my friend.

Chroot is your friend as well then ;)
http://en.wikipedia.org/wiki/Chroot

> And there is resource management as well (timeouts, maybe quotas...).

I guess all of these (Memory, CPU, etc.) can also be handled by Linux,
and will much more efficient and safe if done by the OS than by a
modified compiler ;)

After all, that's what shared hosting services does.

Best,
Nicolas

clemos

unread,
Jun 4, 2012, 5:28:03 AM6/4/12
to haxe...@googlegroups.com
On Mon, Jun 4, 2012 at 11:15 AM, Nicolas Cannasse
<ncan...@motion-twin.com> wrote:
Yeah, I didn't think about chroot (well actually I did and then I forgot :p)
And I guess you're right there are probably more appropriate
sandboxing and resource management tools at the OS level.
If anyone has more expertise than me on these questions (which would
be easy), I'd very much appreciate any insight.

Regards,
Clément

Dima Granetchi

unread,
Jun 4, 2012, 5:33:41 AM6/4/12
to haxe...@googlegroups.com
Firefox strange show percents http://pix.am/PwoU/ in Chrome all ok. 

wish lish:
- sharing
- debug
- trace console (optional)
- haxelib support

How I can help for this project?

On Monday, 4 June 2012 10:57:46 UTC+3, Dima Granetchi wrote:
GREAT WORK! THANKS!

clemos

unread,
Jun 4, 2012, 5:46:52 AM6/4/12
to haxe...@googlegroups.com
Hi Dima

On Mon, Jun 4, 2012 at 11:33 AM, Dima Granetchi <system...@gmail.com> wrote:
> Firefox strange show percents http://pix.am/PwoU/ in Chrome all ok.

It's the raw output of the compiler, and this happens when compilation
is too fast :)
Division by zero (total time) I guess...

> wish lish:
> - sharing
> - debug
> - trace console (optional)
> - haxelib support
>
> How I can help for this project?

The source is here and pull requests are welcome:
https://github.com/clemos/try-haxe

You can just contribute the feature you'd like to see / you can implement :p
I guess for now we can just watch the Network graph to see who's
working on what and avoid working on similar things:
https://github.com/clemos/try-haxe/network

Regards,
Clément

>
>
> On Monday, 4 June 2012 10:57:46 UTC+3, Dima Granetchi wrote:
>>
>> GREAT WORK! THANKS!
>>

Simon Krajewski

unread,
Jun 4, 2012, 6:01:03 AM6/4/12
to haxe...@googlegroups.com
Am 04.06.2012 11:46, schrieb clemos:
> Hi Dima
>
> On Mon, Jun 4, 2012 at 11:33 AM, Dima Granetchi<system...@gmail.com> wrote:
>> Firefox strange show percents http://pix.am/PwoU/ in Chrome all ok.
> It's the raw output of the compiler, and this happens when compilation
> is too fast :)
> Division by zero (total time) I guess...

I fixed this on SVN because it looks pretty silly that way. The
individual times are now only reported if total time is > 0.

Simon

Dima Granetchi

unread,
Jun 4, 2012, 8:22:25 AM6/4/12
to haxe...@googlegroups.com
Great, thanks Simon 

jamezm...@gmail.com

unread,
Jun 4, 2012, 12:18:55 PM6/4/12
to haxe...@googlegroups.com
Is it intended that one can only use the classname Test?

class Lest {
  public static function main(){
  new js.JQuery("body").html("Haxe is great :)");
  }
}
        

Build failure

Module Test does not define type Test 

clemos

unread,
Jun 4, 2012, 12:23:44 PM6/4/12
to haxe...@googlegroups.com
For now, yes, "-main Test" is more or less hard coded.

clemos

unread,
Jun 4, 2012, 4:26:05 PM6/4/12
to haxe...@googlegroups.com
FYI I've added very basic autocompletion with Ctrl+Space ;)
Cheers,
Clément

Philippe Elsass

unread,
Jun 4, 2012, 4:37:51 PM6/4/12
to haxe...@googlegroups.com
Pretty fantastic, but the completion list doesn't pick the text written after it is displayed.
--
Philippe

clemos

unread,
Jun 4, 2012, 5:31:23 PM6/4/12
to haxe...@googlegroups.com
Yes, currently, it's really very basic, there is still a lot of work to be done.
But, yay, it gets actual info from the compiler, and it's rather fast :)

Cauê Waneck

unread,
Jun 4, 2012, 5:46:14 PM6/4/12
to haxe...@googlegroups.com
Hey Nicolas!
 
Chroot is your friend as well then ;)
http://en.wikipedia.org/wiki/Chroot 
I guess all of these (Memory, CPU, etc.) can also be handled by Linux, and will much more efficient and safe if done by the OS than by a modified compiler ;)

After all, that's what shared hosting services does.

If that's the best way, I'm all for using it... But I'm not an expert in that area and I wouldn't be sure how to do it, and maybe could overlook something that would add a vulnerability to it. Also neko is pretty easy to make a sandbox with it, and I would surely feel more safe.

Also even with those measures implemented, I think it would be nice to have e.g. the non-whitelisted apis to throw a proper error, Also a watchdog for the process timing would be pretty easy to implement, and very useful IMHO (specially if we are to use mod_neko for running the scripts at server-side), even if you can define CPU quotas at the OS level.

And maybe a version of haxe without the I/O macro part would be useful for other applications, don't you think?

Cauê

Cauê Waneck

unread,
Jun 4, 2012, 5:46:40 PM6/4/12
to haxe...@googlegroups.com
Fantastic, clemos!

Great job!!!

2012/6/4 clemos <cl3...@gmail.com>

Dima Granetchi

unread,
Jun 7, 2012, 10:54:10 AM6/7/12
to haxe...@googlegroups.com

Franco Ponticelli

unread,
Jun 7, 2012, 10:58:53 AM6/7/12
to haxe...@googlegroups.com
Beautiful!

On Thu, Jun 7, 2012 at 8:54 AM, Dima Granetchi <system...@gmail.com> wrote:

--

Nicolas Cannasse

unread,
Jun 7, 2012, 11:13:29 AM6/7/12
to haxe...@googlegroups.com
Le 07/06/2012 16:58, Franco Ponticelli a �crit :
> Beautiful!

Nice :)

I think that if we get completion results automatically for each . or (
pressed, as well as a nice tooltip that filter automatically completion
as-you-type and enable you to complete with TAB that would be really
interactive :)

Oh and a shortcut for Run and errors highlighting :)

Best,
Nicolas

Franco Ponticelli

unread,
Jun 7, 2012, 11:21:13 AM6/7/12
to haxe...@googlegroups.com
Oh and a shortcut for Run and errors highlighting :)
 
The Run shortcut is already there (CTRL+ENTER) but it triggers also a newline in the code editor ;)

Franco

clemos

unread,
Jun 7, 2012, 11:22:59 AM6/7/12
to haxe...@googlegroups.com
And error highlighting has just arrived ;)

@Franco: i can't reproduce the issue with Ctrl+Enter. What browser are
you using ?

Regards,
Clément

clemos

unread,
Jun 7, 2012, 11:42:36 AM6/7/12
to haxe...@googlegroups.com
There is an other problem...
Jeash doesn't compile with latest nightly :S

Simon Richardson

unread,
Jun 7, 2012, 11:52:58 AM6/7/12
to haxe...@googlegroups.com

On 7 Jun 2012, at 16:22, clemos wrote:

> And error highlighting has just arrived ;)
>
> @Franco: i can't reproduce the issue with Ctrl+Enter. What browser are
> you using ?

I can reproduce on Chrome OSX.

Franco Ponticelli

unread,
Jun 7, 2012, 1:35:31 PM6/7/12
to haxe...@googlegroups.com
I can reproduce on Chrome OSX.

Same here. It seems like you are using the last stable but the Git version of ACE is far superior and probably will fix the issue (I am using ACE and execute SHIFT+ENTER and works everywhere). Also the Git version supports multiple cursors which is really amazing.

Franco

clemos

unread,
Jun 7, 2012, 1:43:36 PM6/7/12
to haxe...@googlegroups.com
Actually, I use Code Mirror.

I may have fixed the issue.
Can you try again ?

Regards,
Clément

Franco Ponticelli

unread,
Jun 7, 2012, 1:54:39 PM6/7/12
to haxe...@googlegroups.com
It is fixed, thx .. and sorry about the ACE confusion ;)

Franco

nielzv...@gmail.com

unread,
Jun 7, 2012, 3:54:55 PM6/7/12
to haxe...@googlegroups.com
Woa, this is truly amazing!

How about adding a "library" of code examples to choose from? We could all send in small scripts (with extensive commenting) to make it a better learning expierence.

clemos

unread,
Jun 7, 2012, 5:54:28 PM6/7/12
to haxe...@googlegroups.com
Now with SWF support thanks to Dima :D
http://try-haxe.aaaliasing.net/#99Cac

About libraries of code examples, it's a good idea.
We should give the possibility to "lock" some links with a password so
they can't be further modified.

Besides code examples, I think it would be great to have a kind of
"showcase" website with small demos, something much more sexy than
Dart or JSX, more like what processing.org used to be.
Because it's really a pity to present such a great technology without
seeing it in action :)

Regards,
Clément

Simon Krajewski

unread,
Jun 7, 2012, 6:04:18 PM6/7/12
to haxe...@googlegroups.com
Am 07.06.2012 23:54, schrieb clemos:
> Now with SWF support thanks to Dima :D
> http://try-haxe.aaaliasing.net/#99Cac

Looks great!

Simon

Dima Granetchi

unread,
Jun 7, 2012, 6:10:26 PM6/7/12
to haxe...@googlegroups.com
You can create read-only sharing with "fork" button or sub versions of shared project, something like here http://jsfiddle.net/

clemos

unread,
Jun 7, 2012, 8:44:09 PM6/7/12
to haxe...@googlegroups.com
New url, and jeash working :D
http://try.haxe.org/#Deb2e

Cheers,
Clément

airfoil

unread,
Jun 7, 2012, 9:28:03 PM6/7/12
to haxe...@googlegroups.com
Excellent work!

Minor nitpick, but on the "Options" tab I thought the little question mark icons were going to provide a tooltip-like description of the lib. It was a little weird to click on the question mark and be taken to the page for the library. Seems like clicking on the name of the lib would take me to the lib page and the question mark icons could be tooltips briefly describing the lib. It's super minor and nitpicky, but I figured I'd mention it.

Overall though, this is awesome!

John

Tom

unread,
Jun 8, 2012, 2:35:10 AM6/8/12
to haxe...@googlegroups.com
Amazing work!

One suggestion: the actual compile command can be traced/displayed, so anybody can reproduces TryHaxe's results off-line?

Dima Granetchi

unread,
Jun 8, 2012, 3:21:19 AM6/8/12
to haxe...@googlegroups.com
perfectly :)

Dima Granetchi

unread,
Jun 8, 2012, 8:18:14 AM6/8/12
to haxe...@googlegroups.com

Maxime LOIZEAU

unread,
Jun 8, 2012, 9:38:07 AM6/8/12
to haxe...@googlegroups.com
Great job !

Maybe one more thing on your todo list : the abilty to extend the textarea !

clemos

unread,
Jun 8, 2012, 9:41:39 AM6/8/12
to haxe...@googlegroups.com
Hi Maxime,

On Fri, Jun 8, 2012 at 3:38 PM, Maxime LOIZEAU <maxi...@beemoov.com> wrote:
> Great job !
>
> Maybe one more thing on your todo list : the abilty to extend the textarea !

I'm sorry but I think I don't get it.
What do you mean ?

Regards,
Clément

Maxime LOIZEAU

unread,
Jun 8, 2012, 9:48:39 AM6/8/12
to haxe...@googlegroups.com
A picture is worth a thousand words ^^
Something like that :

Dima Granetchi

unread,
Jun 8, 2012, 11:28:48 AM6/8/12
to haxe...@googlegroups.com

Nicolas Cannasse

unread,
Jun 8, 2012, 11:57:36 AM6/8/12
to haxe...@googlegroups.com
Le 08/06/2012 17:28, Dima Granetchi a �crit :
Great :)

The following example in Jeash gives me an error "PointInPathMode is
undefined". Any idea ?

class Test {
static function main() {
var g = jeash.Lib.current.graphics;
for( i in 0...100 ) {
g.beginFill(Std.random(0x1000000),0.5);
g.drawCircle(Math.random() * 600,Math.random() * 300, 50);
}
}
}

My wishlist :

- Disabling F5 while we have focus on the code
- Adding F8 as a short to run (same as FlashDevelop)
- Be able to complete the code with TAB (same as Enter)
- Show Types/Documentation for the currently selected completion tip
- Mouesover the warning icon/line to know the error message
- Makes the completion tip nicer (a bit of CSS please) :)
- Completion for function parameters (after '(' or even ',')

Best,
Nicolas

Dima Granetchi

unread,
Jun 8, 2012, 12:02:29 PM6/8/12
to haxe...@googlegroups.com

The following example in Jeash gives me an error "PointInPathMode is undefined". Any idea ?

class Test {
 static function main() {
   var g = jeash.Lib.current.graphics;
   for( i in 0...100 ) {
     g.beginFill(Std.random(0x1000000),0.5);
     g.drawCircle(Math.random() * 600,Math.random() * 300, 50);
   }
 }
}

Very strange

this works

class Test {
 static function main() {
   var s = new flash.display.Shape();
   var g = s.graphics;
   for( i in 0...100 ) {
     g.beginFill(Std.random(0x1000000),0.5);
     g.drawCircle(Math.random() * 600,Math.random() * 300, 50);
     flash.Lib.current.addChild(s);
   }
 }
}

Nicolas Cannasse

unread,
Jun 8, 2012, 12:05:32 PM6/8/12
to haxe...@googlegroups.com
Le 08/06/2012 18:02, Dima Granetchi a �crit :
>
> The following example in Jeash gives me an error "PointInPathMode is
> undefined". Any idea ?
>
> class Test {
> static function main() {
> var g = jeash.Lib.current.graphics;
> for( i in 0...100 ) {
> g.beginFill(Std.random(__0x1000000),0.5);
> g.drawCircle(Math.random() * 600,Math.random() * 300, 50);
> }
> }
> }
>
>
> Very strange
>
> this works
>
> class Test {
> static function main() {
> var s = new flash.display.Shape();
> var g = s.graphics;
> for( i in 0...100 ) {
> g.beginFill(Std.random(0x1000000),0.5);
> g.drawCircle(Math.random() * 600,Math.random() * 300, 50);
> flash.Lib.current.addChild(s);
> }
> }
> }

I guess Jeash is not perfectly ready for --dead-code-elimination yet.
Seems likes there's also a lot of things done in __init__, which makes
it big even if not much code is actually used.

Best,
Nicolas


clemos

unread,
Jun 8, 2012, 12:16:21 PM6/8/12
to haxe...@googlegroups.com
On Fri, Jun 8, 2012 at 6:05 PM, Nicolas Cannasse
<ncan...@motion-twin.com> wrote:
It seems this works too :
http://try.haxe.org/#dc884
It only works if you explicitely import jeash.display.Graphics,
PointInPathMode is an enum in the Graphics module.
Otherwise it doesn't appear in the output even when Graphics is obviously used.

So there may be a DCE bug, actually...

Clément

clemos

unread,
Jun 8, 2012, 12:51:25 PM6/8/12
to haxe...@googlegroups.com
On Fri, Jun 8, 2012 at 5:57 PM, Nicolas Cannasse
<ncan...@motion-twin.com> wrote:

> My wishlist :
>
> - Disabling F5 while we have focus on the code
> - Adding F8 as a short to run (same as FlashDevelop)
> - Be able to complete the code with TAB (same as Enter)

> - Makes the completion tip nicer (a bit of CSS please) :)

All this is done.

> - Show Types/Documentation for the currently selected completion tip
> - Mouesover the warning icon/line to know the error message
> - Completion for function parameters (after '(' or even ',')

This is "planned" :)

Cheers,
Clément

Hudson Ansley

unread,
Jun 8, 2012, 3:38:54 PM6/8/12
to haxe...@googlegroups.com
FYI- on one of the 3d demos (http://try.haxe.org/#8bEfd I think) I
went full screen and got stuck there - esc would not get me out of it.
Had to hide chrome and kill the process in the task manager to get
out. This is on Win 7 64bit and chrome. Did not try to reproduce it a
second time - was difficult to find the right process to kill...

Regards,
Hudson

ps- this is really cool stuff!

Marcelo de Moraes Serpa

unread,
Jun 8, 2012, 4:52:32 PM6/8/12
to haxe...@googlegroups.com
Just an wild idea. Couldn't this be turned into an platform to deploy Haxe apps more easily? Something like Heroku for Haxe. Great work so far!

- Marcelo

Dima Granetchi

unread,
Jun 9, 2012, 5:48:18 AM6/9/12
to haxe...@googlegroups.com

Luca

unread,
Jun 9, 2012, 6:53:20 AM6/9/12
to haxe...@googlegroups.com
It'd be nice if all haxelib libs were available to select? 

Tony Polinelli

unread,
Jun 9, 2012, 7:00:41 AM6/9/12
to haxe...@googlegroups.com
yes- and/or a field for extra compiler commands



On Sat, Jun 9, 2012 at 1:53 PM, Luca <delta...@hotmail.com> wrote:
> It'd be nice if all haxelib libs were available to select?
>
--
Tony Polinelli
http://touchmypixel.com

Dima Granetchi

unread,
Jun 9, 2012, 7:05:14 AM6/9/12
to haxe...@googlegroups.com
for example?

btw, very insecurity option - macros, -cmd etc. 


clemos

unread,
Jun 9, 2012, 7:07:17 AM6/9/12
to haxe...@googlegroups.com
On Sat, Jun 9, 2012 at 12:53 PM, Luca <delta...@hotmail.com> wrote:
> It'd be nice if all haxelib libs were available to select?

It would also be very dangerous ;)
For now the compiler processes are not sandboxed / chrooted, so I need
to be very careful.
For instance I disabled @:file, @:bitmap and stuff...

I really need to look into chroot to allow all that.

Regards,
Clément

Mihail Ivanchev

unread,
Jun 9, 2012, 7:12:34 AM6/9/12
to haxe...@googlegroups.com
I think this will seriously put the server in danger of being hacked :)

Jason O'Neil

unread,
Jun 10, 2012, 10:28:12 AM6/10/12
to haxe...@googlegroups.com
Just visited Hacker News and saw this at the top of the front page.

I hope you're ready for some extra traffic :) I'd log in and comment
but I can't remember my password :P

On Sat 09 Jun 2012 19:12:34 WST, Mihail Ivanchev wrote:
> I think this will seriously put the server in danger of being hacked :)
>
> On Sat, Jun 9, 2012 at 1:00 PM, Tony Polinelli <to...@touchmypixel.com
> <mailto:to...@touchmypixel.com>> wrote:
>
> yes- and/or a field for extra compiler commands
>
>
>
> On Sat, Jun 9, 2012 at 1:53 PM, Luca <delta...@hotmail.com
> <mailto:delta...@hotmail.com>> wrote:
> > It'd be nice if all haxelib libs were available to select?
> >
> > --
> > To post to this group haxe...@googlegroups.com
> <mailto:haxe...@googlegroups.com>
> > http://groups.google.com/group/haxelang?hl=en
>
>
>
> --
> Tony Polinelli
> http://touchmypixel.com
>
> --
> To post to this group haxe...@googlegroups.com
> <mailto:haxe...@googlegroups.com>
> http://groups.google.com/group/haxelang?hl=en

clemos

unread,
Jun 10, 2012, 10:31:33 AM6/10/12
to haxe...@googlegroups.com
On Sun, Jun 10, 2012 at 4:28 PM, Jason O'Neil <jason...@gmail.com> wrote:
> Just visited Hacker News and saw this at the top of the front page.
>
> I hope you're ready for some extra traffic :)  I'd log in and comment but I
> can't remember my password :P

Yes I posted it on HN, I think I'm good :p
200+ active visitors right now according to Google Analytics, and the
server looks fine

Cheers,
Clément

clemos

unread,
Jun 10, 2012, 10:48:33 AM6/10/12
to haxe...@googlegroups.com
On Sun, Jun 10, 2012 at 4:28 PM, Jason O'Neil <jason...@gmail.com> wrote:
> Just visited Hacker News and saw this at the top of the front page.
>
> I hope you're ready for some extra traffic :)  I'd log in and comment but I
> can't remember my password :P

I saw you found it slow.
Could you elaborate a little ?
because actually my server is not really under heavy load right now,
so everything should work quite ok.

Regards,
Clément

clemos

unread,
Jun 10, 2012, 12:24:56 PM6/10/12
to haxe...@googlegroups.com
On Sun, Jun 10, 2012 at 4:48 PM, clemos <cl3...@gmail.com> wrote:
> On Sun, Jun 10, 2012 at 4:28 PM, Jason O'Neil <jason...@gmail.com> wrote:
>> Just visited Hacker News and saw this at the top of the front page.

http://news.ycombinator.com/item?id=4090987
It would be nice if some of the evangelist here could give a hand and
help animate the discussion...
FYI the page has hit ~5000 unique visitors today, so it may be time to
strike the iron while it's hot :)

Regards,
Clément

Cauê Waneck

unread,
Jun 10, 2012, 1:57:19 PM6/10/12
to haxe...@googlegroups.com
It's raining tweets about it! :D

Congrats, Clément! It's awesome!

2012/6/10 clemos <cl3...@gmail.com>

Regards,
Clément

Cauê Waneck

unread,
Jun 10, 2012, 2:03:07 PM6/10/12
to haxe...@googlegroups.com
Autocompletion is broken for me (Chrome / Windows)

2012/6/10 Cauê Waneck <wan...@gmail.com>

clemos

unread,
Jun 10, 2012, 2:13:36 PM6/10/12
to haxe...@googlegroups.com
On Sun, Jun 10, 2012 at 8:03 PM, Cauê Waneck <wan...@gmail.com> wrote:
> Autocompletion is broken for me (Chrome / Windows)

Any clue as to why ?
I can't reproduce on Chrome/Ubuntu...

Regards,
Clément

Simon Krajewski

unread,
Jun 10, 2012, 2:18:06 PM6/10/12
to haxe...@googlegroups.com
Am 10.06.2012 20:13, schrieb clemos:
> On Sun, Jun 10, 2012 at 8:03 PM, Cau� Waneck<wan...@gmail.com> wrote:
>> Autocompletion is broken for me (Chrome / Windows)
> Any clue as to why ?
> I can't reproduce on Chrome/Ubuntu...

Works for me too (Chrome / Windows). Caue, are you sure you didn't try
to get completion in the #if js ... #end part while flash target was active?

Simon

Cauê Waneck

unread,
Jun 10, 2012, 2:18:49 PM6/10/12
to haxe...@googlegroups.com
Any clue as to why ?
I can't reproduce on Chrome/Ubuntu...

Nevermind, it seems that most of the times it works, but sometimes it doesn't. It might be that the response time is big enough for the user(me) to play around with the text cursor, making it never show

Sorry for the false alarm ;)
Cauê

Nicolas Cannasse

unread,
Jun 10, 2012, 2:27:05 PM6/10/12
to haxe...@googlegroups.com
Le 10/06/2012 20:03, Cau� Waneck a �crit :
> Autocompletion is broken for me (Chrome / Windows)

Works for me, Chrome/Windows as well.
Maybe it's related to a specific example ?

Best,
Nicolas

Benjamin Dubois

unread,
Jun 10, 2012, 5:04:13 PM6/10/12
to haxe...@googlegroups.com
I've seen a lot of cool demos.

Would be really cool to be able to load them (with a short description).

Ben

Cauê Waneck

unread,
Jun 10, 2012, 8:08:27 PM6/10/12
to haxe...@googlegroups.com
Just something I came across: http://ocsigen.org/js_of_ocaml/manual/overview 

Cauê Waneck

unread,
Jun 3, 2012, 6:39:35 PM6/3/12
to haxe...@googlegroups.com
AWESOME!!!!

I'll copy and paste some ideas I shared at haxenext some time ago:

  - Create a "Try Haxe" site 
      - I think this could become something very social, and VERY fun. It 
      could start with something like this:  http://golang.org/ , but I 
      think we could expand to something like Wonderfl. I think the 
hardest part 
      of that would be to make it safe, as it would be truly awesome to be able 
      to showcase some simple client->server communication, for example. I can 
      imagine that with a good system for tags, and a simple code 
analysis to get 
      the used functions could render something which IMO is even better than 
      documentation (of course one does not exclude the other): simple snippets 
      and examples! Integrate that with an IDE and you have instant snippets on 
      how to use an API!  

I really think it's an amazing initiative you're doing, Clemos, and I really would love to help. Specially if we in the future are to support maybe a server-side part, so the user can see the amazing remoting possibilities, very clearly!!!

2012/6/3 Nicolas Cannasse <ncan...@motion-twin.com>
Le 04/06/2012 00:31, Nicolas Cannasse a écrit :
Le 04/06/2012 00:00, clemos a écrit :

Hi list,

As promised, I've been working on a small web app to test Haxe online.
It's quite similar to what Dart or JSX already have.

You can try it here:
http://try-haxe.aaaliasing.net/
Please do not share it too widely for now, I'd like to be sure that
there are not too large security holes.
I'd be very glad to receive any help in case someone finds some...

The source is here:
https://github.com/clemos/try-haxe

Currently, it works only for JS, but it should be quite easy to add
SWF support (it's almost done actually).
As for security, I've realized right before putting it online that
@:macro could be very dangerous so I disabled it...

I'd like to add autocompletion soon, so I used CodeMirror because it
already has base things for that.
I'm very open to any contribution.
Here are my thoughts on what could be interesting right now:
- finish SWF support, eventually with AS3 source
- Adding examples
- Better highlighting (a CodeMirror haxe mode; currently uses Javascript)
- more JS compilation options (--js-modern, maybe libs)
- "safe" other targets (@:macro, neko, PHP, ...) that would not pwn my
server

One last idea : add a short for compilation and display it (for instance "Run (F8)"). Makes much easy to tinkle :)

++

Nicolas

whitetigle

unread,
Jun 8, 2012, 3:33:18 AM6/8/12
to haxe...@googlegroups.com
Bravo ! !

Le 08/06/2012 02:44, clemos a �crit :
> New url, and jeash working :D
> http://try.haxe.org/#Deb2e
>
> Cheers,
> Cl�ment
>
> On Fri, Jun 8, 2012 at 12:10 AM, Dima Granetchi<system...@gmail.com> wrote:
>> You can create read-only sharing with "fork" button or sub versions of
>> shared project, something like here http://jsfiddle.net/
>>
>> On Friday, 8 June 2012, clemos wrote:
>>> Now with SWF support thanks to Dima :D
>>> http://try-haxe.aaaliasing.net/#99Cac
>>>
>>> About libraries of code examples, it's a good idea.
>>> We should give the possibility to "lock" some links with a password so
>>> they can't be further modified.
>>>
>>> Besides code examples, I think it would be great to have a kind of
>>> "showcase" website with small demos, something much more sexy than
>>> Dart or JSX, more like what processing.org used to be.
>>> Because it's really a pity to present such a great technology without
>>> seeing it in action :)
>>>
>>> Regards,
>>> Cl�ment
>>>
>>> On Thu, Jun 7, 2012 at 9:54 PM,<nielzv...@gmail.com> wrote:
>>>> Woa, this is truly amazing!
>>>>
>>>> How about adding a "library" of code examples to choose from? We could
>>>> all
>>>> send in small scripts (with extensive commenting) to make it a better
>>>> learning expierence.
>>>>> I also like the idea of making it work more or less like pastebin or
>>>>> gist, with persistence.
>>>>> Currently, it keeps copies of all source files and compiled js, with
>>>>> "per-load" unique ids, so there shouldn't be too much work there
>>>>> either (adding "History.js" or something like that).
>>>>> The "examples" section could probably be implemented this way...
>>>>>
>>>>> Anyway, I hope you'll enjoy it!
>>>>> Cl�ment
--
http://whitetigle.tumblr.com/

God Sony

unread,
Jun 10, 2012, 12:42:10 AM6/10/12
to haxe...@googlegroups.com
where is the away3d 4.x haxe version? haxelib?

On Sat, Jun 9, 2012 at 5:48 PM, Dima Granetchi <system...@gmail.com> wrote:
new demo http://try.haxe.org/#9F075

Justin Donaldson

unread,
Jun 10, 2012, 10:57:48 PM6/10/12
to haxe...@googlegroups.com
I'm seconding this... potential server-side security issues aside, this was really well done.  Congrats!

Integrating the IDE with a browser makes a lot of sense, especially for working with js/flash.  Texmate had a nice "webview" mode that I haven't seen duplicated yet.

However, I found that Chrome has a nice terminal emulator app:

It's possible to use it with a terminal editor, and hack up the Chrome terminal output to show compiler results in an iframe.  So, here's my haxe vim plugin doing its best "light table" impersonation. :)

Best,
-Justin

--
blog: http://www.scwn.net
aim: iujjd
twitter: jjdonald

Screen Shot 2012-06-10 at 7.44.34 PM.png

clemos

unread,
Jun 11, 2012, 5:20:27 AM6/11/12
to haxe...@googlegroups.com
Hi Cauê, all,

Thanks a lot for the support :)
We made 11000+ unique visitors yesterday :D
I'd like to say a special thanks Dima, who has made significant
contributions to the project.

Here are the next steps, as I'm seing them (not necessarily in that order):
- improve autocompletion, add hints and documentation, maybe raw
toplevel completion ("ported" from haxe-sublime-text2)
- improve performance: remoting is very good for some tasks, but it's
very slow when loading relatively big files (parsing).
- database storage rather than file storage: would allow me to clean
temporary data more easily, and would open doors to features like
rating, better sharing, searching, etc
- offer more NME targets: it's probably not possible to target iOS
directly (the server is Linux, obviously :) ), but for others it might
be, at least Android... not sure how, now, though.
- offer server-side targets: security is indeed a big concern here.
There is chroot-ing, which I'll have to look into in order to avoid
being pwnd, but things like mailing, etc, should also be forbidden,
which may be more tricky to do...

Then yes as I already wrote here, I'd love to see a "showcase" website
around this first brick :)
I don't think I have the time and probably neither the social
aptitudes to start such a project, though.
But with a few more work features around try-haxe (I mean: API), this
other project could evolve autonomously.

Regards,
Clément

clemos

unread,
Jun 11, 2012, 5:40:14 AM6/11/12
to haxe...@googlegroups.com
Obviously a browser-based IDE is something I'm seriously thinking about :)

clemos

unread,
Jun 11, 2012, 5:43:45 AM6/11/12
to haxe...@googlegroups.com
Hi,

It's just a swf-lib, actually.
You can get it here:
https://github.com/clemos/try-haxe/blob/master/lib/swf/away3d4.swf
I don't know where it comes from, though, Dima just put it here.
@Dima: where did you get it ? isn't there a licence or something I
should add with it ?

Regards,
Clément

Dima Granetchi

unread,
Jun 11, 2012, 5:47:08 AM6/11/12
to haxe...@googlegroups.com
it's my old build from 4.0.0 version with little bug fixes.

I'll build 4.0.6 soon

Message has been deleted

Dima Granetchi

unread,
Jun 11, 2012, 3:10:05 AM6/11/12
to haxe...@googlegroups.com
away3d 4.0.0
4.0.6 coming soon

Dima Granetchi

unread,
Jun 11, 2012, 9:09:00 AM6/11/12
to haxe...@googlegroups.com
clone https://github.com/clemos/haxe-bootstrap
near try-haxe folder

On 11 June 2012 13:40, Chris D <impal...@gmail.com> wrote:
Champion effort, it is very cool to see haxe compiling in the browser like this.

What do we need to do to test tryhaxe locally?
I try and compile the hxml and get "src/Editor.hx:7: characters 0-26 : Class not found : js.bootstrap.Button"

Dima Granetchi

unread,
Jun 15, 2012, 5:19:42 AM6/15/12
to haxe...@googlegroups.com

Tom

unread,
Jun 26, 2012, 2:27:19 AM6/26/12
to haxe...@googlegroups.com
Hi!

A new online opensource code editor is available: Adobe Brackets. Maybe this is a good alternative editor for Try Haxe.

Zachary Dremann

unread,
Jun 27, 2012, 6:14:50 AM6/27/12
to haxe...@googlegroups.com
Well, Brackets uses CodeMirror behind the scenes, which is exactly what is currently used already. And I'm not sure Brackets is ready for prime time yet. Good to watch out for though.

On a related note, I just hacked together a haxe mode for CodeMirror that could be used for Try Haxe. Much better syntax highlighting than using the javascript mode. You can mess around with it here: https://github.com/Dr-Emann/CodeMirror2  I'll be trying to get it pulled into the main repo soon, after some more polishing. You can play with it, and see if anything is horribly broken. Playground at mode/haxe/index.html.

clemos

unread,
Jun 27, 2012, 7:27:01 AM6/27/12
to haxe...@googlegroups.com
Hi,

On Wed, Jun 27, 2012 at 12:14 PM, Zachary Dremann <dre...@gmail.com> wrote:
> Well, Brackets uses CodeMirror behind the scenes, which is exactly what is
> currently used already. And I'm not sure Brackets is ready for prime time
> yet. Good to watch out for though.

Yes that's what I was going to say too.
But Brackets looks really promising, and since it's JS + CodeMirror, a
Haxe mode (completion, compilation, etc) could probably be hacked
quickly based on try-haxe code.
Thanks a lot Tom for the insight.

> On a related note, I just hacked together a haxe mode for CodeMirror that
> could be used for Try Haxe. Much better syntax highlighting than using the
> javascript mode. You can mess around with it
> here: https://github.com/Dr-Emann/CodeMirror2  I'll be trying to get it
> pulled into the main repo soon, after some more polishing. You can play with
> it, and see if anything is horribly broken. Playground at
> mode/haxe/index.html.

I'll definitely take a look at it and try to include it in try-haxe.

Regards,
Clément

ex

unread,
Jun 27, 2012, 1:02:14 PM6/27/12
to haxe...@googlegroups.com
Wow wow wow this looks pretty amazing!

Could this be made as http://wonderfl.net/ to set a window popup size and width and background. color for fullscreen?

Those simple changes would make try-haxe the de-facto stop for online demos also considering that Haxe is faster than vanilla AS3 and way faster that JS. Getting the hardcore demo sceners at our side would increase dramatically the reception of Haxe on mainstream.

cheers!

Zachary Dremann

unread,
Jun 28, 2012, 4:21:20 AM6/28/12
to haxe...@googlegroups.com
It's now been pulled into the main repo, as of 2d14145c74. Check it out:  http://codemirror.net/mode/haxe/index.html 
It is loading more messages.
0 new messages