CLR Extender Reference

.NET compiler for VFP language

Description »

The following section contains available features and planned features. See the Legal Disclaimer about the future plans.

The .NET Compiler for VFP will be a different, separate product from .NET Extender. You can test its functionality whether online (limited to 200 lines of code) or through the Alpha Technology Preview available only to registered users of .NET Extender.

The .NET Compiler goals is to achieve Full Compatibility with VFP and yet using all the power of the .NET Framework.

On its current incarnation (there will be monthly updates to the Alpha Preview Compiler available to registered users of .NET Extender) it is capable of:

  • Create fully managed verifiable assemblies, with pure IL. That is, the created assemblies can be run through PEVERIFY and it passes all the tests it does.
  • Because it produces full managed assemblies, pure IL, you can run it in other platforms like Windows Mobile1. So your apps are no longer tied to the 32 bits desktop, and can run in PDAs, Smart Phones and wherever the .NET framework functionality is available.
  • Creates debug info so you can step debug using any Managed Debugger like the one in Visual Studio 2005. The Preview ships with its own debugger so you can step through your code and debug it the .NET way.
  • Consume managed assemblies, thus it integrates very well with the .NET Framework.
  • Works with the .NET Framework 2.0.
  • Supports LOCAL, PRIVATE variables (PUBLIC also will be supported). You can create variables on the fly and reference them without previous declaration, of course like you can in VFP.
  • Supports the dynamic features of VFP like dynamic typing and polymorphism.
  • Gives you a performance improvement between 200% - 300% with only a recompile of your code 2.
  • Huge performance boost when you use the optional feature of strong typing. It can give you a 500%-1000% improvements.
  • The runtime library and Classes are being implemented in the Visual Foxpro Language.
  • Use SCAN, REPLACE, LOCATE, SELECT, etc commands. The goal is 100% coverture of VFP COMMANDS.
  • It supports language constructs necessary for the .NET Framework like:
    • DEFINE NAMESPACE ... ENDNAMESPACE (syntax, may change in a future revision)
    • DEFINE ENUM ... ENDDEFINE
    • DEFINE INTERFACE .... ENDEFINE
    • USING NameSpaceA::NameSpaceB so instead of writing

      TLOCAL aVar as aNameSpaceA::NameSpaceB::ClassX

      you just write

      TLOCAL aVar as ClassX

    • You can Implement Multiple .NET Interfaces.
    • Supports Method Overload, thus is declaring several methods with the same name differing only by the parameters type.
    • Operator overloading, you can declare operators (+,-,* and more) and then use them in your classes to simplify programming. Example, you can create a matrix class and then given aMatrix and bMatrix, add them using aMatrix + bMatrix
  • You can create Function Closures (AKA CodeBlocks in Clipper) easily, this give you a unmatched flexibility:
  • LOCAL oCall1
    TLOCAL oCall2
    
    oCall1 = { AS System.Object | x as System.Int32, y as System.Double| return x + y 
    		 }
    
    oValue = m.oCall1(5,2.4)
    * Should return 7.4
    
    ? oValue
  • Because it is the FOX Language it gives you the simplest Hello world! in the .NET world:
    ? "Hello world!"
  • Will ship with two VFP Tables LAYERS (one implemented using the VFP9 runtime) and other FULLY VFP Compatible 3 with the following extensions:
    • Table size limit of 16 Exabytes. The engine is 64 bits capable, so the maximum table size is 264 - 1. This is nearly 4,000,000,000 times bigger than the actual limit.
    • More than 255 fields by table.
    • Because we are implementing the Table and Database functionality in VFP it will be full Object Oriented. You can see how the implementation is and will be by compiling some program with table access and see the generated IL or examining VFP.Runtime.dll with the Assembly Browser.
    • The above means you'll be able to create your own Table Representation by deriving from the shipped one, so the only limit of what a Table is will be in your imagination.
  • The Base VFP Classes are going to be implemented in the VFP Language so it will have all the power possible using that powerful language.
  • The report functionality will be full Object Oriented using the Form Designer. The .NET Extender Print shipped sample gives you a glimpse of how it will be.
  • Other features "borrowed" from JavaScript 1.7, which will be shown soon include Generators and Iterators and Array Comprehensions (this name will change before release).
  • Borrowed from the next version of CSharp (CSharp 3.0) are TypeInference and Extension Methods.
  • There is on-going work to support Generics, we need your feedback about the most useful syntax for this, if using the VB syntax or the CSharp syntax or other one, figure yours.

So to summarize, this is an interesting time to be a FoxPro programmer!.

Example »

Remarks »
  • 1 To run in PDAs, Smart Phones, you'll have to include only functionality available in the Compact Framework.
  • 2 The performance improvements estimates are based on internal measurements done by eTecnologia.net, we'll publish the tests so you can do your own measurements.
  • 3 The table will remain compatible as long you don't push it over the VFP limits. For example if you grow it to more of 2 Gigas, VFP won't be able to read it.

See the Legal Disclaimer about the future plans.

Other Resources »


Send comments about this topic to eTecnologia.net.