Return-Path: X-Original-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 60B36E3E4 for ; Mon, 3 Dec 2012 10:15:46 +0000 (UTC) Received: (qmail 16221 invoked by uid 500); 3 Dec 2012 10:15:45 -0000 Delivered-To: apmail-incubator-flex-dev-archive@incubator.apache.org Received: (qmail 16010 invoked by uid 500); 3 Dec 2012 10:15:45 -0000 Mailing-List: contact flex-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: flex-dev@incubator.apache.org Delivered-To: mailing list flex-dev@incubator.apache.org Received: (qmail 15953 invoked by uid 99); 3 Dec 2012 10:15:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 10:15:43 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FRT_ADOBE2,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of devudesign@gmail.com designates 209.85.220.175 as permitted sender) Received: from [209.85.220.175] (HELO mail-vc0-f175.google.com) (209.85.220.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 10:15:36 +0000 Received: by mail-vc0-f175.google.com with SMTP id fy7so1608986vcb.6 for ; Mon, 03 Dec 2012 02:15:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=m0XUKj89RZ696bxwQR4K8no9/YpmJeyZCQtmsLUPphw=; b=NqdRrQbkROnSU6Re/xDv6xYsgmsa/7PihThOR8KqJMCuYvpybdGfP4DNDJN1XACy/r Q3AD+jkQcryve3JHOblBnT5QYIK1/Ss+c7ub8+QY3hTW1qHH+NzUtfHLJ0AWeHxKr4Tg cNoyNBxzKW0q48wzTG6Wi/iox90jbSJhN2BBdUCYnmwchryiWandX4H+i3U/isYb8oIe pDQnFMPSBG92/67oG8o4kujj+Hkmmhm6CDa6we8z+c5mbaLEIbeKBG+H68H7Rx7w3g62 x/Ye9yosfJ2ia38SGJ13rQaAD9FlpGh45JJzJ2sLrN8gCfTyYpRhvBdBcsl5QTcOlTx/ VOvg== MIME-Version: 1.0 Received: by 10.220.229.133 with SMTP id ji5mr8018903vcb.51.1354529715252; Mon, 03 Dec 2012 02:15:15 -0800 (PST) Received: by 10.220.107.1 with HTTP; Mon, 3 Dec 2012 02:15:15 -0800 (PST) In-Reply-To: <6C977545-ADE9-45B5-B9CA-9E751D218D1D@adobe.com> References: <05AE47C3-E3FA-49ED-ADB8-6F32A8DB8006@adobe.com> <50BBD36C.70606@gmail.com> <20121202173103.33395ir2uh7hv4pz@teotigraphix.com> <50BC01C4.6090409@gmail.com> <6C977545-ADE9-45B5-B9CA-9E751D218D1D@adobe.com> Date: Mon, 3 Dec 2012 10:15:15 +0000 Message-ID: Subject: Re: [FlaconJS] pseudo emitter algorithm From: Daniel Wasilewski To: flex-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=14dae9cdc93d83ed2504cff006ef X-Virus-Checked: Checked by ClamAV on apache.org --14dae9cdc93d83ed2504cff006ef Content-Type: text/plain; charset=ISO-8859-1 OK, my apology, overreacted a bit. Sometimes I just need to shout up and read the thing twice... On 3 December 2012 04:12, Gordon Smith wrote: > My statement was overly broad. All I meant was that the acronym BURM > refers to a tree whose root is at the top. Everyone is free to orient their > trees as they wish. > > Sent from my iPad > > On Dec 2, 2012, at 5:35 PM, "Daniel Wasilewski" > wrote: > > > I do understand differences on conceptual level, but just trying to > > avoid bold statements as arguments that favours one solution over > another. > > Because In computer science on academic level it's all comes down to > > personal preferences of your teacher unfortunately ;) > > > > On 12/2/2012 10:31 PM, Michael Schmalle wrote: > >> I think the point was; > >> > >> - Tree parsers such as the AS3Parser creates a Tree from the parent > >> node down to child aka Recursive Decent Parser. > >> > >> - Tree walkers such as the BURM walk a parse tree from the child nodes > >> up to the parent IE Bottom Up > >> > >> Mike > >> > >> > >> Quoting Daniel Wasilewski : > >> > >>> huh? > >>> > >>> In computer science both conventions are adopted afik. Not reserved, > >>> that someone can say, there is only 1 correct. > >>> Polish notation or reversed polish notation is correct in computer > >>> science? > >>> > >>> On 12/2/2012 8:07 PM, Gordon Smith wrote: > >>>> The bottom-upness of the BURM means that subtrees that are nearer to > >>>> the leaves of the AST get reduced before subtrees that nearer to the > >>>> root. Trees in computer science grow from the top down. > >>>> > >>>> Sent from my iPad > >>>> > >>>> On Nov 30, 2012, at 10:24 PM, "Alex Harui" wrote: > >>>> > >>>>> Interesting. Someday I will figure out what is bottom up about it. > >>>>> > >>>>> Anyway, thanks, and bottoms up! > >>>>> > >>>>> -Alex > >>>>> > >>>>> > >>>>> On 11/30/12 9:48 PM, "Gordon Smith" wrote: > >>>>> > >>>>>> The BURM is the Bottom-Up Rewrite Machine that the BURG or > >>>>>> Bottom-Up Rewrite > >>>>>> Generator generates. A BURM reduces subtrees within an AST to an > >>>>>> output format > >>>>>> such as ABC or JS, starting with leaf nodes and working its way > >>>>>> upward. > >>>>>> > >>>>>> Sent from my iPad > >>>>>> > >>>>>> On Nov 30, 2012, at 8:45 PM, "Alex Harui" wrote: > >>>>>> > >>>>>>> BURM? What does that stand for anyway? It might as well have > >>>>>>> been Burmese. > >>>>>>> It will take a while to understand :-) > >>>>>>> > >>>>>>> > >>>>>>> On 11/30/12 5:36 PM, "Gordon Smith" wrote: > >>>>>>> > >>>>>>>>> I don't know SWF format and JBurg > >>>>>>>> The SWF and ABC formats are irrelevant if you want to generate > >>>>>>>> JS code, so > >>>>>>>> you > >>>>>>>> wouldn't need to learn them. > >>>>>>>> > >>>>>>>> If you don't want to learn about the BURM I suppose you could > >>>>>>>> try generating > >>>>>>>> JS code directly from the AST. I don't know enough about > >>>>>>>> FalconJS to know > >>>>>>>> whether the BURM approach produces more efficient code. > >>>>>>>> Understanding the > >>>>>>>> BURM > >>>>>>>> is not terribly hard, though. There are three main ideas: > >>>>>>>> > >>>>>>>> 1. A BURM pattern like > >>>>>>>> > >>>>>>>> Pattern labeledBreakStmt > >>>>>>>> BreakID(IdentifierID(void)); > >>>>>>>> > >>>>>>>> describes a subtree within the AST; in this case, it is > >>>>>>>> describing the > >>>>>>>> subtree > >>>>>>>> > >>>>>>>> BreakNode > >>>>>>>> IdentifierNode > >>>>>>>> > >>>>>>>> that represents code like "break foo"; > >>>>>>>> > >>>>>>>> 2. A BURM rule like > >>>>>>>> > >>>>>>>> statement = Pattern labeledBreakStmt: 0 > >>>>>>>> JBurg.Reduction reducer.reduce_labeledBreakStmt(__p); > >>>>>>>> > >>>>>>>> tells the BURM what to do when it finds such a subtree: namely, > >>>>>>>> call the > >>>>>>>> Java > >>>>>>>> method reduce_labeledBreakStmt() in the ASGeneratingReducer, > >>>>>>>> which has a > >>>>>>>> slew > >>>>>>>> of "reduce_XXX()" methods for reducing various subtrees. > >>>>>>>> > >>>>>>>> 3. The result of a "reduction" can be any Java object which > somehow > >>>>>>>> represents > >>>>>>>> the subtree that got reduced. Often this is an InstructionList > >>>>>>>> but it can be > >>>>>>>> anything. This Java object can then be used in other patterns to > >>>>>>>> describe > >>>>>>>> more > >>>>>>>> general or recursive patterns, as in > >>>>>>>> > >>>>>>>> Pattern blockStmt > >>>>>>>> BlockID(statement stmts*); > >>>>>>>> > >>>>>>>> For example, this says that a block statement is a BlockNode > >>>>>>>> with multiple > >>>>>>>> child nodes which have been reduced to a 'statement'. > >>>>>>>> > >>>>>>>> The BURM patterns and rules should be mostly the same whether > >>>>>>>> you are > >>>>>>>> generating ABC or JS, because they depend on the AS node > >>>>>>>> patterns that are > >>>>>>>> being noticed and reduced. So I really think you'd be doing most > >>>>>>>> of your > >>>>>>>> work > >>>>>>>> inside the JSGeneratingReducer. I believe this was Bernd's > >>>>>>>> approach when he > >>>>>>>> developed FalconJS. You just make the reduce_XXX() method > >>>>>>>> produce JS strings > >>>>>>>> rather than ABC InstructionLists. > >>>>>>>> > >>>>>>>> - Gordon > >>>>>>>> > >>>>>>>> -----Original Message----- > >>>>>>>> From: Michael Schmalle [mailto:apache@teotigraphix.com] > >>>>>>>> Sent: Friday, November 30, 2012 4:11 PM > >>>>>>>> To: flex-dev@incubator.apache.org > >>>>>>>> Subject: RE: [FlaconJS] pseudo emitter algorithm > >>>>>>>> > >>>>>>>> Quoting Gordon Smith : > >>>>>>>> > >>>>>>>>> I didn't follow the whole discussion. Is the issue that you were > >>>>>>>>> planning to work on MXML->JS but Alex and I think > >>>>>>>>> MXML->datastructure is a better approach? You don't have to > accept > >>>>>>>>> what we say. :) > >>>>>>>>> > >>>>>>>>> - Gordon > >>>>>>>> The conversation was about exploring a straight AST to JS > convertor > >>>>>>>> and bypassing the JS emitting using SWF reducer. > >>>>>>>> > >>>>>>>> My point was in the discussion that I don't know SWF format and > >>>>>>>> JBurg > >>>>>>>> so trying to maintain FalconJS in it's current state would be > >>>>>>>> hard for > >>>>>>>> a lot of developers. > >>>>>>>> > >>>>>>>> A lot of cross compilers just work with the straight AST in our > >>>>>>>> case > >>>>>>>> the IASNode or IDefinition frameworks. > >>>>>>>> > >>>>>>>> I also thought having this ability would allow other targets to be > >>>>>>>> implemented more quickly IE Java android or something... > >>>>>>>> > >>>>>>>> What do you think? > >>>>>>>> > >>>>>>>> > >>>>>>>>> -----Original Message----- > >>>>>>>>> From: Michael Schmalle [mailto:apache@teotigraphix.com] > >>>>>>>>> Sent: Friday, November 30, 2012 3:55 PM > >>>>>>>>> To: flex-dev@incubator.apache.org > >>>>>>>>> Subject: RE: [FlaconJS] pseudo emitter algorithm > >>>>>>>>> > >>>>>>>>> Well considering the conversation between you two, I will ditch > >>>>>>>>> pretty much all I said in the last 3 days. This is what I get for > >>>>>>>>> living on a mountain... > >>>>>>>>> > >>>>>>>>> I have interest in the non-flash player stuff, so I guess I will > >>>>>>>>> keep up with your conversations. > >>>>>>>>> > >>>>>>>>> For now, I will focus on testing the compiler and trying to get > >>>>>>>>> in a > >>>>>>>>> groove somehow dealing with that. I'm going to try and document > >>>>>>>>> more > >>>>>>>>> of the compiler on the wiki. Gordon feel free the correct me if > >>>>>>>>> I'm > >>>>>>>>> wrong in places. > >>>>>>>>> > >>>>>>>>> And, I will try to really understand Alex's prototype and see if > I > >>>>>>>>> can get my brain wrapped around that to help with some simple > test > >>>>>>>>> components. > >>>>>>>>> > >>>>>>>>> Mike > >>>>>>>>> > >>>>>>>>> Quoting Gordon Smith : > >>>>>>>>> > >>>>>>>>>> That sounds fine. We'll work in parallel: > >>>>>>>>>> > >>>>>>>>>> Me: MXML->ABC > >>>>>>>>>> You: MXML->datastructure, first for use in AS/ABC, then for > >>>>>>>>>> use in JS > >>>>>>>>>> > >>>>>>>>>> - Gordon > >>>>>>>>>> > >>>>>>>>>> -----Original Message----- > >>>>>>>>>> From: Alex Harui [mailto:aharui@adobe.com] > >>>>>>>>>> Sent: Friday, November 30, 2012 3:29 PM > >>>>>>>>>> To: flex-dev@incubator.apache.org > >>>>>>>>>> Subject: Re: [FlaconJS] pseudo emitter algorithm > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> On 11/30/12 3:22 PM, "Gordon Smith" wrote: > >>>>>>>>>> > >>>>>>>>>>> MXML->JS doesn't exist and is not the way to go. > >>>>>>>>>>> MXML->datastructure is a good idea. Alex will do it first for > >>>>>>>>>>> MXML->interpretation > >>>>>>>>>>> by JS and later for interpretation by an ABC library written > >>>>>>>>>>> in AS. > >>>>>>>>>> I'm pretty sure I had this all working last year in AS. I > >>>>>>>>>> just have > >>>>>>>>>> to dust it off. Right now it is easier/faster for me to debug > >>>>>>>>>> in AS, > >>>>>>>>>> so I will probably do the AS version first, but I will be > >>>>>>>>>> keeping all > >>>>>>>>>> of the old ABC code paths around. Right now there is some > >>>>>>>>>> global flag > >>>>>>>>>> that determines which code paths to go down. I might tie that > >>>>>>>>>> to some > >>>>>>>>>> new property in flex-config.xml or something like that. > >>>>>>>>>> > >>>>>>>>>> -- > >>>>>>>>>> Alex Harui > >>>>>>>>>> Flex SDK Team > >>>>>>>>>> Adobe Systems, Inc. > >>>>>>>>>> http://blogs.adobe.com/aharui > >>>>>>>>> -- > >>>>>>>>> Michael Schmalle - Teoti Graphix, LLC > >>>>>>>>> http://www.teotigraphix.com > >>>>>>>>> http://blog.teotigraphix.com > >>>>>>> -- > >>>>>>> Alex Harui > >>>>>>> Flex SDK Team > >>>>>>> Adobe Systems, Inc. > >>>>>>> http://blogs.adobe.com/aharui > >>>>> -- > >>>>> Alex Harui > >>>>> Flex SDK Team > >>>>> Adobe Systems, Inc. > >>>>> http://blogs.adobe.com/aharui > > > --14dae9cdc93d83ed2504cff006ef--