Note: this post still seems to get lots of hits, and I do get a lot of requests for the old C# parser source as well. The xamlon project is now rotting on some backup disks somewhere : ). There is a new (free) C# parser if that is what brought you here you can read about it here . Not planning to go to swf with it, but feel free... Also, there is NeoSwiff if you are looking for C# to swf, from all I have heard it is an awesome product. Back to the old no longer relevant post...

We are now at beta 1 for our swf product, available for trial download at http://www.xamlon.com/downloads. While still a beta, I feel it is really starting to come together...

I do of course way prefer C# and Visual Studio type environments for programming, I must say it is nice to get that swf popping up again at the end of a compile cycle... It is like a tasty candy after a good meal. We are now at the point where we can start making real applications, so I'm very exciting to be working on swfs again -- esp with the type saftey and intellisense, whew!

Beta 1 has two areas we are focusing on - the code and graphics. Components will be built on top of this, so that will logically be the next step.

For those who aren't following this, our code section now runs by parsing IL assemblies directly, which means you can program in virutally any language. The graphics are xaml - very svg like at the low level, and quite xul like at the higher level, though there is much more in the details of course. I will be posting more about this over the week, but here is a quick sample to give you an idea.. The app.xaml file makes a rectangle that can be accessed from code:


<?xml version="1.0"?>
<Canvas id=myCanvas Background="DarkBlue" Height="600" Width="700">
  <Canvas id="myRect" Height="100" Width="100">
    <Rectangle
      RectangleWidth="100" RectangleHeight="100"
      Fill="DarkRed" Stroke="Yellow" StrokeThickness="2" />
  </Canvas >
</Canvas >

 And the C# app.cs file finds and rotates it:

public class Class1
{
  public static void Main()
  {
    MovieClip mc = MovieClip.Root.GetInstance("myCanvas.myRect1");
    mc.Rotation = 30;
  }
}

 Compile with:

 cswf /xaml:app.xaml /r:SwfNative.dll /launch app.cs

Oh the possibilities : ). I would really encourage you to download it and have a look, even in this early beta stage -- programming swfs is just so much fun in a good environment with a good IDE!

