Return-Path: X-Original-To: apmail-flex-dev-archive@www.apache.org Delivered-To: apmail-flex-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 59088E60B for ; Tue, 5 Feb 2013 14:11:40 +0000 (UTC) Received: (qmail 6654 invoked by uid 500); 5 Feb 2013 14:11:39 -0000 Delivered-To: apmail-flex-dev-archive@flex.apache.org Received: (qmail 6631 invoked by uid 500); 5 Feb 2013 14:11:39 -0000 Mailing-List: contact dev-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list dev@flex.apache.org Received: (qmail 6616 invoked by uid 99); 5 Feb 2013 14:11:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Feb 2013 14:11:39 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [69.167.147.50] (HELO franklin.liquidweb.com) (69.167.147.50) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Feb 2013 14:11:33 +0000 Received: from localhost ([127.0.0.1]:35195) by franklin.liquidweb.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80) (envelope-from ) id 1U2jEr-00039O-Tu for dev@flex.apache.org; Tue, 05 Feb 2013 09:11:09 -0500 Received: from 70.16.215.199 ([70.16.215.199]) by franklin.liquidweb.com (Horde Framework) with HTTP; Tue, 05 Feb 2013 09:11:09 -0500 Message-ID: <20130205091109.17385ggamo7eh2wt@franklin.liquidweb.com> Date: Tue, 05 Feb 2013 09:11:09 -0500 From: Michael Schmalle To: dev@flex.apache.org Subject: Re: [FalconJx] AMD implementation References: <20130204042641.15004l0fwftpa3td@franklin.liquidweb.com> <20130204044135.17868ron53akk1u7@franklin.liquidweb.com> <20130204065619.66056hgwnlvn650j@franklin.liquidweb.com> <20130204092151.12522c2gib3oxpmn@franklin.liquidweb.com> <20130204114601.108719mqfcy7u5e1@franklin.liquidweb.com> <20130204123757.92712xyjm0p90tf9@franklin.liquidweb.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.8) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - franklin.liquidweb.com X-AntiAbuse: Original Domain - flex.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - teotigraphix.com X-Get-Message-Sender-Via: franklin.liquidweb.com: authenticated_id: teotigra/from_h X-Source: X-Source-Args: X-Source-Dir: X-Virus-Checked: Checked by ClamAV on apache.org Quoting Frank Wienberg : > Okay, I just pushed to the as-js-runtime-prototype repository (I just > noticed I didn't update the Github pages yet, so please do not use the > online version but pull). Ok, I know git pretty well but, this makes no sense to me, what does "but pull" mean when I see no updated source code? I mainly understand what you have written below, will use it for reference. Also, I did look at AS3.js yesterday so I understand what you are doing with that. Mike > All JavaScript files are updated to the latest and greatest code layout. > Because now I know you'll notice every detail, anyway, I rather tell you in > advance there are still some minor differences between the Wiki page and > the example code: > > - To get the code to define a class more concise (avoid having to > write/generate Object.defineProperties(...) over and over), I introduced > utility functions in the AS3 library. They don't do any great magic, after > all, AS3.js is less than 200 lines of code. > - AS3.compilationUnit($exports, function($primaryDeclaration){ ... }) > -- helps defining a compilation unit with "lazy static code > execution", as > discussed on the Wiki page. You have to hand in the $exports > object that > defines the module output, and compilationUnit() takes care of > defining the > "_" property. The second argument is a function that contains > the actual > compilation unit code and receives a callback > function $primaryDeclaration() to use for handing the module > value (= the > primary declaration) back to compilationUnit(). Yes, sounds > complicated, > but believe me, especially when dealing with static cyclic references > between compilation unit, the order in which all this happens > is crucial > and this is the way it works best and leads to the smallest > client code. > - AS3.class_({ /* class declaration */ }) -- a helper to use a more > concise, declarative definition of the package, name, members, > and static > members of a class. For example, the standard case of a method > or any other > read-only, non-enumerable, non-configurable property that, for > Object.defineProperty() has to be specified as { value: foo } can be > abbreviated to just foo. > - AS3.interface_({ /* interface declaration */ }) -- > the analogous helper for an interface. As interfaces do not contain any > executable code, this is *not* wrapped inside an > AS3.compilationUnit() (see > Wiki page). > - AS3 also provides the built-in operators "as" and "is" as well as > the helpers for casts ("cast") and method binding ("bind"). > - In contrast to the Wiki page, private non-static methods are not yet > converted to private static methods and called via method.call(this, > arguments...). Instead, like private non-static fields, they are renamed > using $ (e.g. in class A: secret$1). This makes code > generation a bit easier, as this pattern has to be implemented for private > non-static fields and bound methods, anyway. The conversion to > static leads > to better optimization results, so we should add it later. > - The Wiki page does not yet discuss super method calls. Class B > contains an example, method "foo": the super method is "backed up" using > the private-name-pattern, here "foo$2", by assigning "super$.foo", so in > "foo", "super.foo(x + 2)" is translated to "this.foo$2(x + 2)". Like > private non-static methods, this could be optimized to a local variable > "var super$foo = super$.foo" and the translation "super$.foo.call(this, x > +2)" later. > - I completely left out the commented ActionScript source line numbers > in the JavaScript code for now. You got the idea; if you feel like it, you > can of course add them in. > > Well, this is all that comes to my mind now. If you find more unclear > aspects (either on the Wiki page or in the code), please let me know and > I'll do my best to resolve them. > If there is anything that is not straight-forward to generate with > FalconJx, also please let me know and we'll surely find a simpler way to > have a "spike" solution soon! > > Greetings > -Frank- > -- Michael Schmalle - Teoti Graphix, LLC http://www.teotigraphix.com http://blog.teotigraphix.com