Jump to content


Logged: Slow Compile. (Previously Classes Are Broken To Uselessness)


20 replies to this topic

#1 s02

    Advanced Member

  • Members
  • PipPipPip
  • 3161 posts
  • Gender:Male
  • Location:Germany

Posted 03 December 2010 - 03:27 AM

Sounds hard, but that's how it is, and the newest (at least not yet publicly reported) problem is that variable members aren't exported correctly.

Only the last variable is exported:
class Foo
{
    public var foo:String = 'foo';
    public var bar:String = 'bar';
    public var baz:String = 'baz';
}

No variables are exported at all:
class Foo
{
    public var foo:String = 'foo';
    public var bar:String = 'bar';
    public var baz:String = 'baz';
    
    public function Foo()
    {
    }
}

and since getters and setters are broken too, and a variation of the Void bug still exists:

class Foo
{
    public function bar():Void
    {
        if(1 != 1)
        {
            return;
        }
    }
}

and not to mention things like the order problem that annoys the hell out of us for more than a year already, i think that classes can be considered as totally broken in SWiSH Max right now - that's a pretty bad start for a new major version if you ask me, and i'm really wondering if this stuff was actually tested at all? Do you do appropriate unit testing?

It would be nice if the scripting part would get a little more attention, seriously, we scripters (ofcourse i cannot speak for everyone, but i think many people would agreee with me on that one) don't really need stuff like the rest parameter or foreach, not only because it's AS2 incompatible "SWiSH Script", but because it doesn't give us much of a benefit at all, we all know about the arguments object and we'are writing x = y[i] in our for loops for years already, what we really need is working code and at least a little bit of real evolution. I mean, while everyone else is going for AS3 and all the new stuff around of it (me too ofcourse), with SWiSH Max we still sit on an incomplete AS2 syntax implementation with no type or interface checks, we must choose between crude scopes and slow code, and the editor, well, it's slow, it doesn't support code completion (people are asking for it since SWiSHmax1!), and it cannot even handle code folding correctly.

I always liked SWiSH Max because of it's straight forward, easy to use interface and outline concept, compared to Flash and others that was enough for some time to overcome it's scripting shortcomings, but as a person that is mostly into scripting i really feel pretty much left out for quite some time now. If this is the direction you want to go with SWiSH Max i'm fine with that, there may be many comprehensible reasons, being it personal preferences, market decisions or whatever, but then please let us know so that we can make a clear cut and move on.

It know that it might not be the right place and/or time, and i really don't want to tread on anyone's toes, but i just had to get that off my chest.

Best
Oliver
www | esb

#2 Roger Onslow

    Advanced Member

  • staff Moderator
  • PipPipPip
  • 11114 posts

Posted 03 December 2010 - 08:41 AM

Thanks for letting us know.

I'm pretty sure the Void bug is fixed .. but perhaps not in a released update as yet .. I'll check on that again
Roger the RED - SWiSH developer

#3 Roger Onslow

    Advanced Member

  • staff Moderator
  • PipPipPip
  • 11114 posts

Posted 03 December 2010 - 10:01 AM

What Max is supposed to be doing is for each

var myProperty = value;

in the class body, is that is should add code equivalent to

this.myProperty = value;

to the constructor

so...
class Foo
{
    public var foo:String = 'foo';
    public var bar:String = 'bar';
    public var baz:String = 'baz';
}
should give you the equivalent of
class Foo
{
    function foo() {
        this.foo = 'foo';
        this.bar = 'bar';
        this.baz = 'baz';
    }
}

Instead, it is incorrectly generating a constructor for each var it finds, and only the last one 'sticks'

ie in your example it is generating the same as
class Foo
{
    function foo() {
        this.foo = 'foo';
    }
    function foo() {
        this.bar = 'bar';
    }
    function foo() {
        this.baz = 'baz';
    }
}

Roger the RED - SWiSH developer

#4 Roger Onslow

    Advanced Member

  • staff Moderator
  • PipPipPip
  • 11114 posts

Posted 03 December 2010 - 05:12 PM

I've fixed all those issues other then the class order (or rather the import order .. that a class definition has to appear in the movie before the point where you do an import on it.)

ie fixed
property initialisation not happening
getters and seters not working
Void not working for a method return type
Roger the RED - SWiSH developer

#5 HughB

    COO

  • Admin
  • PipPipPip
  • 3970 posts

Posted 03 December 2010 - 07:01 PM

Hi Oliver,

Please check your email for a link to a test EXE. Please test the classes issues have been fixed before we make it the next pre-release.

thanks,

