You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by David Arno <da...@davidarno.org> on 2012/02/16 19:01:57 UTC

Project Goshawk [was Time for an Apache Flex compiler.]

As there was some positive feedback to the idea of creating our own
compiler, I have gone ahead and started a new project on Github and
created an initial design document on how I think it might work. I've
taken the liberty of giving it the code name "Goshawk." If you are
curious as to why, google for details on animals that predate upon
falcons ;)

You can take a read up on my ideas so far at
https://github.com/DavidArno/Goshawk/blob/master/documents/Goshawk
compiler initial ideas.pdf?raw=true (shortform: http://is.gd/94rcIb)

the project is https://github.com/DavidArno/Goshawk should you feel the
urge to fork it and help out.

Obviously, as per the mentors' request recently, whilst it makes sense
to experiment with this compiler on Github, we need to keep discussions
happening here. Perhaps we could prefix topics with [Goshawk]? That way
those that wish to concentrate on making the framework better, rather
than upon side projects like this, can filter out our discussions.

For anyone wanting to get involved, but is unsure where to start, you
could do worse than head over to http://www.antlr.org/ and get
reading :)

David.


Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by Martin Heidegger <mh...@leichtgewicht.at>.
On 17/02/2012 03:01, David Arno wrote:
> Obviously, as per the mentors' request recently, whilst it makes sense
> to experiment with this compiler on Github, we need to keep discussions
> happening here. Perhaps we could prefix topics with [Goshawk]? That way
> those that wish to concentrate on making the framework better, rather
> than upon side projects like this, can filter out our discussions.
If you keep the discussion here, you might also put the concept into the 
wiki :)

yours
Martin

PS.: Tagging mailing-list entries rocks :)


Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Thursday, February 16, 2012, David Arno wrote:

...
> Obviously, as per the mentors' request recently, whilst it makes sense
> to experiment with this compiler on Github, we need to keep discussions
> happening here...

Yes, that would be great.

> ..Perhaps we could prefix topics with [Goshawk]?...

Sounds good, or maybe shorten to [gosh] ;-)

-Bertrand

Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by Maciek Sakrejda <m....@gmail.com>.
Very nice. Have you considered RST [1] (or another markup language)
for the design document formatting? It's readable as plain text,
github displays some of these natively (I think at least RST and
Markdown), and RST can be "compiled" to PDF or HTML (e.g., Python uses
it for their documentation and generates output with Sphinx [2]).
Also, being plain text, it's fairly easy to merge proposed changes to
sections of your design document.

The main downsides are that formatting is limited (probably not an
issue--an asset, in fact--in something like a design document) and
that tables can be a royal pain (it's WYSIWYG, so you frequently need
to massage the table structure if you change data).

[1]: http://docutils.sourceforge.net/docs/user/rst/quickref.html
[2]: http://sphinx.pocoo.org/rest.html

Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by Roland Zwaga <ro...@stackandheap.com>.
>
> If a 3rd party really needs to release a new .swc, then they can still
> use the compc compiler as I think we are supposed to be getting that
> too. By requiring them to use compc, we make it clear that they are
> using old technology to do things the old way.
>
> Of course, having said all that, I may have missed the bleedin' obvious
> elephant in the room as to why this won't work, so please do tell if
> this is the case.


It sounds pretty plausible to me, although I'm not sure if it'll be
practical
not to support SWC's at all. There's a myriad of as3 libraries out there
and quite probably a lot of folks that might only be interested in the SWF
target. (At least for the foreseeable future). So then it might still be
good
practice to enable people to add SWC's to their build, but it that case
only the SWF target will work.
Until someone comes along and builds a preprocessor that can translate
a SWC to a goshawk library :)

cheers,

Roland

Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by Roland Zwaga <ro...@stackandheap.com>.
>
> Michael Schmalle already created jasblocks, a Java port of his asblocks
> engine
> which is able to parse AS3.
> https://github.com/teotigraphix/as3-commons-jasblocks/
> Since he's already created grammars for AS3, E4X, regex and ASDoc we might
> be able to stand on the shoulders of giants :)
> goldparser uses a different type of grammar notation, ANTLR uses EBNF and
> goldparser
> uses BNF. I am not familiar with the differences but I'm guessing it
> should be possible
> to convert between the two without too much hassle.
> After that its a matter of speed testing them.
>

Apparently this is how to convert from EBNF to BNF:

