Silverlight supports various Dynamic languages like python, ruby, visual basic and jscript.
See here for a more detailed analysis on how Dynamic Languages run on top of the .NET Dynamic Language Runtime (DLR)
Also there is a msdn article that explains IronPython in detail here.
Yes, that's right, You can take Silverlight to go on your favorite Windows Mobile device. See Scott Holden demo the prototype Silverlight MLB app on a Windows Mobile device. Rob Unoki has more details about the demo in his blog here
Or if you are too lazy, the demo is right here...
Mel Sampat, a Program Manager @ Microsoft shows off Windows Mobile 6 and power of managed code. He shows off a sample managed application that does expense tracking. It uses managed voice recognition API's to provide voice recognition support. The demo is very cool and shows how powerful the .NET Compact framework is and how it enables application developers to write truly amazing applications on top of the .NET compact framework. Scott Guthrie @ Mix says that Microsoft is a platform company, this is one of many reasons why that statement is absolutely true.
http://channel9.msdn.com/ShowPost.aspx?PostID=303900
If you want to skip the initial part and go straightaway to the demo, goto 13:30sec in the video.
.NET Compact framework 3.5 support s the Language Integrated querying mechanism which allows developers to query a collection of enumerable objects through a set of predefined operators. LINQ has a set of operators that allows you to traverse, filter and select an enumerable collection using a syntax that is very similar to SQL. This makes it easy for developers to perform complex querying and selecting operations on a collection of enumerable objects easily.
Enough said, let us look at a bit of code that will explain things better.
Yesterday, I bumped into a real world scenario where I had to print out the list of files in a directory that had an extension .cs or .vb. In the olden days (err back in .NET 2.0 days, not long ago J), I would’ve done something like this
string[] files = Directory.GetFiles(@"\temp");
foreach (string file in files)
{
FileInfo fi = new FileInfo(file);
if (fi.Extension.ToLower() == ".cs" ||
fi.Extension.ToLower() == ".vb")
Console.WriteLine(fi.Name);
}
Armed with LINQ, I can do the same thing in the following way
var files = from file in Directory.GetFiles(@"\temp")
let fi = new FileInfo(file)
where fi.Extension.ToLower() == ".cs" ||
fi.Extension.ToLower() == ".vb"
select fi.Name;
foreach (string file in files)
Console.WriteLine(file);
As you can see from the extremely simple example, LINQ provides a simple and an elegant way to query collection of enumerable items, in this case it is the list of files (array of strings) returned by the Directory.GetFiles method.
All right, this might be trivial and you might be wondering why would you need to consider learning this when you could’ve just as easily done this the old fashioned way. The interesting thing (or I call it the *aha* factor) is that you could achieve more complex filtering and selection much more easily than the old fashioned way.
Consider this case where you need to not only print out the list of files that has an extension .cs or .vb, but you need to print out the list of files that start with the letter ‘s’ and has a .cs or .vb extension sorted descending . Try doing this, the old fashioned way J
With LINQ, All I have to do is
var sortedFiles = from file in Directory.GetFiles(@"\temp")
let fi = new FileInfo(file)
where fi.Name.ToLower().StartsWith("s") &&
(fi.Extension.ToLower() == ".cs"
|| fi.Extension.ToLower() == ".vb")
orderby fi.Name descending
select fi.Name;
foreach (string file in sortedFiles)
Console.WriteLine(file);
In VB.NET
Dim sortedFiles = From file In Directory.GetFiles("\temp") _
From fi = New FileInfo(file) _
Where fi.Name.ToLower().StartsWith("s") And _
fi.Extension.ToLower() = ".cs" _
Or fi.Extension.ToLower() = ".vb") _
Order By fi.Name Descending _
Select fi.Name
Voila, I was able to do this in 2 lines (technically) of simple intuitive code with LINQ. Without it, I would’ve had to create of array of string that had the list of files that match the criteria, then sort it and then print it. By now you should see the how greatly LINQ simplifies this kind of collection based operations. There are more complex operators supported by LINQ, for instance you can use group operator to group elements in a query. I will talk more about those operators in the future blog posts. Personally I don’t like reading blogs that span more than a single page. I like to factor things out just like we do when we code every day. So this is just an introductory post to get you guys started with LINQ. So Jump in, download the latest version of Visual Studio code name “Orcas” and start exploring LINQ.
Note: LINQ is a new feature of VB 9.0 compiler and c# 3.0 compiler that ships with .NET Framework 3.5. Not all features that are supported by the desktop .NET Framework is supported by .NET Compact framework.
For more info, look @ http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx
Disclaimers:
This posting is provided "AS IS" with no warranties, and confers no rights.
The information contained within this post is in relation to beta software. Any and all details are subject to change.
Hello Everyone!
This is my first (of hopefully many more to come) blog post here @ blogs.msdn.com. Without rambling forever, here is a brief overview of me
whoami : I'm Rajiv Srinivasan working with the NETCF team as a Software Development Engineer in Test here in MS Redmond , WA
I just joined MS couple of months ago, so technically I'm still a newbie around here. I went to the University of Minnesota in Minneapolis MN and worked for Thomson Corp for about a year and a half before I moved to MS. I own most of the core areas in NETCF including Garbage Collector, LINQ (Language Integrated Query--> new feature in Orcas which is the next version of .NET --> .NET 3.5 ), System I/O.
I will mostly blog about NETCF here in this blog as and when I find interesting things that will help anyone who is interested in developing managed applications for mobile devices. I hope my blog will be useful to the developer community in general. Please feel free to provide feedback about how to improve this blog.
Adios amigos!