Tuesday, September 14, 2004

Get Ready for .net 2.0 with Danny Thorpe - Part 1

Danny is breaking down all the details on .net 2.0.

Yukon is the driving force behind 2.0.

At the CLR level there are:

  • Generic Types
  • Expanded CLR Host (to allow Yukon to host the CLR)
  • 64-Bit Platform (not until 2.0)
  • Improved Compact Framework (less Hackish)

C# Language changes:

  • Generic Types (separate from the CLR Generic Types)
  • Partial Classes
  • Anonymous Methods
  • Iterators (yield)

Generics - The Delphi syntax will be significantly cleaner then C#'s syntax. This is mostly because Delphi is top down while C# is still a 2-pass compiler.

Anonymous methods - Instead of overriding a method you just fill in the blanks - putting in the code that handles it. It automatically creates a sibling method. Used to create a delegate - instead of putting in a method name you just put in the body of the code.

int localVar = 10;
obj.eventProp = new delegate { return 42 * localVar; localVar = localVar + 1 };

Similar feature may or may not be implemented in Delphi since this is a C# syntax feature and not a CLR feature.

Partial Classes - C# syntax that allows a class to be split into multiple source files. Once compiled the class is a single class with no representation of the original split. This will allow one source file with all the machine generated code in one file and then the user generated code in another file and then that can be compiled into a single class. This is to provide the same goal that Delphi had with the DFM and the PAS files separate.

Visual Basic.NET Changes

  • Support access to Generics Types, but not define them.
  • Partial Classes ("Extends")
  • Operator Overloading (Finally)
  • XML DocGen
  • Debugging: Edit & Continue - cannot edit currently executing code or code that is on the stack

Managed C++ Changes

  • More of a Do-Over then a few changes.
  • Syntax has been reworked
  • All new managed codegen and interoperability
  • Profile-Guided Optimizations (POGO) - while testing performance data is collected, and then used with the linker to improve the optimizations.

64-bit Platforms - Currently available in Beta for the AMD 64 instructions, close and Itanian-2, not Itanium-1

  • JIT compile IL to native 64 bit instructions
  • SizeOf( Pointer ) != SizeOf( Integer )
  • IntPtr type will be 64 bits wide - the size of a pointer
  • Native int will also be 64 bits (IntPtr)
  • P/Invoke will call into unmanaged Win64 code - you cannot use 32 dlls - must crosses processes to access 32-bit
  • IL binary portability - if flagged platform agnostic (a feature with 2.0)

VCL for .NET needs to be updated to work on 64-bit code. The 64-bit ready version will warn / error on incompatibility. Has not previously been supported.

Win32 Delphi may get Generics, unlikely to get Partial Classes.

No comments: