> The swf9/10 back-end walks the AST transforming the "js2" to as3 and
> unparses it. That unparser knows the rules about splitting classes
> into files for the flex compiler.
This is where I am a bit confused.
What does it mean that as3 files need to be unparsed to files for the
flex compiler?
Anyway I think we should modularize laszlo more in the future.
I do think that all the compilation steps are very useful at the moment.
1) xml (lzx) ->
2) js2 (lzs) ->
3) runtime specific language (dthml-js1.5, as2, as3 ...) ->
4) optimized version of the runtime language (compressed js file or swf
file)
According to you swf8 skips step 3 (or rather it's step 3 language is
already in binary format that the peephole optimizer then optimizes.
But in the future when swf8 is dropped this model holds.
So what do I mean with modularization...
1) Step 2 language should be formalized. So much so that one could
develop with step 2 language only and skip step 1 language if he so
pleases. Or he could develop parts in step 1 language, compile them to
step 2 language, continue developing in it some more and then proceed to
further levels.
2) Level 3 languages are already formalized and documented by the
parties that make and maintain the runtimes. But laszlo compiler should
be able to compile stage 2 language to stage 3 language that is human
readable and maintains the componentization of the stage 2 (and stage 1)
3) This way one could develop his application, compile it to as3, take
it then to some flex dev environment, develop it some more and use stage
4 compiler to create the executable.
Now the stage 2 language would be the real laszlo language lzs-js2.
Laszlo XML would be a higher level language that can be translated to
lzs-js2. Components are developed using either one of the languages.
Services and apis are defined in lzs-js2 because there are no method
calls in pure xml are there?
So laszlo xml would be like a useful tool on top of lzs-js2 just like
there are libraries in java who take xml gui definitions and translated
them in to java swing code.
There used to be some discussion between withington and jamesr what is
ment by "userspace" (and I quess the counterpart is kernelspace).
I would say that the userspace is the lzs-js2 language and the apis it
provides. Everything else is the implementation. Stuff that may change
without others knowing as long as it keeps up the promise made by the
language and it's api's.
I don't really mean that someone would develop the same application on
more than one level. But one could develop separate libraries on all 3
levels. And one might debug the same application on all 3 levels
(actually on all 4 levels.)
This fantasy was caused by fantasies about developing everything in
javascript (a dream that sounds rather alien and awkward to my ears :)
- rami