javascript output optimization.

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

Re: javascript output optimization.

Lee Sylvester
Nice additions re: --macro. Does the package splitting act as the default
option using the --macros splitting switch?

Thanks,
Lee



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Nicolas Cannasse
Sent: 28 November 2010 19:56
To: [hidden email]; The haXe compiler list
Subject: Re: [haXe] Re: javascript output optimization.

Le 28/11/2010 12:53, Nathan a écrit :
> JS has been pretty much ignored as a target, it's like a pre-alpha
> "well it works" target.
[...]

I think you're being overly unfair on haXe/JS support.

I'm the first one to admit that it requires more work, and I've already
advanced on some of the things we have been discussing in the past.

For instance today I have committed the --macro compiler parameter
implementation which will enable macro-controlled compiler configuration. A
few uses cases can be :

- manage excluded classes, allowing for instance to exclude interfaces from
being generated
- allow custom .js splitting (per package, or using your own rules)
- ... and much more

I have also talked with Franco about ways to avoid putting things in the
global scope.

Instead of bashing haXe .js output, you should describe much more precisely
how the JS output can be made better, and detail why such changes are
important for JS developers.

Also, I don't agree with your claim that haXe high-level approach is doomed
to be less optimized, since

a) the code generated in methods is pretty much the same that one would
write in plain JS, but since we go through a compiler it can be
automatically optimized

b) using high-level constructs such as enums will enable the compiler to do
smart optimizations that the developer might not have done itself

This is the whole story of programming languages evolution - or else
everybody would still be coding in ASM/C

Nicoals

--
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: javascript output optimization.

Michiel Crefcoeur
In reply to this post by sledorze
please take a look at this project.
it takes care of all the JS issues.
http://code.google.com/p/haxetacy/

2010/11/27 sledorze <[hidden email]>