http://lampwww.epfl.ch/teaching/archive/compilation-ssc/2000/part4/parsing/node3.html

Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by Roland Zwaga <ro...@stackandheap.com>.
>
> By the way,
>
> here is the Java port of the goldparser engine:
>
> https://github.com/ridencww/goldengine
>
> it might be an idea to try out both ANTLR and goldparser
> and compare the results, I'd say the fastest one we'd take ;)
>

Michael Schmalle already created jasblocks, a Java port of his asblocks
engine
which is able to parse AS3.
https://github.com/teotigraphix/as3-commons-jasblocks/
Since he's already created grammars for AS3, E4X, regex and ASDoc we might
be able to stand on the shoulders of giants :)
goldparser uses a different type of grammar notation, ANTLR uses EBNF and
goldparser
uses BNF. I am not familiar with the differences but I'm guessing it should
be possible
to convert between the two without too much hassle.
After that its a matter of speed testing them.

cheers,

Roland

Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by David Arno <da...@davidarno.org>.
On Fri, 2012-02-17 at 10:25 +0100, Roland Zwaga wrote:
> By the way,
> 
> here is the Java port of the goldparser engine:
> 
> https://github.com/ridencww/goldengine
> 
> it might be an idea to try out both ANTLR and goldparser
> and compare the results, I'd say the fastest one we'd take ;)
How about I experiment with ANTLR and you experiment with GOLD? I think
we are both newbies to both utilities, so perhaps we could both just
report our findings here over the next few weeks(?) as we work through
getting to know the tool, trying to define a grammar using it etc.

David.


Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by Roland Zwaga <ro...@stackandheap.com>.
By the way,

here is the Java port of the goldparser engine:

https://github.com/ridencww/goldengine

it might be an idea to try out both ANTLR and goldparser
and compare the results, I'd say the fastest one we'd take ;)

cheers,

Roland


> If a 3rd party really needs to release a new .swc, then they can still
> use the compc compiler as I think we are supposed to be getting that
> too. By requiring them to use compc, we make it clear that they are
> using old technology to do things the old way.
>
> Of course, having said all that, I may have missed the bleedin' obvious
> elephant in the room as to why this won't work, so please do tell if
> this is the case.

RE: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
I really like the ideas being forth here. I still want to continue to push Adobe to finish Falcon work in an open development model, and I hope they respond as such. However, assuming not only that Falcon will retain its closed development model, but also that it is likely to slip past the end of this year, I agree we should move forward so long as there are interested parties.

I like the idea of the libraries quite a bit. What I think we should consider in the short term is to start producing a list of must-haves. A few things that killed us in the early days of the existing compiler could be avoided with a bit of planning.

In the meantime, I am going to continue with my plans to modify the existing compiler. Hopefully some of my work will both get us gains in the short term but also help provide some fodder for where certain use cases (like extensions) can fit into a new compiler design.

Cheers,
Mike


Notice: This transmission is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged or confidential. Any dissemination, distribution or copying of this transmission by anyone other than the intended recipient is strictly prohibited. If you have received this transmission in error, please notify the sender immediately by e-mail or telephone and delete the original transmission. Thank you.

Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by David Arno <da...@davidarno.org>.
On Thu, 2012-02-16 at 12:10 -0800, Om wrote:
> David, from your pdf (yeah, I read it ;-) )
> This sounds like a serious limitation - especially for Flex based library
> projects which is a pretty important feature.  Can you please elaborate on
> the workaround you hinted in your doc?
What I was thinking here was that Goshawk should support the use of
SWCs, but not promote them.

To take robotlegs as an example, currently they produce a robotlegs.swc,
or some such, library file. For backward compatibility, I'd anticipate
Goshawk supporting something like:

goshawk -target SWF -L lib/robotlegs.swc src -o myFunkyApp.swf

However, if/when we create a JavaScript target, the following won't
work:

goshawk -target JavaScript -L lib/robotlegs.swc src -o
myFunkyApp.HTML5Stuff

as I don't think it would be practical to try and translate the tags,
bytecode etc of a SWC to "HTML5."

So to that end, I'd imagine we would go to the robotlegs folk (or fork
it on github and do it ourselves) and ask them to do something like:

goshawk -noTarget src -o lib/robotlegs.lib

and to publish robotlegs.lib instead of robotlegs.swc, so that it is
usable with all Flex targets.

If a 3rd party really needs to release a new .swc, then they can still
use the compc compiler as I think we are supposed to be getting that
too. By requiring them to use compc, we make it clear that they are
using old technology to do things the old way.