Hugh
http://blog.swishzone.com/ ...for cool tutorials, samples and new components

#6 s02

    Advanced Member

  • Members
  • PipPipPip
  • 3161 posts
  • Gender:Male
  • Location:Germany

Posted 03 December 2010 - 08:08 PM

Looks like it's fixed, though i don't have time yet to test it to full extent. However there still seems to be something that (silently) breaks something, one thing thing i've found (not sure whether this existed in the previous two builds too) is that it's not possible anymore to call static methods utilizing static variables, ie something like this:

class Foo
{
	public static function initialize():Boolean
	{
		return true;
	}
	
	public static var initialized:Boolean = Foo.initialize();
}

With SM3 the definitions were exported in the order as they are defined in the source, but now the variable definitions are always placed before the method definitions, so the method call will fail.

Best
Oliver

Edited by s02, 03 December 2010 - 08:09 PM.

www | esb

#7 AlexW

    Advanced Member

  • Members
  • PipPipPip
  • 45 posts

Posted 04 December 2010 - 02:17 AM

HughB, Could you mail me a link to the test exe (If it differs from the last 18th pre-release?).

Have a project I need to test and have working in SM4 before we can upgrade.

cheers.

#8 s02

    Advanced Member

  • Members
  • PipPipPip
  • 3161 posts
  • Gender:Male
  • Location:Germany

Posted 05 December 2010 - 02:35 AM

Another observation, compiling seems to be very slow, compared to SM3 it's something around 1000% slower.

Best
Oliver
www | esb

#9 Roger Onslow

    Advanced Member

  • staff Moderator
  • PipPipPip
  • 11114 posts

Posted 05 December 2010 - 06:48 AM

Do you have an example or two of particularly slow compiling you can send? I know compiling classes may be a bit slower in the new version as it makes several passes thru the code.
Roger the RED - SWiSH developer

#10 Roger Onslow

    Advanced Member

  • staff Moderator
  • PipPipPip
  • 11114 posts

Posted 05 December 2010 - 06:53 AM

View Posts02, on 03 December 2010 - 08:08 PM, said:

one thing thing i've found (not sure whether this existed in the previous two builds too) is that it's not possible anymore to call static methods utilizing static variables

Max makes several passes, so that it does all the non-static methods together (in the order they appear), all the static methods together (in the order they appear), all the static properties (in the order they appear). However, it was doing the static properties before the static methods, so none of the static methods was available. I'll change the order of those passes to make the static properties come last.
Roger the RED - SWiSH developer

#11 s02

    Advanced Member

  • Members
  • PipPipPip
  • 3161 posts
  • Gender:Male
  • Location:Germany

Posted 05 December 2010 - 07:27 AM

View PostRoger Onslow, on 05 December 2010 - 06:48 AM, said:

Do you have an example or two of particularly slow compiling you can send? I know compiling classes may be a bit slower in the new version as it makes several passes thru the code.

Here's a pretty good example, it needs something like 1 second with SM3, and around 10 with SM4: edit: sorry, wrong swi file...

Best
Oliver

Edited by s02, 06 December 2010 - 12:37 AM.

www | esb

#12 s02

    Advanced Member

  • Members
  • PipPipPip
  • 3161 posts
  • Gender:Male
  • Location:Germany

Posted 06 December 2010 - 12:40 AM

Here's the package with the corrected swi:

Best
Oliver
www | esb

#13 s02

    Advanced Member

  • Members
  • PipPipPip
  • 3161 posts
  • Gender:Male
  • Location:Germany

Posted 09 February 2011 - 10:52 PM

Just tried the latest pre-release... compiling is now even slower (on a faster computer btw), takes something around 20 seconds. I even have files that now take nearly 2 minutes to compile, compared to a few seconds with SM3 :wacko:

Best
Oliver
www | esb

#14 Jon Herron

    Advanced Member

  • staff Moderator
  • PipPipPip
  • 1234 posts
  • Gender:Male

Posted 10 February 2011 - 08:38 AM

I have logged an issue: 215961

Jon
For News, tips and tutorials checkout the blog at http://blog.swishzone.com
You can also follow us on Twitter: http://twitter.com/SWiSHzoneDOTcom

#15 s02

    Advanced Member

  • Members
  • PipPipPip
  • 3161 posts
  • Gender:Male
  • Location:Germany

Posted 27 May 2011 - 01:15 AM

So is there anything going to happen anytime soon, or can i throw SM4 in the bin? I know, i sound mean... again... but unfortunately for me SM4 is of no use when it takes +1 minute to compile my stuff.

Best
Oliver
www | esb





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users