Hi!
Looking at javascript code generated by the compiler, I see a lot of
boilerplate (it looks like the optimization has been done on a more general
phase and not on the javascript generation one).
Looks like nothing is made to make it particularly fast nor small (looks
like it's made for debug purpose).
I wonder if there's some options so that the output is generated for
optimized code / space?
Stephane

--
View this message in context: http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5780561.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
Reply | Threaded
Open this post in threaded view
|

Re: javascript output optimization.

sledorze
At first sight, looks like there's several aspects in this project, I'm a bit puzzled about its scope.
Is there some dependencies between these aspects? Can't this be separated (APIs vs JS post compiling).
Is there any tangible example of what the post compiler does?
It looks pretty young, have any projects used it yet? 
Stephane

On Thu, Dec 2, 2010 at 10:23 PM, Michiel Crefcoeur [via Haxe] <[hidden email]> wrote:
please take a look at this project.
it takes care of all the JS issues.
http://code.google.com/p/haxetacy/

2010/11/27 sledorze <[hidden email]>

Hi!
Looking at javascript code generated by the compiler, I see a lot of
boilerplate (it looks like the optimization has been done on a more general
phase and not on the javascript generation one).
Looks like nothing is made to make it particularly fast nor small (looks
like it's made for debug purpose).
I wonder if there's some options so that the output is generated for
optimized code / space?
Stephane

--
View this message in context: http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5780561.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


View message @ http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5797704.html

To unsubscribe from javascript output optimization., click here.



--
Stéphane Le Dorze

Tel: +33 (0) 06 08  76 70 15


Reply | Threaded
Open this post in threaded view
|

Re: javascript output optimization.

Michiel Crefcoeur
The scope is: make the haXe js target more useful. :-)
It has been used for about a year now at the company I work for.
We primarily use it for ASP and the browser environment.
I wish it could have been possible to seperate the various platform-specific API's into several haxelib libraries but the way the compiler prioritizes library dependancies (overruling classes) and compiler directives prevents this.
This really has to change in order to make it more easy to add compiler targets.
After much trial and error, all code ended up in this one "do-it-all" library.
You can however use the postcompiler without having to use the API.
That's the theory at least but I haven't tried that in a while so please let me know if something fails.
Development is stewed by our needs over here at the company I work for so in that sense it looks pretty young but some aspects have matured over the past few months.
There's not really an example that shows you how to use the library but if you just want to see what the JS output looks like you can take a look at http://cimple.nl. This website doesn't really showcase anything visually but you can take a look at the js files it uses in firebug or chrome developer tools.
Both client- and serverside are written in haXe.
Just try it and don't hesitate to let me know if anything fails or isn't clear.
good luck!


2010/12/2 sledorze <[hidden email]>
At first sight, looks like there's several aspects in this project, I'm a bit puzzled about its scope.
Is there some dependencies between these aspects? Can't this be separated (APIs vs JS post compiling).
Is there any tangible example of what the post compiler does?
It looks pretty young, have any projects used it yet? 
Stephane

On Thu, Dec 2, 2010 at 10:23 PM, Michiel Crefcoeur [via Haxe] <[hidden email]> wrote:
please take a look at this project.
it takes care of all the JS issues.
2010/11/27 sledorze <[hidden email]>


Hi!
Looking at javascript code generated by the compiler, I see a lot of
boilerplate (it looks like the optimization has been done on a more general
phase and not on the javascript generation one).
Looks like nothing is made to make it particularly fast nor small (looks
like it's made for debug purpose).
I wonder if there's some options so that the output is generated for
optimized code / space?
Stephane

--
View this message in context: http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5780561.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


View message @ http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5797704.html

To unsubscribe from javascript output optimization., click here.



--
Stéphane Le Dorze

Tel: +33 (0) 06 08  76 70 15




View this message in context: Re: javascript output optimization.

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
Reply | Threaded
Open this post in threaded view
|

Re: javascript output optimization.

sledorze
(btw, what do you use as haxe server framework)

On Thu, Dec 2, 2010 at 11:27 PM, Michiel Crefcoeur [via Haxe] <[hidden email]> wrote:
The scope is: make the haXe js target more useful. :-)
It has been used for about a year now at the company I work for.
We primarily use it for ASP and the browser environment.
I wish it could have been possible to seperate the various platform-specific API's into several haxelib libraries but the way the compiler prioritizes library dependancies (overruling classes) and compiler directives prevents this.
This really has to change in order to make it more easy to add compiler targets.
After much trial and error, all code ended up in this one "do-it-all" library.
You can however use the postcompiler without having to use the API.
That's the theory at least but I haven't tried that in a while so please let me know if something fails.
Development is stewed by our needs over here at the company I work for so in that sense it looks pretty young but some aspects have matured over the past few months.
There's not really an example that shows you how to use the library but if you just want to see what the JS output looks like you can take a look at http://cimple.nl. This website doesn't really showcase anything visually but you can take a look at the js files it uses in firebug or chrome developer tools.
Both client- and serverside are written in haXe.
Just try it and don't hesitate to let me know if anything fails or isn't clear.
good luck!


2010/12/2 sledorze <[hidden email]>
At first sight, looks like there's several aspects in this project, I'm a bit puzzled about its scope.
Is there some dependencies between these aspects? Can't this be separated (APIs vs JS post compiling).
Is there any tangible example of what the post compiler does?
It looks pretty young, have any projects used it yet? 
Stephane


On Thu, Dec 2, 2010 at 10:23 PM, Michiel Crefcoeur [via Haxe] <[hidden email]> wrote:
please take a look at this project.
it takes care of all the JS issues.
2010/11/27 sledorze <[hidden email]>


Hi!
Looking at javascript code generated by the compiler, I see a lot of
boilerplate (it looks like the optimization has been done on a more general
phase and not on the javascript generation one).
Looks like nothing is made to make it particularly fast nor small (looks
like it's made for debug purpose).
I wonder if there's some options so that the output is generated for
optimized code / space?
Stephane

--
View this message in context: http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5780561.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


View message @ http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5797704.html

To unsubscribe from javascript output optimization., click here.



--
Stéphane Le Dorze

Tel: +33 (0) 06 08  76 70 15




View this message in context: Re: javascript output optimization.

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


View message @ http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5797906.html

To unsubscribe from javascript output optimization., click here.



--
Stéphane Le Dorze

Tel: +33 (0) 06 08  76 70 15


Reply | Threaded
Open this post in threaded view
|

Re: javascript output optimization.

Michiel Crefcoeur
We use our own framework which is, at least for now, closed source.
One important note though: haxetacy was built and tested with haxe 2.05 and I've just noticed that it doesn't work with 2.06.
This will be solved soon.

2010/12/2 sledorze <[hidden email]>
(btw, what do you use as haxe server framework)

On Thu, Dec 2, 2010 at 11:27 PM, Michiel Crefcoeur [via Haxe] <[hidden email]> wrote:
The scope is: make the haXe js target more useful. :-)
It has been used for about a year now at the company I work for.
We primarily use it for ASP and the browser environment.
I wish it could have been possible to seperate the various platform-specific API's into several haxelib libraries but the way the compiler prioritizes library dependancies (overruling classes) and compiler directives prevents this.
This really has to change in order to make it more easy to add compiler targets.
After much trial and error, all code ended up in this one "do-it-all" library.
You can however use the postcompiler without having to use the API.
That's the theory at least but I haven't tried that in a while so please let me know if something fails.
Development is stewed by our needs over here at the company I work for so in that sense it looks pretty young but some aspects have matured over the past few months.
There's not really an example that shows you how to use the library but if you just want to see what the JS output looks like you can take a look at http://cimple.nl. This website doesn't really showcase anything visually but you can take a look at the js files it uses in firebug or chrome developer tools.
Both client- and serverside are written in haXe.
Just try it and don't hesitate to let me know if anything fails or isn't clear.
good luck!


2010/12/2 sledorze <[hidden email]>

At first sight, looks like there's several aspects in this project, I'm a bit puzzled about its scope.
Is there some dependencies between these aspects? Can't this be separated (APIs vs JS post compiling).
Is there any tangible example of what the post compiler does?
It looks pretty young, have any projects used it yet? 
Stephane


On Thu, Dec 2, 2010 at 10:23 PM, Michiel Crefcoeur [via Haxe] <[hidden email]> wrote:
please take a look at this project.
it takes care of all the JS issues.
2010/11/27 sledorze <[hidden email]>


Hi!
Looking at javascript code generated by the compiler, I see a lot of
boilerplate (it looks like the optimization has been done on a more general
phase and not on the javascript generation one).
Looks like nothing is made to make it particularly fast nor small (looks
like it's made for debug purpose).
I wonder if there's some options so that the output is generated for
optimized code / space?
Stephane

--
View this message in context: http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5780561.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


View message @ http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5797704.html

To unsubscribe from javascript output optimization., click here.



--
Stéphane Le Dorze

Tel: +33 (0) 06 08  76 70 15




View this message in context: Re: javascript output optimization.

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


View message @ http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5797906.html

To unsubscribe from javascript output optimization., click here.



--
Stéphane Le Dorze

Tel: +33 (0) 06 08  76 70 15




View this message in context: Re: javascript output optimization.
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
Reply | Threaded
Open this post in threaded view
|

Re: javascript output optimization.

Michiel Crefcoeur
patched on repo.

2010/12/2 Michiel Crefcoeur <[hidden email]>
We use our own framework which is, at least for now, closed source.
One important note though: haxetacy was built and tested with haxe 2.05 and I've just noticed that it doesn't work with 2.06.
This will be solved soon.

2010/12/2 sledorze <[hidden email]>
(btw, what do you use as haxe server framework)


On Thu, Dec 2, 2010 at 11:27 PM, Michiel Crefcoeur [via Haxe] <[hidden email]> wrote:
The scope is: make the haXe js target more useful. :-)
It has been used for about a year now at the company I work for.
We primarily use it for ASP and the browser environment.
I wish it could have been possible to seperate the various platform-specific API's into several haxelib libraries but the way the compiler prioritizes library dependancies (overruling classes) and compiler directives prevents this.
This really has to change in order to make it more easy to add compiler targets.
After much trial and error, all code ended up in this one "do-it-all" library.
You can however use the postcompiler without having to use the API.
That's the theory at least but I haven't tried that in a while so please let me know if something fails.
Development is stewed by our needs over here at the company I work for so in that sense it looks pretty young but some aspects have matured over the past few months.
There's not really an example that shows you how to use the library but if you just want to see what the JS output looks like you can take a look at http://cimple.nl. This website doesn't really showcase anything visually but you can take a look at the js files it uses in firebug or chrome developer tools.
Both client- and serverside are written in haXe.
Just try it and don't hesitate to let me know if anything fails or isn't clear.
good luck!


2010/12/2 sledorze <[hidden email]>

At first sight, looks like there's several aspects in this project, I'm a bit puzzled about its scope.
Is there some dependencies between these aspects? Can't this be separated (APIs vs JS post compiling).
Is there any tangible example of what the post compiler does?
It looks pretty young, have any projects used it yet? 
Stephane


On Thu, Dec 2, 2010 at 10:23 PM, Michiel Crefcoeur [via Haxe] <[hidden email]> wrote:
please take a look at this project.
it takes care of all the JS issues.
2010/11/27 sledorze <[hidden email]>


Hi!
Looking at javascript code generated by the compiler, I see a lot of
boilerplate (it looks like the optimization has been done on a more general
phase and not on the javascript generation one).
Looks like nothing is made to make it particularly fast nor small (looks
like it's made for debug purpose).
I wonder if there's some options so that the output is generated for
optimized code / space?
Stephane

--
View this message in context: http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5780561.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


View message @ http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5797704.html

To unsubscribe from javascript output optimization., click here.



--
Stéphane Le Dorze

Tel: +33 (0) 06 08  76 70 15




View this message in context: Re: javascript output optimization.

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


View message @ http://haxe.1354130.n2.nabble.com/javascript-output-optimization-tp5780561p5797906.html

To unsubscribe from javascript output optimization., click here.



--
Stéphane Le Dorze

Tel: +33 (0) 06 08  76 70 15




View this message in context: Re: javascript output optimization.
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
1234