On 5/17/15, 11:48 AM, "Josh Tynjala" <joshtynj...@gmail.com> wrote:

>The Falcon codebase certainly looks like it is organized better. However,
>I'm basically done with the hard part of modifying the older compiler, so
>if I were to switch to Falcon, I'd be doing everything all over again (and
>I'd be doing it without funding this time).
>
>One thing that made things easier (for me) in the older compiler was being
>able to edit the *.vm files used for code generation. I'd rather work with
>something that resembles ActionScript than have to manually write/edit
>code
>like this (from Falcon):
>
>MethodInfo mi = new MethodInfo();
>mi.setMethodName(propName.getBaseName());
>
>mi.setReturnType(propType);
>
>InstructionList insns = new InstructionList(3);
>insns.addInstruction(OP_getlocal0);
>insns.addInstruction(OP_getproperty, backingName);
>insns.addInstruction(OP_returnvalue);
>
>I'm sure I could figure it out, if I had to, but thankfully, I didn't.

Actually, what I’ve been doing in Falcon is compiling MXML, CSS and
Binding into data, not code.  The bootstrapping code in FlexJS (and any
other component set) can then interpret the data and create children,
styles and set up data bindings however they see fit.

This has the following advantages:
- No framework dependencies are hard coded into the compiler
- No AS code is generated by the compiler that needs to be reviewed via
-keep-generated-actionscript
- AS developers can fix bugs and change the way MXML, CSS and Binding work
without knowing how to build the compiler

The MXML encoding is basically: “here’s a tag followed by its properties,
styles and events”.  CSS encoding is essentially: “here’s a selector and
here are its properties” and Binding is roughly: Here is the dot-path
expression to the source, the dot-path expression to the destination and
the related change events.

So, if you ever get tired of fiddling with .vm files, you’re welcome to
test-drive the way Falcon does it. In theory, it generates the right data
already, and you can borrow AS and JS code from FlexJS to generated a tree
of components, a list of style selectors, and a set of data-bindings.

-Alex

Reply via email to