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 DF7FFD3A4 for ; Wed, 28 Nov 2012 21:35:38 +0000 (UTC) Received: (qmail 21819 invoked by uid 500); 28 Nov 2012 21:35:38 -0000 Delivered-To: apmail-incubator-flex-dev-archive@incubator.apache.org Received: (qmail 21775 invoked by uid 500); 28 Nov 2012 21:35:38 -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 21766 invoked by uid 99); 28 Nov 2012 21:35:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Nov 2012 21:35:38 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=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.215.175 as permitted sender) Received: from [209.85.215.175] (HELO mail-ea0-f175.google.com) (209.85.215.175) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Nov 2012 21:35:30 +0000 Received: by mail-ea0-f175.google.com with SMTP id h11so5351628eaa.6 for ; Wed, 28 Nov 2012 13:35:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=64BAn/lqBEBG81NW7TSWjQqDVcYhX+hes1Ls6ePWsK8=; b=eRnQArEDrnApHl5tpV7+ZNzviQ9pDjDfthaCRIeoxVabhba7JUUNjaQF4RVnSwtwec 5ozlF3D1ZXPXisSxOfPzi+fzY0MXfXaj+KrgN/0UMI92iSs3lUNwWcG8meCxKm3E1hH2 6Y7KtTjsNJb+zSKhaSydTPtQTPwXZJre5UTB8WXhNbD5z9U2+AD0pDjT0td5s9Q+KmiX 8lgKtBelOPFNnpBUhMmJzeHvESDQrgJHAf3iC6KIWaOz8sOH3+zj6YCG8j3MRhF0twgs 8QeHSzz/vwYntcWyzWnKzz9pIUIuFX1KH7BfsOl9o3bfjvMSX1sAWjTjstm7pQjrMeAP XQ1w== Received: by 10.14.223.135 with SMTP id v7mr74195391eep.41.1354138509647; Wed, 28 Nov 2012 13:35:09 -0800 (PST) Received: from [127.0.0.1] (cpc2-slam5-2-0-cust350.2-4.cable.virginmedia.com. [81.106.109.95]) by mx.google.com with ESMTPS id k2sm49630613eep.15.2012.11.28.13.35.07 (version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 13:35:08 -0800 (PST) Message-ID: <50B68391.3020500@gmail.com> Date: Wed, 28 Nov 2012 21:35:13 +0000 From: Daniel Wasilewski User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: flex-dev@incubator.apache.org Subject: Re: [FalconJS] concepts References: <56EB0328-EE13-4EFF-991D-BAC736859CC5@gmx.de> In-Reply-To: <56EB0328-EE13-4EFF-991D-BAC736859CC5@gmx.de> Content-Type: multipart/alternative; boundary="------------060404020307090802020404" X-Virus-Checked: Checked by ClamAV on apache.org --------------060404020307090802020404 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Ok, both test are up to date including HaXe. *Test of creation of this little structure* http://jsperf.com/inheritance-yet-another-test/3 *Test of speed of accession already created objects* http://jsperf.com/inheritance-yet-another-test/4 Which confirms what I have said before, that is a best out there but not the best possible ;) There was also a functionality test for all of them, not unit test really ;) *//Classic* //Just a Java like setters/getters for backward compatibility var instanceA = new MySubSubClassA(); //Having public variable when setter/getter pattern is not needed it shouldn't even be there, but this is just a test instanceA.setName("James"); //instead of using setter we assigned it directly to public variable to see if you can omit setters for public variables instanceA.surname = "Bond"; console.log(instanceA.name); //expected undefined, because it's a private field and not accessible from outside of prototypal chain. It makes it perfect for hiding internals when getter/setter patterns applies. console.log(instanceA.surname); //Bond, because it's public console.log(instanceA.getSurname()); //"my name is Bond", because getter has been overridden in subclass console.log(instanceA.getFullName()); //"James Bond" * **Output* -::constructed --::constructed ---::constructed // to see if all Classes in the chain has been invoked on constructor in the correct order; Passed undefined, as expected, private field not accessible Bond my name is Bond James Bond // All good here * **//adobe.js* I took only essence of it and renamed adobe to mod. *Output * -::constructed --::constructed ---::constructed //super figured out, all good James - it shouldn't be here! safety of module pattern fails ;) It might not be considered as an issue since we don't really care about safety of output. Bond my name is Bond JamesBond *HaXe* Same scenario like for other tests but I need to mention one thing here. *IMPORTANT:* I took just $extend model of HaXe, there is much more going on in the final output, also, I kept the structure on the same level as the Main.hx class to avoid namespace issue. otherwise instead: var instanceC = new MyExExClassC(); var instanceC = new com.apache.flex.MyExExClassC(); not to mention that you have massive bunch of objects represents entire tree of your project like this: var com = com || {} if(!com.apache) com.apache = {} if(!com.apache.flex) com.apache.flex = {} com.apache.flex.MyClassC = function() { }; com.apache.flex.MyClassC.__name__ = true; com.apache.flex.MyClassC.prototype = { setSurname: function(value) { this.surname = value; } ,getSurname: function() { return this.surname; } ,setName: function(value) { this.name = value; } ,getName: function() { return this.name; } ,__class__: com.apache.flex.MyClassC } That will slow down both test and I am sure adobe.js is the winner in this situation. This very little thing destroys performance of everything. JavaScript is a shallow water friendly more than anything else. And this very test does not represents real world example unless you crazy enough and keep your all classes next to Main.hx a t all time :) *Output* ---::constructed --::constructed -::constructed Reverse order of instantiation..!? interesting James - same issue aka adobe'js. It might not be considered as an issue since we don't really care about safety of output. Bond my name is Bond James Bond this part is correct So, please tell me why not to go the classic route as a very little overhaul for the application that can be built on top of AS3/Flex? This is bloody 3 classes with 4 methods in it, and we are not talking here about few % but tens. It can only grow exponentially to the scale of your project. Dan On 11/28/2012 8:26 PM, Markus Gritsch wrote: > Hi everyone, > > Maybe someone can clarify the difference between haxe`s - as3-2-js output target and falcon-js. Both are producing js code. Haxe supports a collection of multiple output formats, too. Maybe the solution everyone is talking about is already out there - have??? > > Thanks for your input > > > > On Nov 28, 2012, at 9:04 PM, Alex Harui wrote: > >> On 11/28/12 12:01 PM, "Daniel Wasilewski" wrote: >> >>> Ok will try again by changing a subject because you seems to moved away >>> from original topic, and I don't want to interrupt :) >>> >>> So far I have a test to compare very simple model of prototypal >>> inheritance and proposed module pattern that seems to be out of falconJS >>> compiler little syntactic sugar. >>> I have minimised this source a bit, there was few more additional fields >>> that I guess something is depends on but even striping it out: >>> >>> http://jsperf.com/inheritance-yet-another-test/3 >>> >>> If you go to the revision 2 of this test, there will be different >>> comparison. >>> http://jsperf.com/inheritance-yet-another-test/3 >>> Speed of accession of those objects. >>> >>> However I would like to improve it, because adobe.js implementation >>> doesn't seems to call super as the classic does. >>> So it might be not relevant test right now. Does anybody know how to >>> call super from there? >> It looks like in adobe.js around line 61 it tests to see if the super class >> has the function and creates a _super function you can call. >> >> >> -- >> Alex Harui >> Flex SDK Team >> Adobe Systems, Inc. >> http://blogs.adobe.com/aharui >> --------------060404020307090802020404--