Dynamic Languages

Couple of days back i was discussing with one of my friend and he asked me how do you define dynamic languages? I tried defining but could not.
I found this interesting article in the MSDN Mag. Thought should blog about it.
  • Dynamic programming languages allow for a program’s structure to be changed while it runs:
  • functions may be introduced or removed, new classes of objects may be created, and new modules may appear.
  • These languages are usually dynamically typed, allowing variable declarations to change type during execution.
But just having dynamic types does not make a language dynamic.
Whenever we (myself, sendhil and manu) discuss about dynamic languages, manu always used to quote about IronPython, where sendhil always used mention about Ruby. I haven’t had a chance to read about IronPython.  This article discusses about IronPython.
IronPython is the code name for an implementation of the Python programming language written by the CLR team at Microsoft. IronPython runs on the Microsoft® .NET Framework and supports an interactive console with fully dynamic compilation.
It is well integrated with the rest of the .NET Framework and makes all .NET libraries easily available to Python programmers, while maintaining full compatibility with the Python language.
Multiple Return Values in C# and Python
object[] GetValues() {
    object[] results = new object[2];
    object[0] = 42;
    object[1] = "Hello";
    return results;
object[] results = GetValues();
int x = (int)results[0];
string s = (string)results[1];
def get_values() :
  return 42, "Hello"

x, s = get_values()

The above code example shows how to retrieve multiple values in C# and python.
I still remember the discussion i had with sendhil couple of months back where he gave me a more powerful example. Maybe its time to look again into sendhil’s blog 🙂
More information here…



Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s