Recognising tokens will probably be reasonably fast, but building an 
'abstract syntax tree' from the results is something which would require 
a whole bunch of nested objects, which might turn out to be quite slow. 
And that's only the first step: we'd also have to analyse the AST and 
build the bytecode.

A while back I've written some code to do parser combinators in Flash - 
and that was where I ran into the 'too much levels of recursion' issue. 
It uses partial evaluation, a technique that's core to functional 
languages. More on that is here: 
http://www.vanrijkom.org/archives/2005/06/partial_evaluat.html#comments. 
In short, when doing partial evaluation, high levels of recursion are 
easily formed. So, we probably won't be able to use that technique.

Another thing to fear is the dreaded "A script in this movie is causing 
Flash Player to run slowly" alert. To circumvent that, the whole process 
should be able to work on a event pulse, which limits architecture 
options even further and will decrease speed (since it's unpredictable 
how much processing one can do before getting the time-out).

So.. with lots of creativity, a working system should be feasible, but 
it will never be fast. But - it would net a compiler written by the 
community, for the community, which was the desire I was reading in 
between the lines of this thread.

Cheers,
Edwin


Mark Winterhalder wrote:

>>Last, I've been thinking that it should actually be possible to create
>>an AS3 compiler in AS3 (Regular Expressions, ByteArrays etc). Although
>>performance would probably be awfull and one might run into "too many
>>levels of recursion" troubles, it would enable a lot of people from this
>>community to contribute.
>>    
>>
>
>I have been thinking the same thing, for the same reason -- easier to
>contribute for its potential users. Also, it would be nice if AS3
>could break the "compiler that can compile itself" barrier. I don't
>think recursion would be a problem, it's set to 1000 by default and we
>can easily change that.
>However, integrating it with IDEs would be a hack, and performance
>could be a problem as you said. But maybe it wouldn't be too bad? The
>regular expressions are (hopefully) not implemented in AS, so parsing
>the code might be pretty fast. However, I don't know what a compiler
>takes the most time for, how fast/slow AS3 actually is, or anything
>about compilers for that matter...
>
>mark
>
>
>On 10/25/05, Edwin van Rijkom <[EMAIL PROTECTED]> wrote:
>  
>
>>I've been folowing this thread with great interest. Some thoughts I'd
>>like to share on the subject:
>>
>>I think functional languages are superior for compiler construction,
>>simply by design. Nicolas knows what he is talking about and I deeply
>>respect his work on MTASC and Neko. I don't really care how he makes his
>>thoughts known, as long as he continues to do so (and doesn't harm any
>>animals during the process)
>>
>>A compiler in a different language could still work well, but it will be
>>a lot more work.
>>
>>I've got some AS2 compiler code to share, but it's in Haskell and it's
>>only half finished - so I don't know if its of any interest.
>>
>>Last, I've been thinking that it should actually be possible to create
>>an AS3 compiler in AS3 (Regular Expressions, ByteArrays etc). Although
>>performance would probably be awfull and one might run into "too many
>>levels of recursion" troubles, it would enable a lot of people from this
>>community to contribute.
>>
>>Just my 2 euro-cents.
>>
>>Cheers,
>>Edwin
>>    
>>
>
>--
>http://snafoo.org/
>jabber: [EMAIL PROTECTED]
>
>_______________________________________________
>osflash mailing list
>[email protected]
>http://osflash.org/mailman/listinfo/osflash_osflash.org
>
>
>
>
>  
>


_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to