PlayScript

by Miguel de Icaza

Those of you that saw my What is in Mono presentation at MonkeySpace know that there is a new language in the .NET world being developed by Zynga called PlayScript.

Check their home page on GitHub with cute videos!

PlayScript is a superset of ActionScript and it was based on Mono's C# 5.0 compiler. PlayScript is ActionScript augmented with C# 5.0 features.

Zynga's PlayScript allows developers that have some ActionScript/Flash code to bring their code to any platform that supports the ECMA Intermediate Language (Microsoft .NET and Mono) and blend it with other .NET languages.

But the PlayScript has a fabulous feature, it allows mixing code in both C# and PlayScript in the same compilation unit. For example, you can use the compiler like this:


	# Compile the C# source foo.cs into foo.exe
	$ mcs foo.cs

	# Compile the Playscript source bar.play into bar.exe
	$ mcs bar.play

	# Compile both C# and Playscript into a single executable
	$ mcs foo.cs bar.play
	

On a larger scale, you can see this in action in the pscorlib library. This library contains a blend of PlayScript and C# source code compiled into a single binary.

They have implemented the accelerated 3D APIs from Flash and ported some popular ActionScript libraries to PlayScript, like the Starling framework and Away3D.

They have also an add-on for Xamarin Studio that you can use to get IDE support for it.

At Xamarin we are working to integrate their language changes into Mono directly. You can track the integration work in the playscript-mono branch at GitHub.

Just like Unity's UnityScript, developers will be encouraged to use strong types to improve the performance of their applications.

You can join the PlayScript forum to track the progress of the project. And you can keep up with exciting developments.

Update: Some background on Playscript.

Posted on 20 Aug 2013