Of course, having said all that, I may have missed the bleedin' obvious
elephant in the room as to why this won't work, so please do tell if
this is the case.

David.

  


Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by Roland Zwaga <ro...@stackandheap.com>.
>
> "To facilitate supporting multiple targets, Goshawk will not generate SWC
> library files as
> they can only be used by a compiler targetting SWFs. Instead, the
> language-agnostic parsetree
> generated by the ANTLR front-end will be used as a library file format.
> This may be
> stored in XML, JSON on binary format subject to future experimentation on
> the best storage
> form."


Supporting the generation of SWC's shouldn't be too hard, a SWC is just a
catalog.xml
file and a SWF file zipped into a single archive with a .swc extension. So
this should
be quite easy to implement as an optional target. Its basically a SWF
target with an
extra bit of post-processing.

Roland

Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by Om <bi...@gmail.com>.
David, from your pdf (yeah, I read it ;-) )

"To facilitate supporting multiple targets, Goshawk will not generate SWC
library files as
they can only be used by a compiler targetting SWFs. Instead, the
language-agnostic parsetree
generated by the ANTLR front-end will be used as a library file format.
This may be
stored in XML, JSON on binary format subject to future experimentation on
the best storage
form."

This sounds like a serious limitation - especially for Flex based library
projects which is a pretty important feature.  Can you please elaborate on
the workaround you hinted in your doc?

Thanks,
Om

On Thu, Feb 16, 2012 at 12:04 PM, David Arno <da...@davidarno.org> wrote:

> On Thu, 2012-02-16 at 20:48 +0100, Roland Zwaga wrote:
> > not to throw a spanner in the works immediately but I was wondering if
> you
> > could
> > consider a different parser from ANTLR. There is a project called
> > Goldparser:
> > http://goldparser.org/
> > From what I understand this thing is the fastest on the block, faster
> than
> > ANTLR,
> > but I also admit that I haven't got real first-hand experience with it.
>
> Sounds fine to me Roland. To be honest, I've only ever seriously used
> lex and yacc, to generate C-based compilers, back in the day. I picked
> ANTLR because a couple of people suggested it, rather than because of
> any knowledge of it.
>
> I'll take a look at goldparser too therefore.
>
> David.
>
>

Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by David Arno <da...@davidarno.org>.
On Thu, 2012-02-16 at 20:48 +0100, Roland Zwaga wrote:
> not to throw a spanner in the works immediately but I was wondering if you
> could
> consider a different parser from ANTLR. There is a project called
> Goldparser:
> http://goldparser.org/
> From what I understand this thing is the fastest on the block, faster than
> ANTLR,
> but I also admit that I haven't got real first-hand experience with it. 

Sounds fine to me Roland. To be honest, I've only ever seriously used
lex and yacc, to generate C-based compilers, back in the day. I picked
ANTLR because a couple of people suggested it, rather than because of
any knowledge of it.

I'll take a look at goldparser too therefore.

David.


Re: Project Goshawk [was Time for an Apache Flex compiler.]

Posted by Roland Zwaga <ro...@stackandheap.com>.
>
> As there was some positive feedback to the idea of creating our own
> compiler, I have gone ahead and started a new project on Github and
> created an initial design document on how I think it might work. I've
> taken the liberty of giving it the code name "Goshawk." If you are
> curious as to why, google for details on animals that predate upon
> falcons ;)
>
> You can take a read up on my ideas so far at
> https://github.com/DavidArno/Goshawk/blob/master/documents/Goshawk
> compiler initial ideas.pdf?raw=true (shortform: http://is.gd/94rcIb)
>
> the project is https://github.com/DavidArno/Goshawk should you feel the
> urge to fork it and help out.
>

Hi David,

not to throw a spanner in the works immediately but I was wondering if you
could
consider a different parser from ANTLR. There is a project called
Goldparser:
http://goldparser.org/
>From what I understand this thing is the fastest on the block, faster than
ANTLR,
but I also admit that I haven't got real first-hand experience with it. I
played around
with the C# port for a while when I had the insane idea to try and build an
AS3 compiler
in C#. Too bad up until now I still don't seem to get my head around
building a decent
grammar for a language ;(
At one time there was even an AS3 port of Goldparser, but I can't seem to
find the link
anymore. But that isn't relevant for this instance anyways.
I'll go and check out your github project some more now ;)

cheers,

Roland