posted on Wednesday, January 19, 2005 4:32 PM
Feedback
  • # RE: Xamlon Flash Beta Released!
    Bertrand Le Roy
    Posted @ 1/19/2005 5:19 PM
    This is pretty amazing stuff! Congratulations!
    It looks like magic to me. I simply don't understand how you can transform IL into swf. What about the .NET class library?

  • # RE: Xamlon Flash Beta Released!
    darron
    Posted @ 1/19/2005 6:07 PM
    1 word - f'in-awesome.

  • # Will's Blog - My.Thoughts == My.World &raquo; 2005 &raquo; January &raquo; 20
    Pingback/TrackBack
    Posted @ 1/20/2005 6:28 AM
    Will's Blog - My.Thoughts == My.World &raquo; 2005 &raquo; January &raquo; 20

  • # Will's Blog - My.Thoughts == My.World &raquo; 2005 &raquo; January &raquo; 20
    Pingback/TrackBack
    Posted @ 1/20/2005 6:31 AM
    Will's Blog - My.Thoughts == My.World &raquo; 2005 &raquo; January &raquo; 20

  • # RE: Xamlon Flash Beta Released!
    Philippe
    Posted @ 1/20/2005 6:47 AM
    Does it work in the SharpDevelop IDE ?

  • # RE: Xamlon Flash Beta Released!
    Robin Debreuil
    Posted @ 1/20/2005 7:42 AM
    Hey Bertrand,

    No Magic really -- well, other than what Kevin Lindsey used to parse the IL... Not sure what kind of deal he needed to make to get those skills, but I would sign up in a minute :).

    Converting that structure to swf started off being easier than coming from C#, because IL is so well attributed already, and they both are basically stack machines. However as always it seems there ended up being some issues. Things like swf reverses the args, but IL is already at a low enough level that the args are hard to separate from further up the stack. Also inlined value type array decls were very weird... Nothing insurmountable, but not as easy as I would have liked too. man though, IL is a beautiful thing. I really think it doesn't get the light it deserves. It is probably the first/best/most sucessful implementation of a xlanguage bytecode abstraction -- no small feat! Hats off all around there.

    As for the libraries (as you know) a valid .Net language only needs to support the Base Class Libs, which are still pretty large, but at least not the framework. A lot of these don't really apply to swfs though, like threading stuff for example, so some of it is just a matter of making sure you swallow it properly. We don't have 100% of the BCLs in yet, but the most common stuff at least.

    For the rest of the framework, one of our goals is to be able to write (in a restricted subset) one xaml and one assembly, and run that on the Flash Player, in Avalon/.net, and on the compact framework. So over the next weeks and months we will be adding support for some of the framework for sure. Also a lot of the higher level xaml elements require framework support too. At the low level we want to be sure that nothing ends up in the swf that doesn't need to be (due to size), but the good news for us in we can now add that framework support using C# rather than manually adding bytecode.


  • # RE: Xamlon Flash Beta Released!
    Robin Debreuil
    Posted @ 1/20/2005 7:47 AM
    Hey Philippe,

    Yes, at its heart the interface is a command line compiler, so basically it can be automated in any IDE with a higher level than notepad. That being said, we totally love SharpDevelop, and in fact are working on a specific xaml/C# editor for our products very much tailored to it.

    It has been inspiring to watch it develop over the years, that is for sure...

  • # RE: Xamlon Flash Beta Released!
    Philippe
    Posted @ 1/20/2005 3:18 PM
    Well, for me it is just overkill to use the full Visual Studio IDE to end up with SWFs.
    That said, i'd love to simply code in JScript...

    Wouldn't it be possible to write directly:
    myCanvas.myRect1.Rotation = 30;
    I think it should be possible using your specific IDE or command line compiler.


  • # RE: Xamlon Flash Beta Released!
    Bertrand Le Roy
    Posted @ 1/20/2005 4:04 PM
    Awesome! This is no small achievement. I mean, reproducing a large part of the BCL in swf, that's totally incredible given the time it took you to develop. It's like doing Mono in a few months...

  • # RE: Xamlon Flash Beta Released!
    Robin Debreuil
    Posted @ 1/20/2005 4:45 PM
    re: myCanvas.myRect1.Rotation = 30;

    We are certainly talking about this, our hurdle is that the C# has to compile without having partial classes available. Also it is most useful if you still get intellisense and all the good stuff. If we control the IDE we can do this pretty easily, and if it was C#2.0 with partial classes, again very doable. Just if someone is using say notepad, we need to intercept the C# before it hits the compiler and add the properties that otherwise would make it impossible to compile.

    I think our direction is to compile the xaml, and the xaml refs the code (the dll). From this we can find the original C# files, check if they need to be compiled, and maybe munge in some extra code before sending that to csc. in the general case I think that isn't too bad, but I bet there are some edge cases that will take a while to sort out..

    Perfect world though, you are absolutely right, the code should just 'know' about the xaml.

    Btw, you can code in JScript now, just our beta compiler is only taking cs files. What you would need to do is just grab the part that takes an assembly and pass it the jScript assembly. We will turn that on for the next beta I'm sure (likely the assembly will just be marked in the xaml, in which case it doesn't know or care what language made it).

    I agree VS seems overkill for swfs, although we hope this will enable developing much more scalable and versionable swfs... Maybe then all those great little features will seem a better fit : ).

  • # T!M &raquo; XAML Blog
    Pingback/TrackBack
    Posted @ 1/20/2005 11:35 PM
    T!M &raquo; XAML Blog

  • # RE: Xamlon Flash Beta Released!
    Philippe
    Posted @ 1/21/2005 4:11 AM
    > the code should just 'know' about the xaml.

    I perfectly understand the problem with the current VS IDE and the need compile the xaml for the csc.

    But when MS will ship VS for XAML, this will just work. Like when you simply use Windows.Forms.
    I believe that MS will make it work on older versions of Windows. Then what will be the position of Xamlon?


  • # RE: Xamlon Flash Beta Released!
    Robin Debreuil
    Posted @ 1/21/2005 1:29 PM
    I suspect that VS for xaml will require C#2 though, because without partial class support I think it comes to pretty crude workarounds to munge things together. It will work on old versions of windows, but probably not on .Net 1.1 -- I could be wrong of course : ).

    We may end up moving to .Net 2.0 by that point too, but in the meantime we will try to get a reasonable system going. It probably won't be as seemless as partial classes though, but we'll see what we can do. Maybe the xaml compiles to a subclass or something, not sure. And opinions you have on how you would like to see it happen would be most welcome too : )

  • # Week in review
    Andrew Stopford's Weblog
    Posted @ 1/21/2005 3:30 PM


  • # RE: Xamlon Flash Beta Released!
    Philippe
    Posted @ 1/21/2005 4:07 PM
    An interesting step would be to include a true ActionScript compiler. Like MTASC. This open-source compiler is already quite complete.
    That would make Xamlon a very strong and accessible alternative to Macromedia Flash/Flex and Cie.


  • # RE: Xamlon Flash Beta Released!
    Ranjan
    Posted @ 1/22/2005 7:29 PM
    ROCKS! Keep up the good work....

Blog Stats

  • Posts - 125
  • Stories - 1
  • Comments - 1441
  • Trackbacks - 47

.Net Blogs

01101 Blogs

Flash Blogs

Graphics

People